/* Rithma - Stylesheet */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #14b8a6;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #0ea5e9;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --bottom-nav-track-height: 50px;
  --bottom-nav-side-padding: 40px;
  --bottom-nav-bottom-padding: 8px;
  --bottom-nav-bg: #ffffff;
  --disclosure-marker-inset: 0.35rem;
  --disclosure-marker-gap: 0.65rem;
  /* Mobile top bar + safe area (used to size chat panels without document overscroll). */
  --layout-mobile-topbar-height: calc(var(--rithma-safe-top) + 52px);
  --agency-chat-page-header: 5.5rem;
  --agency-chat-composer-height: 4.75rem;
  /* Bottom-right floating actions (scroll-to-top + Main Chat FAB). */
  --floating-action-size: 48px;
  --floating-action-gap: 12px;
  --shift-chat-fab-size: 64px;
  --shift-chat-fab-stack: calc(var(--shift-chat-fab-size) + 48px);
  /* Cross-origin Capacitor iframe: env() is often 0 — shell posts cutout via JS. */
  --rithma-safe-top: max(env(safe-area-inset-top, 0px), var(--rithma-shell-safe-top, 0px));
  --rithma-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--rithma-shell-safe-bottom, 0px));
  --rithma-safe-left: max(env(safe-area-inset-left, 0px), var(--rithma-shell-safe-left, 0px));
  --rithma-safe-right: max(env(safe-area-inset-right, 0px), var(--rithma-shell-safe-right, 0px));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
}
.skip-link:focus {
  position: fixed;
  left: max(16px, var(--rithma-safe-left));
  top: max(16px, calc(var(--rithma-safe-top) + 8px));
  width: auto;
  height: auto;
  padding: 10px 16px;
  overflow: visible;
  background: var(--primary, #2563eb);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: opacity 120ms ease-out;
}
body.page-leaving {
  opacity: 0.94;
  /* No ``pointer-events: none`` here. Safari (and other WebKit builds) re-check
     pointer-events on the click target *during* link activation, and setting
     it to ``none`` on <body> mid-click silently cancels the navigation the
     same click was about to perform — e.g. "Sign out" or auth-page switches
     looking like they "do nothing". The fade is purely a visual cue; the
     browser already serializes click-driven navigations. */
}
@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
  body.page-leaving { opacity: 1; }
  .main.page-swapping,
  .main.main--swap-loading::before {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .rithma-toast {
    transition: none !important;
  }
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
html, body {
  /* Pin html and body strictly to the visible viewport. ``position: fixed``
     on html anchors the document so content can't bleed past the right
     edge — the standard fix for stubborn iOS WebView side-scroll where
     ``overflow-x: hidden`` alone isn't enough. */
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  /* Vertical pan only — kills any horizontal swipe gesture at the page level. */
  touch-action: pan-y;
}
html:has(.layout),
body:has(.layout) {
  /* Stop iOS/WebKit rubber-band past the end of the page (empty grey below content). */
  overscroll-behavior-y: none;
}
html {
  height: 100%;
  position: relative;
}
body {
  /* Body fills html and may extend below the fold for vertical scrolling. */
  min-height: 100%;
}
/* Lock body scroll only on logged-in pages (which contain `.layout`).
   Auth pages have no `.layout`, so they keep their natural scroll. */
body:has(.layout) { overflow: hidden; }
.layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  width: 100%;
  /* ``100vw`` includes scrollbar width and often causes a few px of sideways drift. */
  max-width: 100%;
}
.sidebar {
  width: 252px;
  background: #fbfbfc;
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  /* Use safe-area insets so the sidebar respects iPhone notches / Android cutouts
     when packaged with Capacitor; harmless on the web because env() defaults to 0. */
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, var(--rithma-safe-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow: hidden;
}
.sidebar__header {
  flex-shrink: 0;
  padding: 4px 8px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.sidebar-household-switcher {
  flex-shrink: 0;
  padding: 0 8px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-household-switcher__label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar-household-switcher__select {
  width: 100%;
  font-size: 0.88rem;
  padding: 7px 9px;
}
.sidebar-household-switcher__select option[value="__add__"] {
  font-weight: 600;
}
.family-link-household-dialog {
  max-width: min(440px, calc(100vw - 24px));
  width: 440px;
}
.family-link-household-dialog__head {
  margin-bottom: 14px;
}
.family-link-household-dialog__title {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}
.brand__logo {
  display: block;
  width: auto;
  height: 26px;
  flex: 1 1 auto;
  min-width: 0;
}
.mobile-topbar__logo {
  display: block;
  width: auto;
  height: 22px;
  max-width: 42vw;
}
.sidebar .brand span {
  color: var(--primary);
}
.sidebar .role-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0;
}
.sidebar__role-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 2px;
}
.sidebar-agency-name {
  display: block;
  max-width: 100%;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.sidebar nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sidebar nav a,
.sidebar nav button {
  font-family: inherit;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  margin-bottom: 1px;
  color: #334155;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  transition: background 120ms ease, color 120ms ease;
}
.nav-link__label {
  min-width: 0;
  flex: 1;
}
.nav-link__badge {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary-light, #dbeafe);
  color: var(--primary-dark, #1d4ed8);
  border: 1px solid rgba(37, 99, 235, 0.28);
  font-size: 0.68rem;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
  box-sizing: border-box;
}
.nav-link--has-unread .nav-link__label {
  color: var(--primary-dark, #1d4ed8);
  font-weight: 600;
}
.nav-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: currentColor;
  opacity: 0.68;
}
.nav-link:hover .nav-icon,
.nav-link.active .nav-icon,
.nav-group.is-open > .nav-group__toggle .nav-icon,
.nav-group:has(.nav-link.active) > .nav-group__toggle .nav-icon {
  opacity: 1;
}
.nav-icon--sub {
  width: 14px;
  height: 14px;
  opacity: 0.52;
}
.nav-link--sub:hover .nav-icon,
.nav-link--sub.active .nav-icon {
  opacity: 0.92;
}
.nav-link:hover {
  background: rgba(15, 23, 42, 0.04);
  text-decoration: none;
  color: var(--text);
}
.nav-link.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark);
  font-weight: 600;
}
.nav-link--sub {
  padding: 5px 10px 5px 12px;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
}
.nav-link--sub:hover { color: var(--text); }
.nav-link--sub.active {
  color: var(--primary-dark);
  background: rgba(37, 99, 235, 0.08);
}
.nav-section-label {
  margin: 14px 10px 6px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.nav-group {
  margin-bottom: 2px;
}
.nav-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.nav-item__leading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}
.nav-group__toggle:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
}
.nav-group.is-open > .nav-group__toggle,
.nav-group:has(.nav-link.active) > .nav-group__toggle {
  color: var(--text);
}
.nav-group__chevron {
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 160ms ease;
}
.nav-group.is-open .nav-group__chevron {
  transform: rotate(180deg);
}
.nav-group__items {
  display: none;
  padding: 2px 0 4px;
}
.nav-group.is-open .nav-group__items {
  display: block;
}
.sidebar .logout {
  flex-shrink: 0;
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
  background: #fbfbfc;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.sidebar-user__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), #e0f2fe);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.sidebar-user__meta {
  min-width: 0;
  flex: 1;
}
.sidebar-user__name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user__email {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-account-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.sidebar-account-actions__link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.25;
}
.sidebar-account-actions__link:hover {
  color: var(--primary);
  text-decoration: underline;
}
.sidebar-account-actions__logout-form {
  display: inline;
  margin: 0;
  padding: 0;
  vertical-align: baseline;
}
.sidebar-account-actions__logout-form .sidebar-account-actions__link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-account-actions__sep {
  color: #cbd5e1;
  font-size: 0.78rem;
  line-height: 1;
  user-select: none;
}
.sidebar .device-local-time {
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: #94a3b8;
  font-size: 0.72rem;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.main {
  flex: 1;
  min-width: 0; /* lets flex children clamp to the available width */
  padding: 30px 40px;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-top: max(30px, env(safe-area-inset-top));
  padding-right: max(40px, env(safe-area-inset-right));
  padding-bottom: max(30px, var(--rithma-safe-bottom));
}
.main.page-swapping {
  pointer-events: none;
  will-change: opacity;
  /* Browser scroll anchoring tries to keep the old content in view while the
     swap replaces it, which fights the explicit scroll reset and shows up as a
     jump between pages. */
  overflow-anchor: none;
}
.main.main--swap-loading {
  position: relative;
}

/* Safety net: keep any long content (URLs, images, code, embeds) inside the
   page boundary so a single oversized element can't make the layout shift. */
.main img,
.main video,
.main iframe,
.main canvas,
.main svg { max-width: 100%; height: auto; }
.main pre,
.main code { max-width: 100%; overflow-x: auto; word-break: break-word; }
.main p,
.main li,
.main h1,
.main h2,
.main h3,
.main h4 { overflow-wrap: anywhere; }
.main .card { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }

/* Mobile drawer trigger + scrim — hidden by default, shown only at narrow widths.
   The same markup used by the desktop layout becomes a slide-out drawer below
   the tablet breakpoint without changing per-page templates. */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  /* Add safe-area on top of the inset so the white iOS status bar
     icons sit cleanly against the brand-blue top bar without crowding.
     ``--rithma-shell-safe-top`` is posted from the Capacitor shell when
     ``env()`` reports 0 inside the cross-origin Flask iframe. */
  padding-top: max(12px, calc(var(--rithma-safe-top) + 12px));
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  /* Brand-blue top bar so the LIGHT-content iOS status bar (white time /
     battery icons) stays clearly readable instead of blending into a
     white background. */
  background: var(--primary);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.mobile-topbar__title {
  font-weight: 700;
  color: #ffffff;
  font-size: 1.05em;
}
.mobile-topbar__menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  color: #ffffff;
  font-size: 1.2em;
}
.mobile-topbar__menu:active { background: rgba(255, 255, 255, 0.22); }
.mobile-topbar__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  color: #ffffff;
  font-size: 1.5em;
  line-height: 1;
  padding: 0 0 3px;
  font-weight: 600;
}
.mobile-topbar__back:active { background: rgba(255, 255, 255, 0.22); }
.mobile-topbar__back[hidden] { display: none; }

/* Desktop in-page back button (hidden on mobile — the top-bar one takes over). */
.app-desktop-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  width: 5.75rem;
  min-width: 5.75rem;
  max-width: 5.75rem;
  flex-shrink: 0;
  margin: 0 0 14px;
  padding: 6px 0;
  border: 1px solid var(--border, #d4d4d8);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text, #111827);
  font-size: 0.92em;
  font-weight: 600;
  line-height: 1.1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.app-desktop-back:hover {
  background: var(--bg-soft, #f3f4f6);
  border-color: var(--border-strong, #b0b3b8);
}
.app-desktop-back:active { transform: translateY(1px); }
.app-desktop-back > span[aria-hidden="true"] {
  font-size: 1.4em;
  line-height: 0.7;
  margin: 0;
  flex: none;
}
.app-desktop-back > span:not([aria-hidden="true"]) {
  flex: none;
}
.app-desktop-back[hidden] { display: none; }
@media (max-width: 830px) {
  .app-desktop-back { display: none; }
  .app-desktop-back[hidden] { display: none; }
}

.mobile-topbar__wake {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease,
    box-shadow 160ms ease;
}
.mobile-topbar__wake[hidden] { display: none; }
.mobile-topbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.field-roster-workspace-picker__select {
  display: block;
  width: 100%;
  max-width: 9.5rem;
  padding: 5px 28px 5px 8px;
  font-size: 12px;
  line-height: 1.3;
  font-family: inherit;
  font-weight: 600;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  background-color: var(--surface, #fff);
  color: var(--text, #0f172a);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.field-roster-workspace-picker__select:focus {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 1px;
}
.field-roster-workspace-picker--sidebar {
  flex: 1 1 7.5rem;
  min-width: 0;
}
.field-roster-workspace-picker--sidebar .field-roster-workspace-picker__select {
  max-width: none;
}
.field-roster-workspace-picker--mobile {
  display: none;
}
.field-roster-workspace-picker--mobile .field-roster-workspace-picker__select {
  width: auto;
  max-width: 7.25rem;
  padding: 4px 22px 4px 6px;
  font-size: 11px;
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' opacity='0.8' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-position: right 6px center;
}
@media (max-width: 830px) {
  .field-roster-workspace-picker--sidebar { display: none; }
  .field-roster-workspace-picker--mobile { display: block; }
}
/* Capacitor shell hides the sidebar — always use the top-bar picker. */
html[data-rithma-native-app="1"] .field-roster-workspace-picker--sidebar,
body.rithma-native-app .field-roster-workspace-picker--sidebar {
  display: none !important;
}
html[data-rithma-native-app="1"] .field-roster-workspace-picker--mobile,
body.rithma-native-app .field-roster-workspace-picker--mobile {
  display: block !important;
}
html[data-rithma-native-app="1"] .field-roster-workspace-picker--mobile .field-roster-workspace-picker__select,
body.rithma-native-app .field-roster-workspace-picker--mobile .field-roster-workspace-picker__select {
  min-height: 36px;
  min-width: 6.5rem;
  touch-action: manipulation;
}
.mobile-topbar__wake:active { transform: scale(0.96); }
.mobile-topbar__wake .mobile-topbar__wake-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 2px var(--primary, #1d4ed8);
  opacity: 0;
  transition: opacity 160ms ease, background 160ms ease, transform 220ms ease;
}
.mobile-topbar__wake.is-on {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.mobile-topbar__wake.is-on .mobile-topbar__wake-dot {
  opacity: 1;
  background: #34d399;
}
.mobile-topbar__wake.is-listening .mobile-topbar__wake-dot {
  animation: rithma-wake-pulse 1.4s ease-in-out infinite;
}
.mobile-topbar__wake.is-suspended .mobile-topbar__wake-dot {
  background: #fbbf24;
  animation: none;
}
.mobile-topbar__wake.is-resource-paused .mobile-topbar__wake-dot {
  background: #f97316;
}
.mobile-topbar__wake.is-locked,
.mobile-topbar__wake:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  background: rgba(148, 163, 184, 0.28);
  border-color: rgba(226, 232, 240, 0.45);
  box-shadow: none;
}
.mobile-topbar__wake.is-locked:active,
.mobile-topbar__wake:disabled:active {
  transform: none;
}
.mobile-topbar__wake.just-fired {
  background: #ffffff;
  color: var(--primary, #1d4ed8);
  border-color: #ffffff;
}
.mobile-topbar__wake.just-fired .mobile-topbar__wake-dot {
  background: var(--primary, #1d4ed8);
  transform: scale(1.4);
}
@keyframes rithma-wake-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-topbar__wake.is-listening .mobile-topbar__wake-dot { animation: none; }
  .main-wake-desktop.is-listening .main-wake-dot { animation: none; }
}

/* Wake-word on wide layouts: keep control in <main> — compact top bar hidden ≥831px,
   and UA [hidden] rules can fight sidebar-only placement. */
.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text, #0f172a);
  text-decoration: none;
  flex: 0 0 auto;
}
.notification-bell:hover {
  background: rgba(148, 163, 184, 0.16);
}
.notification-bell__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary-light, #dbeafe);
  color: var(--primary-dark, #1d4ed8);
  border: 1px solid rgba(37, 99, 235, 0.28);
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
  text-align: center;
  box-sizing: border-box;
}
/* Beat `.sidebar .brand span { color: var(--primary) }` — badge is a span inside brand */
.sidebar .brand .notification-bell__badge {
  color: var(--primary-dark, #1d4ed8);
}
.notification-bell--sidebar {
  margin-left: auto;
  color: var(--text, #0f172a);
}
.notification-bell--sidebar:hover {
  background: rgba(148, 163, 184, 0.16);
}
.sidebar__header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-consent-dialog {
  max-width: 480px;
}
.ai-consent-dialog__title {
  margin: 0 0 12px;
}
.ai-consent-dialog__body p {
  margin: 0 0 10px;
}
.ai-consent-dialog__body p:last-child {
  margin-bottom: 0;
}
.ai-chat-composer--locked .messenger-compose__bar {
  opacity: 0.55;
  pointer-events: none;
}
.ai-chat-composer--locked .shift-chat__pending-photos {
  pointer-events: none;
}
.ai-chat-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
}

.ai-chat-disclaimer__text {
  flex: 1 1 auto;
}

.ai-chat-disclaimer__dismiss {
  flex: 0 0 auto;
  margin: -2px -2px 0 0;
  padding: 0;
  width: 20px;
  height: 20px;
  line-height: 18px;
  font-size: 16px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.65;
}

.ai-chat-disclaimer__dismiss:hover,
.ai-chat-disclaimer__dismiss:focus-visible {
  opacity: 1;
  background: rgba(148, 163, 184, 0.2);
}

.main-top-tools {
  display: none;
}
@media (min-width: 831px) {
  .main-top-tools {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: -4px 0 16px;
    min-height: 0;
    flex-wrap: wrap;
    gap: 8px;
  }
  /* No extra gutter when wake-word toggle stays hidden (unsupported). */
  .main-top-tools:not(:has(.main-wake-desktop:not([hidden]))) {
    display: none !important;
  }
}
@media (max-width: 830px) {
  .main-top-tools {
    display: none !important;
  }
}

.main-wake-desktop {
  display: none;
  position: relative;
  box-sizing: border-box;
  min-width: 44px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  background: #fff;
  color: var(--primary, #2563eb);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.main-wake-desktop .main-wake-dot {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 2px var(--border, #e2e8f0);
  opacity: 0;
  transition: opacity 160ms ease, background 160ms ease;
}
.main-wake-desktop.is-on {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.08);
}
.main-wake-desktop.is-on .main-wake-dot {
  opacity: 1;
  background: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35);
}
.main-wake-desktop.is-listening .main-wake-dot {
  animation: rithma-wake-pulse 1.4s ease-in-out infinite;
}
.main-wake-desktop.is-suspended .main-wake-dot {
  background: #fbbf24;
  animation: none;
}
.main-wake-desktop.is-resource-paused .main-wake-dot {
  background: #f97316;
}
.main-wake-desktop.is-locked,
.main-wake-desktop:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
.main-wake-desktop.just-fired {
  background: rgba(37, 99, 235, 0.16);
}
@media (min-width: 831px) {
  /* Defeat UA [hidden]{display:none!important} edge cases when JS clears hidden. */
  .main-wake-desktop:not([hidden]) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}
.mobile-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 45;
  opacity: 0;
  transition: opacity 160ms ease;
}
body.is-sidebar-open .mobile-scrim { display: block; opacity: 1; }

/* Tablet: narrow but always-on sidebar so split-view stays comfortable. */
@media (max-width: 1024px) and (min-width: 831px) {
  .sidebar { width: 200px; padding: 16px 12px; }
  .main { padding: 24px 28px; }
}

/* Phones / small tablets in portrait: sidebar becomes a drawer. */
@media (max-width: 830px) {
  body:has(.layout) {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: none;
  }
  .layout { flex-direction: column; height: auto; overflow: visible; }
  .mobile-topbar { display: flex; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 84%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: 50;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    overflow: hidden;
  }
  body.is-sidebar-open .sidebar { transform: translateX(0); }
  .main {
    flex: 0 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 18px 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .main:has([data-agency-chat]) {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--layout-mobile-topbar-height));
    margin-bottom: 0;
    padding-bottom: max(18px, var(--rithma-safe-bottom));
  }
  .main:has([data-agency-chat]) .page-header {
    margin-bottom: 12px;
  }
  .main:has([data-agency-chat]) .agency-chat {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .main:has([data-agency-chat]) .agency-chat .shift-chat__thread {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
  }
  .main:has([data-agency-chat]) .agency-chat .shift-chat__composer {
    margin-top: auto;
    flex-shrink: 0;
  }

  /* Tighten typography + spacing so dashboards stay readable on a phone. */
  .page-header h1 { font-size: 1.3em; }
  .card { padding: 16px; }
  .form-group label { font-size: 1em; }
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* prevent iOS zoom-on-focus */
    padding: 11px 12px;
  }
  .form-group select,
  .form-group input[type="date"],
  .form-group input[type="time"],
  .form-field select,
  .form-field input[type="date"],
  .form-field input[type="time"] {
    height: 44px;
    min-height: 44px;
  }
  .messenger-compose textarea,
  .shift-chat__input,
  .shift-chat__bar .voice-input-wrap > textarea.shift-chat__input,
  .messenger-member-search {
    font-size: 16px; /* prevent iOS zoom-on-focus */
  }
  .btn { padding: 11px 18px; font-size: 1em; min-height: 44px; }
  .btn-sm { min-height: 36px; }
  /* Tap targets in the sidebar should also feel native. */
  .nav-link { padding: 11px 12px; font-size: 0.95rem; }
  .nav-link--sub { padding: 9px 12px 9px 14px; font-size: 0.9rem; }
  .nav-group__toggle { padding: 11px 12px; font-size: 0.95rem; }
  /* Wide tables should scroll horizontally instead of overflowing the page. */
  table { font-size: 0.95em; }
  .table-wrap,
  .responsive-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
  }
}

/* Intentional horizontal scroll regions — isolate swipe from the page shell. */
.bottom-nav__track-scroll,
.bottom-nav__track,
.table-wrap,
.responsive-table,
.care-plan-section-nav {
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}

/* Honor user prefs in installed-app contexts. */
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .mobile-scrim { transition: none; }
}

/* -------------------------------------------------------------------------
   Native mobile app (Capacitor) — bottom tab bar instead of sidebar drawer.
   Scoped to ``data-rithma-native-app`` so mobile browsers keep the drawer.
   ------------------------------------------------------------------------- */
/* iOS WebKit auto-zooms focused fields when computed font-size is below 16px.
   Chat composers and some form controls use ``em`` sizing (~15px) — pin 16px
   in the native shell so tapping inputs does not zoom the page. */
html[data-rithma-native-app="1"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html[data-rithma-native-app="1"] select,
html[data-rithma-native-app="1"] textarea,
body.rithma-native-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body.rithma-native-app select,
body.rithma-native-app textarea {
  font-size: 16px;
}
html[data-rithma-native-app="1"] .bottom-nav.bottom-nav--ready,
body.rithma-native-app .bottom-nav.bottom-nav--ready {
  display: block;
  --bottom-nav-side-padding: 12px;
}
html[data-rithma-native-app="1"] .mobile-topbar {
  display: flex !important;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* iOS / generic native: honor env() + shell CSS vars. */
  padding-top: max(12px, calc(var(--rithma-safe-top) + 12px));
}
/* Android: cutout clearance is a locked WebView topMargin in MainActivity
   (StatusBar overlay is OFF). CSS must NOT also add --rithma-shell-safe-top
   or env(safe-area-inset-top) — that was the "top doubles on keyboard" bug.
   Bottom: MainActivity posts --rithma-shell-safe-bottom into the iframe; do
   NOT max() with env(safe-area-inset-bottom) here or fixed bottom-nav double-
   stacks above the system bar (white gap). Native WebView never uses
   bottomMargin for nav bars — only CSS padding inside .bottom-nav. */
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] {
  --layout-mobile-topbar-height: 64px;
  --rithma-shell-safe-top: 0px;
  --rithma-safe-bottom: var(--rithma-shell-safe-bottom, 0px);
  --bottom-nav-offset: calc(
    var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
      var(--rithma-safe-bottom)
  );
  /* Taller tab bar for thumb reach / readability on Android. */
  --bottom-nav-track-height: 64px;
  --bottom-nav-bottom-padding: 12px;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .main {
  padding-bottom: calc(16px + var(--bottom-nav-offset));
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .scroll-to-top,
html[data-rithma-native-app="1"][data-rithma-native-platform="android"]
  body:has(.bottom-nav.bottom-nav--ready)
  .scroll-to-top {
  bottom: calc(12px + var(--bottom-nav-offset));
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .main-chat-fab,
html[data-rithma-native-app="1"][data-rithma-native-platform="android"]
  body:has(.bottom-nav.bottom-nav--ready)
  .main-chat-fab {
  bottom: calc(12px + var(--bottom-nav-offset));
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"]
  body:has(.bottom-nav.bottom-nav--ready):has(.main-chat-fab:not([hidden]))
  .scroll-to-top {
  bottom: calc(
    12px + var(--bottom-nav-offset) + var(--floating-action-size) +
      var(--floating-action-gap)
  );
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .main-chat-panel,
html[data-rithma-native-app="1"][data-rithma-native-platform="android"]
  body:has(.bottom-nav.bottom-nav--ready)
  .main-chat-panel {
  bottom: calc(12px + var(--bottom-nav-offset) + 96px);
}
@media (max-width: 768px) {
  html[data-rithma-native-app="1"][data-rithma-native-platform="android"]
    .form-next-required-dock,
  html[data-rithma-native-app="1"][data-rithma-native-platform="android"]
    body:has(.bottom-nav.bottom-nav--ready)
    .form-next-required-dock {
    bottom: calc(12px + var(--bottom-nav-offset));
  }
  html[data-rithma-native-app="1"][data-rithma-native-platform="android"]
    body:has(.main-chat-fab:not([hidden]))
    .form-next-required-dock {
    bottom: calc(
      max(20px, var(--rithma-safe-bottom)) + var(--floating-action-size) +
        var(--floating-action-gap)
    );
  }
  html[data-rithma-native-app="1"][data-rithma-native-platform="android"]
    body:has(.bottom-nav.bottom-nav--ready):has(.main-chat-fab:not([hidden]))
    .form-next-required-dock {
    bottom: calc(
      12px + var(--bottom-nav-offset) + var(--floating-action-size) +
        var(--floating-action-gap)
    );
  }
}
/* iOS (and generic native): match the real topbar height when the shell posts cutout insets. */
html[data-rithma-native-app="1"]:not([data-rithma-native-platform="android"]) {
  --layout-mobile-topbar-height: calc(
    max(12px, calc(var(--rithma-safe-top) + 12px)) + 40px
  );
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .mobile-topbar {
  padding-top: 12px !important;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .bottom-nav__item {
  gap: 4px;
  min-width: 58px;
  padding: 10px 4px 8px;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .bottom-nav__icon {
  width: 26px;
  height: 26px;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .bottom-nav__icon .nav-icon {
  width: 24px;
  height: 24px;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .bottom-nav__label {
  font-size: 0.6875rem;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .bottom-nav__section {
  height: 28px;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .bottom-nav {
  bottom: 0 !important;
  margin-bottom: 0 !important;
}
html[data-rithma-native-app="1"]:has(.auth-wrapper),
html[data-rithma-native-app="1"] body:has(.auth-wrapper) {
  height: 100%;
  min-height: 100%;
  max-height: 100%;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .auth-wrapper {
  min-height: 100%;
  min-height: -webkit-fill-available;
}
@media (max-width: 480px) {
  html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .auth-wrapper {
    padding-top: max(
      72px,
      calc(var(--rithma-safe-top) + 32px)
    );
  }
}
/* Soft keyboard (Android): the SHELL shrinks the #webview iframe from the
   bottom by the keyboard height, so this document's own viewport already ends
   above the keyboard — the top edge never moves. Inside the iframe we only
   hide the bottom nav (frees space) and tighten the chat composer padding so
   the input sits right above the keyboard. Never re-add keyboard height here
   or it would double-shrink and leave a gap. */
html[data-rithma-native-app="1"][data-rithma-native-platform="android"][data-rithma-keyboard="1"] .bottom-nav {
  display: none !important;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"][data-rithma-keyboard="1"] .main {
  /* Bottom nav is hidden while typing — reclaim its reserved space. */
  padding-bottom: 12px !important;
}
html[data-rithma-native-app="1"][data-rithma-native-platform="android"][data-rithma-keyboard="1"] .main:has([data-agency-chat]) .agency-chat .shift-chat__composer,
html[data-rithma-native-app="1"][data-rithma-native-platform="android"][data-rithma-keyboard="1"] .shift-chat__composer,
html[data-rithma-native-app="1"][data-rithma-native-platform="android"][data-rithma-keyboard="1"] .current-shift-root--chat .shift-chat__composer,
html[data-rithma-native-app="1"][data-rithma-native-platform="android"][data-rithma-keyboard="1"] .main-chat-panel .shift-chat__composer {
  padding-bottom: 8px !important;
}
html[data-rithma-native-app="1"] .main-top-tools {
  display: none !important;
}
/* Legacy native: hide sidebar (pre-hybrid). Hybrid re-enables drawer + hamburger. */
html[data-rithma-native-app="1"]:not([data-rithma-nav-hybrid="1"]) .sidebar,
html[data-rithma-native-app="1"]:not([data-rithma-nav-hybrid="1"]) .mobile-scrim {
  display: none !important;
}
html[data-rithma-native-app="1"]:not([data-rithma-nav-hybrid="1"]) .mobile-topbar__menu {
  display: none !important;
}
/* Hybrid (#3): full sidebar drawer via top-bar hamburger on native. */
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .sidebar {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 84%;
  max-width: 320px;
  height: 100vh;
  height: 100dvh;
  border-right: 1px solid var(--border);
  border-bottom: 0;
  transform: translateX(-100%);
  transition: transform 200ms ease;
  z-index: 70;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  padding-top: max(12px, var(--rithma-safe-top));
}
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] body.is-sidebar-open .sidebar {
  transform: translateX(0);
}
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .mobile-scrim {
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 65;
  opacity: 0;
  transition: opacity 160ms ease;
}
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] body.is-sidebar-open .mobile-scrim {
  display: block !important;
  opacity: 1;
}
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .mobile-topbar__menu {
  display: inline-flex !important;
}
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .bottom-nav--hybrid .bottom-nav__track-scroll {
  flex: 1 1 auto;
  justify-content: space-around;
  overflow: hidden;
}
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .bottom-nav--hybrid .bottom-nav__track-end {
  display: none;
}
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .bottom-nav--hybrid .bottom-nav__item {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .bottom-nav--hybrid .bottom-nav__flyout,
html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .bottom-nav--hybrid .bottom-nav__scrim {
  display: none !important;
}
/* Option A: auto-hide floating pill on scroll. */
html[data-rithma-native-app="1"][data-rithma-nav-pill="1"] .bottom-nav.bottom-nav--pill {
  background: transparent;
  border-top: 0;
  padding-left: 12px;
  padding-right: 12px;
  transition: transform 200ms ease, opacity 200ms ease, visibility 200ms ease;
}
html[data-rithma-native-app="1"][data-rithma-nav-pill="1"] .bottom-nav.bottom-nav--pill .bottom-nav__track {
  max-width: min(320px, calc(100vw - 24px));
  margin: 0 auto;
  background: var(--bottom-nav-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
  padding: 4px 6px;
}
html[data-rithma-native-app="1"][data-rithma-nav-pill="1"] .bottom-nav.bottom-nav--pill.bottom-nav--hidden {
  transform: translateY(calc(100% + 8px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
html[data-rithma-native-app="1"][data-rithma-nav-pill="1"] body.bottom-nav-pill-hidden .main {
  padding-bottom: calc(16px + var(--rithma-safe-bottom));
}
html[data-rithma-native-app="1"][data-rithma-nav-pill="1"] body.bottom-nav-pill-hidden:has(.bottom-nav.bottom-nav--ready) .scroll-to-top,
html[data-rithma-native-app="1"][data-rithma-nav-pill="1"] body.bottom-nav-pill-hidden:has(.bottom-nav.bottom-nav--ready) .main-chat-fab,
html[data-rithma-native-app="1"][data-rithma-nav-pill="1"] body.bottom-nav-pill-hidden:has(.bottom-nav.bottom-nav--ready) .shift-chat-fab {
  bottom: calc(12px + var(--rithma-safe-bottom));
}
@media (prefers-reduced-motion: reduce) {
  html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .sidebar,
  html[data-rithma-native-app="1"][data-rithma-nav-hybrid="1"] .mobile-scrim,
  html[data-rithma-native-app="1"][data-rithma-nav-pill="1"] .bottom-nav.bottom-nav--pill {
    transition: none;
  }
}
/* Pin the native shell: top bar + scrollable main — no document-level sideways drift. */
html[data-rithma-native-app="1"]:has(.layout) {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
html[data-rithma-native-app="1"] body:has(.layout) {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
}
html[data-rithma-native-app="1"] .layout {
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}
html[data-rithma-native-app="1"] .main {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px;
  /* Safe-area top is handled by .mobile-topbar — avoid double inset here. */
  padding-top: 12px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  /* Content ends above the fixed bottom nav shell (track + home-indicator safe area). */
  padding-bottom: calc(16px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) + var(--rithma-safe-bottom));
}
html[data-rithma-native-app="1"] .main:has([data-agency-chat]) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}
html[data-rithma-native-app="1"] .main:has([data-agency-chat]) .agency-chat {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
html[data-rithma-native-app="1"] .main:has([data-agency-chat]) .agency-chat .shift-chat__thread {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}
html[data-rithma-native-app="1"] .main:has([data-agency-chat]) .agency-chat .shift-chat__composer {
  margin-top: auto;
  flex-shrink: 0;
  padding-bottom: max(
    10px,
    calc(
      var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
        var(--rithma-safe-bottom)
    )
  );
}
.scroll-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, var(--rithma-safe-bottom));
  z-index: 65;
  width: var(--floating-action-size);
  height: var(--floating-action-size);
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease,
    background 0.15s ease, box-shadow 0.15s ease;
}
.scroll-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-to-top:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
  text-decoration: none;
}
.scroll-to-top:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.intake-draft-status--ok {
  color: var(--success);
}
.intake-draft-status--error {
  color: var(--danger);
}

html[data-rithma-native-app="1"] .scroll-to-top,
body:has(.bottom-nav.bottom-nav--ready) .scroll-to-top {
  bottom: calc(
    12px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
      var(--rithma-safe-bottom)
  );
}
@media (prefers-reduced-motion: reduce) {
  .scroll-to-top {
    transition: opacity 0.01s, visibility 0.01s;
    transform: none;
  }
  .scroll-to-top.is-visible {
    transform: none;
  }
}

/* Floating Main Chat widget (agency, independent, primary — not shift chat) */
.main-chat-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, var(--rithma-safe-bottom));
  z-index: 74;
  pointer-events: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--floating-action-size);
  height: var(--floating-action-size);
  margin: 0;
  padding: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
html[data-rithma-native-app="1"] .main-chat-fab,
body:has(.bottom-nav.bottom-nav--ready) .main-chat-fab {
  bottom: calc(
    12px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
      var(--rithma-safe-bottom)
  );
}
body:has(.main-chat-fab:not([hidden])) .scroll-to-top {
  bottom: calc(
    max(20px, var(--rithma-safe-bottom)) + var(--floating-action-size) + var(--floating-action-gap)
  );
}
body:has(.bottom-nav.bottom-nav--ready):has(.main-chat-fab:not([hidden])) .scroll-to-top {
  bottom: calc(
    12px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
      var(--rithma-safe-bottom) + var(--floating-action-size) + var(--floating-action-gap)
  );
}
.main-chat-fab:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}
.main-chat-fab.is-open:not(.main-chat-fab--speech-on) {
  background: var(--primary-light);
  color: var(--primary);
}
.main-chat-fab--speech-on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 16px rgba(37, 99, 235, 0.35);
}
.main-chat-fab--speech-on:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.main-chat-fab--speech-on.is-open {
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
}
.main-chat-fab--listening {
  animation: voice-input-pulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
.main-chat-fab--speaking,
.main-chat-fab--waiting {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}
.main-chat-fab__speech-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.main-chat-fab--listening .main-chat-fab__speech-badge {
  background: #ef4444;
}
.main-chat-fab--speaking .main-chat-fab__speech-badge,
.main-chat-fab--waiting .main-chat-fab__speech-badge {
  background: #f59e0b;
}
.main-chat-fab__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  animation: main-chat-fab-pulse 1.4s ease-out infinite;
  pointer-events: none;
}
@keyframes main-chat-fab-pulse {
  0% { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.15); opacity: 0; }
}
.main-chat-panel {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(max(20px, var(--rithma-safe-bottom)) + 96px);
  width: min(420px, calc(100vw - 24px));
  height: min(72vh, 640px);
  max-height: min(72vh, 640px);
  z-index: 73;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}
html[data-rithma-native-app="1"] .main-chat-panel,
body:has(.bottom-nav.bottom-nav--ready) .main-chat-panel {
  bottom: calc(
    12px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
      var(--rithma-safe-bottom) + 96px
  );
}
.main-chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 10px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), #fff 70%);
  flex-shrink: 0;
}
.main-chat-panel__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.main-chat-panel__subtitle {
  font-size: 12px;
}
.main-chat-panel__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.main-chat-panel__header-actions .btn-sm {
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 0.82rem;
}
.main-chat-panel__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.main-chat-panel__close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.chat-fullscreen-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.chat-fullscreen-btn:hover,
.chat-fullscreen-btn.is-active {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}
html[data-rithma-native-app="1"] .chat-fullscreen-btn,
body:has(.bottom-nav.bottom-nav--ready) .chat-fullscreen-btn {
  display: flex;
}
@media (max-width: 830px) {
  .chat-fullscreen-btn {
    display: flex;
  }
}
.main-chat-panel.is-chat-fullscreen {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 0;
  z-index: 200;
}
@media (max-width: 830px) {
  .main-chat-panel.is-chat-fullscreen,
  .shift-chat.is-chat-fullscreen {
    top: var(--layout-mobile-topbar-height);
  }
  .shift-chat-panel.is-chat-fullscreen {
    top: var(--layout-mobile-topbar-height);
  }
}
html[data-rithma-native-app="1"] .main-chat-panel.is-chat-fullscreen,
html[data-rithma-native-app="1"] .shift-chat.is-chat-fullscreen,
body.rithma-native-app .main-chat-panel.is-chat-fullscreen,
body.rithma-native-app .shift-chat.is-chat-fullscreen {
  top: var(--layout-mobile-topbar-height);
}
/* Fullscreen must reach the viewport bottom — the docked-panel bottom offset
   from html[data-rithma-native-app] / bottom-nav rules has higher specificity. */
html[data-rithma-native-app="1"] .main-chat-panel.is-chat-fullscreen,
body:has(.bottom-nav.bottom-nav--ready) .main-chat-panel.is-chat-fullscreen {
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
}
html[data-rithma-native-app="1"] .shift-chat-panel.is-chat-fullscreen,
body:has(.bottom-nav.bottom-nav--ready) .shift-chat-panel.is-chat-fullscreen {
  top: var(--layout-mobile-topbar-height);
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
}
/* Android topbar is 12px padding + 40px controls — not the 64px bottom-nav offset var. */
html[data-rithma-native-app="1"][data-rithma-native-platform="android"] .shift-chat-panel.is-chat-fullscreen {
  top: calc(12px + 40px);
}
body.has-chat-fullscreen--main .main-chat-fab {
  visibility: hidden;
  pointer-events: none;
}
body.has-chat-fullscreen--main .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}
body.has-chat-fullscreen {
  overflow: hidden;
}
.main-chat-panel__body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.main-chat-panel__loading {
  padding: 16px;
}
.main-chat-panel__inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.main-chat-panel__inner .shift-chat.agency-chat {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.main-chat-panel__inner .shift-chat__thread,
.main-chat-panel__inner .shift-chat__thread.messenger-bubbles {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.main-chat-panel__inner [data-agency-chat-messages-list] {
  min-height: min-content;
  gap: 14px;
}
.main-chat-panel__inner .shift-chat__composer {
  flex-shrink: 0;
  position: relative;
  margin-top: auto;
  z-index: 2;
}
.main-chat-panel__inner .ai-chat-disclaimer {
  margin: 8px 12px 0;
  flex-shrink: 0;
}
/* Mini chat: never use the 80dvh shift thread height — clip the composer. */
.main-chat-panel .shift-chat.agency-chat,
.main-chat-panel [data-main-chat-root].shift-chat {
  --shift-chat-thread-height: auto;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.main-chat-panel .shift-chat__thread,
.main-chat-panel .shift-chat__thread.messenger-bubbles {
  flex: 1 1 0;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.main-chat-panel .shift-chat__composer {
  flex-shrink: 0;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  margin-top: auto;
  z-index: 2;
}
.main-chat-panel .ai-chat-disclaimer {
  flex-shrink: 0;
  margin: 8px 12px 0;
}

/* Floating Shift Chat widget (Current shift — in-progress visit) */
.shift-chat-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, var(--rithma-safe-bottom));
  z-index: 74;
  pointer-events: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--shift-chat-fab-size);
  height: var(--shift-chat-fab-size);
  margin: 0;
  padding: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.shift-chat-fab__icon {
  width: 30px;
  height: 30px;
}
html[data-rithma-native-app="1"] .shift-chat-fab,
body:has(.bottom-nav.bottom-nav--ready) .shift-chat-fab {
  bottom: calc(
    12px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
      var(--rithma-safe-bottom)
  );
}
body:has(.shift-chat-fab:not([hidden])) .scroll-to-top {
  bottom: calc(
    max(20px, var(--rithma-safe-bottom)) + var(--shift-chat-fab-size) + var(--floating-action-gap)
  );
}
body:has(.bottom-nav.bottom-nav--ready):has(.shift-chat-fab:not([hidden])) .scroll-to-top {
  bottom: calc(
    12px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
      var(--rithma-safe-bottom) + var(--shift-chat-fab-size) + var(--floating-action-gap)
  );
}
.shift-chat-fab:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}
.shift-chat-fab.is-open {
  background: var(--primary-light);
  color: var(--primary);
}
.shift-chat-panel {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(max(20px, var(--rithma-safe-bottom)) + var(--shift-chat-fab-stack));
  width: min(420px, calc(100vw - 24px));
  height: min(72vh, 640px);
  max-height: min(72vh, 640px);
  z-index: 73;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}
html[data-rithma-native-app="1"] .shift-chat-panel,
body:has(.bottom-nav.bottom-nav--ready) .shift-chat-panel {
  bottom: calc(
    12px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
      var(--rithma-safe-bottom) + var(--shift-chat-fab-stack)
  );
}
.shift-chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 10px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), #fff 70%);
  flex-shrink: 0;
}
.shift-chat-panel__back {
  display: none;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 6px 8px 6px 4px;
  font-size: 0.92em;
  font-weight: 600;
  line-height: 1;
}
.shift-chat-panel__back-label {
  display: inline;
}
.shift-chat-panel__back:hover {
  background: rgba(37, 99, 235, 0.08);
}
html[data-rithma-native-app="1"] .shift-chat-panel__back,
body:has(.bottom-nav.bottom-nav--ready) .shift-chat-panel__back {
  display: inline-flex;
}
html[data-rithma-native-app="1"] .shift-chat-panel .chat-fullscreen-btn,
body:has(.bottom-nav.bottom-nav--ready) .shift-chat-panel .chat-fullscreen-btn,
html[data-rithma-native-app="1"] .shift-chat-panel__close,
body:has(.bottom-nav.bottom-nav--ready) .shift-chat-panel__close {
  display: none;
}
@media (max-width: 830px) {
  .shift-chat-panel__back {
    display: inline-flex;
  }
  .shift-chat-panel .chat-fullscreen-btn,
  .shift-chat-panel__close {
    display: none;
  }
}
.shift-chat-panel__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.shift-chat-panel__subtitle {
  font-size: 12px;
}
.shift-chat-panel__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.shift-chat-panel__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shift-chat-panel__close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.shift-chat-panel__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shift-chat-panel__inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.shift-chat-panel .shift-chat.shift-chat--widget {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  --shift-chat-thread-height: auto;
}
.shift-chat-panel .shift-chat__thread,
.shift-chat-panel .shift-chat__thread.messenger-bubbles {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.shift-chat-panel .shift-chat__composer {
  flex-shrink: 0;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  margin-top: auto;
  z-index: 2;
}
.shift-chat-panel .ai-chat-disclaimer {
  flex-shrink: 0;
  margin: 8px 12px 0;
}
.shift-chat-panel.is-chat-fullscreen {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 0;
  z-index: 200;
}
.shift-chat-panel.is-chat-fullscreen .shift-chat-panel__header {
  /* Panel already sits below .mobile-topbar — do not add safe-area again. */
  padding-top: 12px;
}
html[data-rithma-native-app="1"] .shift-chat-panel.is-chat-fullscreen .shift-chat-panel__header,
body:has(.bottom-nav.bottom-nav--ready) .shift-chat-panel.is-chat-fullscreen .shift-chat-panel__header {
  padding-top: 12px;
}
/* Widget panel is fullscreen — inner chat stays in the flex column (not viewport-fixed). */
.shift-chat-panel.is-chat-fullscreen .shift-chat.is-chat-fullscreen {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  flex: 1 1 auto;
  min-height: 0;
  box-shadow: none;
}
body.has-chat-fullscreen--shift .shift-chat-fab {
  display: none;
}

.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  pointer-events: none;
  background: var(--bottom-nav-bg);
  border-top: 1px solid var(--border);
  /* Safe inset is internal padding so the bar stays flush to the screen edge
     (no scrollable content visible beneath it). */
  padding-bottom: calc(var(--bottom-nav-bottom-padding) + var(--rithma-safe-bottom));
  padding-left: var(--rithma-safe-left);
  padding-right: var(--rithma-safe-right);
}
.bottom-nav.bottom-nav--ready {
  pointer-events: auto;
}
.bottom-nav__scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.28);
}
.bottom-nav__flyout {
  position: absolute;
  left: var(--bottom-nav-side-padding);
  right: var(--bottom-nav-side-padding);
  bottom: calc(100% + 6px);
  z-index: 3;
  background: var(--bottom-nav-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  max-height: min(50vh, 320px);
  display: flex;
  flex-direction: column;
}
.bottom-nav__flyout[hidden] {
  display: none !important;
}
.bottom-nav__flyout-title {
  padding: 10px 14px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94a3b8;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bottom-nav__flyout-items {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
}
.bottom-nav__flyout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.bottom-nav__flyout-link:hover,
.bottom-nav__flyout-link:focus-visible {
  text-decoration: none;
  background: rgba(15, 23, 42, 0.04);
}
.bottom-nav__flyout-link.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark);
  font-weight: 600;
}
.bottom-nav__flyout-label {
  min-width: 0;
  flex: 1;
}
.bottom-nav__flyout-section {
  padding: 10px 12px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.bottom-nav__track {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: var(--bottom-nav-track-height);
  padding: 2px 0;
}
/* Legacy flat tracks (pre scroll/end zones) must still scroll horizontally. */
.bottom-nav__track:not(:has(> .bottom-nav__track-scroll)) {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  padding: 0 var(--bottom-nav-side-padding);
}
.bottom-nav__track:not(:has(> .bottom-nav__track-scroll))::-webkit-scrollbar {
  display: none;
}
/* Primary tabs scroll; More stays pinned on the right. */
.bottom-nav__track-scroll {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  padding: 0 var(--bottom-nav-side-padding);
}
.bottom-nav__track-scroll::-webkit-scrollbar {
  display: none;
}
.bottom-nav__track-end {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding-right: max(8px, var(--rithma-safe-right));
  border-left: 1px solid var(--border);
  background: var(--bottom-nav-bg);
  box-shadow: -8px 0 12px rgba(15, 23, 42, 0.06);
}
.bottom-nav__section {
  flex: 0 0 auto;
  align-self: center;
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: var(--border);
}
.bottom-nav__item {
  flex: 0 0 auto;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 54px;
  max-width: 72px;
  padding: 6px 4px 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 120ms ease, background 120ms ease;
  border-radius: 12px;
}
.bottom-nav__group-btn.is-open {
  color: var(--primary-dark);
  background: rgba(37, 99, 235, 0.08);
}
.bottom-nav__item:hover,
.bottom-nav__item:focus-visible {
  text-decoration: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.03);
}
.bottom-nav__item.active {
  color: var(--primary-dark);
}
.bottom-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  position: relative;
}
.bottom-nav__badge {
  position: absolute;
  top: -3px;
  right: -7px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--primary-dark, #1d4ed8);
  color: #fff;
  font-size: 9px;
  line-height: 14px;
  font-weight: 700;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}
.bottom-nav__icon .nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.72;
}
.bottom-nav__item.active .bottom-nav__icon .nav-icon {
  opacity: 1;
}
.bottom-nav__label {
  display: block;
  max-width: 100%;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bottom-nav__item.active .bottom-nav__label {
  color: var(--primary-dark);
}
.bottom-nav__item--signout {
  color: #64748b;
}
.bottom-nav__item--signout .bottom-nav__icon .nav-icon {
  opacity: 0.65;
}

/* Auth pages */
/* Paint the gradient on html + body so it covers the entire WebView,
   including the area under the iPhone notch / Dynamic Island and the
   home indicator. The wrapper itself is transparent so it inherits it.
   We avoid ``background-attachment: fixed`` because iOS WKWebView ignores it
   inconsistently — instead the html + body each get a gradient that
   stretches to their full size. */
html:has(.auth-wrapper),
body:has(.auth-wrapper),
html.rithma-auth-shell,
body.rithma-auth-shell {
  background: linear-gradient(135deg, #2563eb 0%, #14b8a6 100%);
  background-repeat: no-repeat;
  background-size: cover;
  /* Only constrain horizontal overscroll; blocking vertical can fight iOS/WKWebView. */
  overscroll-behavior-x: none;
}
/* Fixed backdrop covers the full iframe viewport when safe-area env()
   reports 0 inside the Capacitor shell (cross-origin login/register). */
html:has(.auth-wrapper)::before,
html.rithma-auth-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #2563eb 0%, #14b8a6 100%);
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
}
html:has(.auth-wrapper),
html.rithma-auth-shell {
  /* Root is pinned; body scrolls vertically so iOS cannot rubber-band sideways. */
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body:has(.auth-wrapper),
body.rithma-auth-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}
.auth-wrapper {
  /* Use dynamic viewport units when available so the layout shrinks/grows
     with the iOS keyboard / dynamic toolbars; fall back to 100vh on browsers
     that don't support dvh. */
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  /* Anchor the form near the top so there's always a clear gap between
     the iPhone notch / Dynamic Island and the start of the card. The
     wrapper still grows to fill the viewport for the gradient. */
  align-items: flex-start;
  justify-content: center;
  background: transparent;
  padding: 20px;
  /* width: 100% inherits from body which is already clamped to viewport. */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* Hard-clamp horizontal overflow even if a child tries to widen the layout. */
  overflow-x: hidden;
  overflow-x: clip;
  touch-action: pan-y;
  overscroll-behavior-x: none;
  /* Safe-area aware horizontal padding: the iPhone notch can extend the
     left/right insets in landscape too. */
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  /* Always leave at least 88px between the top of the device (status bar /
     Dynamic Island) and the card. When ``env(safe-area-inset-top)`` reports
     a real value (most iPhones) we add 32px on top of it; when it returns 0
     (older devices, simulator quirks, contentInset:never) the absolute
     ``max()`` floor still keeps the card clear of the system UI. */
  padding-top: max(
    88px,
    calc(var(--rithma-safe-top) + 32px)
  );
  padding-bottom: max(24px, var(--rithma-safe-bottom));
}
@media (max-width: 480px) {
  .auth-wrapper {
    /* Even more headroom on phones with taller notches / Dynamic Island. */
    padding-top: max(
      96px,
      calc(var(--rithma-safe-top) + 40px)
    );
  }
}
.auth-card {
  /* Soft off-white with a very faint cool tint so the card is clearly
     distinct from pure white but still reads as a clean, neutral surface
     against the blue / teal gradient behind it. */
  background: #f5f8fc;
  border: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
  min-width: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  /* Defend against any inner content that might push past the card's own
     width (long emails, wide buttons, etc.). */
  overflow-x: hidden;
  overflow-x: clip;
  touch-action: pan-y;
}
.auth-hero {
  display: none;
}
.auth-kicker {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.auth-kicker--card {
  display: none;
}
.auth-hero__features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.auth-hero__features span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  font-weight: 600;
}
/* Belt-and-braces clamp for everything inside auth pages: no descendant
   may exceed its own container, eliminating any chance of sideways scroll. */
.auth-wrapper *,
.auth-wrapper {
  max-width: 100%;
}
.auth-wrapper input,
.auth-wrapper select,
.auth-wrapper textarea,
.auth-wrapper button {
  max-width: 100%;
}
.auth-flash-stack {
  position: fixed;
  top: max(16px, calc(var(--rithma-safe-top) + 8px));
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 100;
  width: auto;
  max-width: none;
  margin: 0 auto;
  box-sizing: border-box;
  pointer-events: none;
}
.auth-flash-stack .flash {
  pointer-events: auto;
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; border-radius: 14px; }
}
.auth-card h1 { margin: 0 0 6px 0; color: var(--primary); }
.auth-card__logo {
  display: block;
  width: auto;
  height: 34px;
}
.auth-card__desktop-title {
  display: none;
}
.auth-card .sub { color: var(--muted); margin-bottom: 24px; font-size: 0.95em; }

/* Approval-pending landing (post-signup review gate) */
.auth-wrapper--approval-pending .approval-pending-card {
  max-width: 520px;
}
.approval-pending-card .auth-kicker--card {
  display: block;
}
.approval-pending-status {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
}
.approval-pending-status__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.approval-pending-status--pending .approval-pending-status__icon {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.28);
}
.approval-pending-status--rejected .approval-pending-status__icon {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.24);
}
.approval-pending-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.approval-pending-banner--success {
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.08);
  color: #166534;
}
.approval-pending-details {
  margin: 0 0 20px;
  padding: 16px 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.approval-pending-details__title,
.approval-pending-next__title,
.approval-pending-help__title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark);
}
.approval-pending-details__grid {
  margin: 0;
}
.approval-pending-details__row {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.approval-pending-details__row:first-child {
  padding-top: 0;
}
.approval-pending-details__row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.approval-pending-details__row dt {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.approval-pending-details__row dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.approval-pending-details__row--reason dd {
  font-weight: 500;
}
.approval-pending-steps {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.approval-pending-steps__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.approval-pending-steps__dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.16);
  background: #fff;
}
.approval-pending-steps__item--done .approval-pending-steps__dot {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.approval-pending-steps__item--current .approval-pending-steps__dot {
  border-color: #d97706;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.approval-pending-steps__label {
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--muted);
  font-weight: 600;
}
.approval-pending-steps__item--done .approval-pending-steps__label,
.approval-pending-steps__item--current .approval-pending-steps__label {
  color: var(--text);
}
.approval-pending-next {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.12);
}
.approval-pending-next__list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.approval-pending-next__list li + li {
  margin-top: 6px;
}
.approval-pending-help {
  margin: 0 0 8px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.approval-pending-help__copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.approval-pending-help__actions {
  display: grid;
  gap: 10px;
}
.approval-pending-back {
  margin-top: 20px !important;
}
@media (max-width: 480px) {
  .approval-pending-steps__label {
    font-size: 0.72rem;
  }
}

@media (max-width: 899px) {
  .auth-card { max-width: 460px; padding: 24px 20px; border-radius: 14px; }
}

@media (min-width: 900px) {
  html:has(.auth-wrapper),
  body:has(.auth-wrapper),
  html.rithma-auth-shell,
  body.rithma-auth-shell {
    background:
      radial-gradient(circle at top left, rgba(20, 184, 166, 0.26), transparent 34rem),
      linear-gradient(135deg, #eef6ff 0%, #f8fafc 48%, #e6fffb 100%);
  }
  .auth-wrapper {
    align-items: flex-start;
    justify-content: center;
    padding: 48px;
    padding-left: max(48px, env(safe-area-inset-left));
    padding-right: max(48px, env(safe-area-inset-right));
    padding-top: max(48px, env(safe-area-inset-top));
    padding-bottom: max(48px, var(--rithma-safe-bottom));
  }
  .auth-wrapper::before {
    content: "";
    position: fixed;
    inset: auto auto 8% 7%;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    filter: blur(8px);
    pointer-events: none;
  }
  .auth-wrapper::after {
    content: "";
    position: fixed;
    inset: 12% 8% auto auto;
    width: 180px;
    height: 180px;
    border-radius: 45px;
    background: rgba(20, 184, 166, 0.14);
    transform: rotate(18deg);
    pointer-events: none;
  }
  .auth-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 460px);
    align-items: start;
    gap: 0;
    max-width: 1080px;
    margin: 0 auto;
  }
  .auth-hero,
  .auth-card {
    position: relative;
    z-index: 1;
  }
  .auth-hero {
    display: flex;
    align-self: start;
    position: sticky;
    top: max(48px, env(safe-area-inset-top));
    height: 620px;
    flex-direction: column;
    justify-content: flex-end;
    padding: 56px;
    border-radius: 28px 0 0 28px;
    background:
      linear-gradient(160deg, rgba(37, 99, 235, 0.94), rgba(20, 184, 166, 0.88)),
      var(--primary);
    color: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  }
  .auth-hero .auth-kicker {
    color: rgba(255, 255, 255, 0.78);
  }
  .auth-hero h1,
  .auth-hero__logo {
    margin: 0 0 14px;
    color: #ffffff;
    font-size: clamp(2.6rem, 5vw, 4.2rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
  }
  .auth-hero__logo {
    display: block;
    width: min(260px, 72%);
    height: auto;
  }
  .auth-hero p:not(.auth-kicker) {
    max-width: 36rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.08rem;
    line-height: 1.7;
  }
  .auth-card {
    min-height: 620px;
    max-width: 460px;
    padding: 54px 48px;
    border-radius: 0 28px 28px 0;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-left: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  }
  .auth-kicker--card {
    display: block;
  }
  .auth-card h1 {
    color: var(--text);
    font-size: 2rem;
    letter-spacing: -0.03em;
  }
  .auth-card__logo {
    display: none;
  }
  .auth-card__desktop-title {
    display: inline;
  }
  .auth-wrapper--register {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 1180px;
  }
  .auth-wrapper--register .auth-card--register {
    width: 60%;
    min-width: 620px;
    max-width: 760px;
    min-height: auto;
    border-radius: 28px;
    border-left: 1px solid rgba(226, 232, 240, 0.9);
  }
  .auth-card--register .role-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  /* Auth pages with only a card (2FA, forgot password, etc.) — no hero column. */
  .auth-wrapper:not(:has(.auth-hero)):not(.auth-wrapper--register) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .auth-wrapper:not(:has(.auth-hero)):not(.auth-wrapper--register) .auth-card {
    min-height: auto;
    border-radius: 28px;
    border-left: 1px solid rgba(226, 232, 240, 0.9);
  }
}

/* Biometric sign-in (mobile shell) and web save-password (browser). */
.biometric-save,
.web-save-password {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 0.9em;
  color: var(--muted);
  line-height: 1.35;
}
.biometric-save input[type="checkbox"] {
  margin-top: 3px;
  flex: 0 0 auto;
}
.biometric-save strong { color: var(--text); font-weight: 600; }
.biometric-unlock {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.biometric-unlock__icon { font-size: 1.1em; }
.biometric-hint {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85em;
  line-height: 1.35;
  text-align: center;
}

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 5px; font-size: 0.92em; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
  background: white;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.form-group textarea {
  white-space: pre-wrap;
}
.form-group label {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Password reveal toggle — input wrapped by password-reveal.js */
.password-input-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
}
.password-input-wrap > input[type="password"],
.password-input-wrap > input[type="text"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-right: 5.25rem;
}
.password-input-reveal-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.password-input-reveal-btn:hover {
  background: var(--card);
  border-color: var(--primary-light);
}
.password-input-reveal-btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Checkboxes and radios should keep their native size — never stretch like text inputs. */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0 6px 0 0;
  vertical-align: middle;
  accent-color: var(--primary);
  cursor: pointer;
  box-shadow: none;
}
.form-group input[type="checkbox"]:focus,
.form-group input[type="radio"]:focus {
  box-shadow: 0 0 0 2px var(--primary-light);
  border-color: var(--primary);
}
/* Labels that wrap a checkbox/radio (inline pattern). */
.form-group label:has(> input[type="checkbox"]),
.form-group label:has(> input[type="radio"]),
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  cursor: pointer;
}
.form-group textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* Inline validation feedback for email/phone (and any input flagged invalid). */
input.input-invalid,
.form-group input.input-invalid,
.form-field input.input-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
input.input-invalid:focus,
.form-group input.input-invalid:focus,
.form-field input.input-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}
.form-field--next-target,
.form-group.form-field--next-target,
.doc-signature.form-field--next-target,
.intake-ack-signatures.form-field--next-target,
button.form-field--next-target {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 6px;
}
.intake-form-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
  width: 100%;
}
.intake-form-layout > .card {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 768px) {
  .intake-form-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .intake-form-layout > .card {
    width: 100%;
    max-width: 100%;
  }
}
/*
 * Long intake forms (Next dock): in Capacitor / bottom-nav shells the flex row
 * beside the dock crushed fields into single-character columns when combined
 * with overflow-wrap:anywhere on labels.
 */
html[data-rithma-native-app="1"] .intake-form-layout,
body.rithma-native-app .intake-form-layout,
body:has(.bottom-nav.bottom-nav--ready) .intake-form-layout {
  display: block;
}
html[data-rithma-native-app="1"] .intake-form-layout > .card,
body.rithma-native-app .intake-form-layout > .card,
body:has(.bottom-nav.bottom-nav--ready) .intake-form-layout > .card,
.team-member-intake-card {
  width: 100%;
  max-width: 100%;
}
html[data-rithma-native-app="1"] .main form .form-row,
html[data-rithma-native-app="1"] .main form .form-row-3,
html[data-rithma-native-app="1"] .main form .form-row-4,
body.rithma-native-app .main form .form-row,
body.rithma-native-app .main form .form-row-3,
body.rithma-native-app .main form .form-row-4,
body:has(.bottom-nav.bottom-nav--ready) .main form .form-row,
body:has(.bottom-nav.bottom-nav--ready) .main form .form-row-3,
body:has(.bottom-nav.bottom-nav--ready) .main form .form-row-4 {
  grid-template-columns: 1fr !important;
}
html[data-rithma-native-app="1"] .main form .form-group[style*="grid-column"],
body.rithma-native-app .main form .form-group[style*="grid-column"],
body:has(.bottom-nav.bottom-nav--ready) .main form .form-group[style*="grid-column"] {
  grid-column: auto !important;
}
html[data-rithma-native-app="1"] .form-group label,
html[data-rithma-native-app="1"] .form-group .muted.text-sm,
body.rithma-native-app .form-group label,
body.rithma-native-app .form-group .muted.text-sm,
body:has(.bottom-nav.bottom-nav--ready) .form-group label,
body:has(.bottom-nav.bottom-nav--ready) .form-group .muted.text-sm {
  overflow-wrap: normal;
  word-break: normal;
}
/* Intake fieldsets: keep labels readable when grids get tight on tablets. */
.intake-section .form-group label,
.intake-section .form-group .muted.text-sm {
  overflow-wrap: normal;
  word-break: normal;
}
.intake-section .form-group--ssn-last4 {
  max-width: 12rem;
}
.intake-section .input-ssn-last4 {
  max-width: 8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}
html[data-rithma-native-app="1"] .intake-section .form-group--ssn-last4,
body.rithma-native-app .intake-section .form-group--ssn-last4,
body:has(.bottom-nav.bottom-nav--ready) .intake-section .form-group--ssn-last4 {
  max-width: none;
}
@media (max-width: 900px) {
  .intake-section .form-row-4 {
    grid-template-columns: 1fr;
  }
  .intake-section .form-row-4 .form-group[style*="grid-column"],
  .intake-section .form-row-3 .form-group--full-row-sm {
    grid-column: auto !important;
  }
}
@media (min-width: 901px) {
  .intake-section .form-row-3 .form-group--full-row-sm {
    grid-column: span 2;
  }
}
.form-next-required-dock {
  position: sticky;
  top: calc(50vh - 2.5rem);
  flex: 0 0 auto;
  align-self: flex-start;
  z-index: 4;
  padding-top: 8px;
}
.form-next-required-rail__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 4.5rem;
  margin: 0;
  padding: 14px 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 22%, var(--border, #e2e8f0));
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    var(--surface, #fff) 0%,
    color-mix(in srgb, var(--primary-light, #eff6ff) 55%, var(--surface, #fff)) 100%
  );
  color: var(--primary, #2563eb);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 6px 18px rgba(37, 99, 235, 0.12);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}
.form-next-required-rail__btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary, #2563eb) 38%, var(--border, #e2e8f0));
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.08),
    0 10px 24px rgba(37, 99, 235, 0.16);
}
.form-next-required-rail__btn:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 3px;
}
.form-next-required-rail__btn:disabled {
  cursor: default;
  transform: none;
  opacity: 1;
}
.form-next-required-rail__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary, #2563eb) 12%, transparent);
}
.form-next-required-rail__icon svg {
  display: block;
}
.form-next-required-dock--complete .form-next-required-rail__icon-next {
  display: none;
}
.form-next-required-dock--complete .form-next-required-rail__icon-done {
  display: block !important;
}
.form-next-required-rail__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  text-align: center;
}
.form-next-required-rail__label {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--text, #0f172a);
}
.form-next-required-rail__hint {
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-muted, #64748b);
}
.form-next-required-dock--complete .form-next-required-rail__btn {
  border-color: color-mix(in srgb, var(--success, #16a34a) 30%, var(--border, #e2e8f0));
  background: linear-gradient(
    180deg,
    var(--surface, #fff) 0%,
    color-mix(in srgb, #dcfce7 70%, var(--surface, #fff)) 100%
  );
  color: var(--success, #16a34a);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 6px 18px rgba(22, 163, 74, 0.12);
}
.form-next-required-dock--complete .form-next-required-rail__icon {
  background: color-mix(in srgb, var(--success, #16a34a) 14%, transparent);
}
.form-next-required-dock--complete .form-next-required-rail__label {
  color: var(--success, #16a34a);
}
.form-next-required-dock--complete .form-next-required-rail__hint {
  color: color-mix(in srgb, var(--success, #16a34a) 72%, var(--text-muted, #64748b));
}
@media (max-width: 768px) {
  .form-next-required-dock {
    position: fixed;
    top: auto;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(20px, var(--rithma-safe-bottom));
    z-index: 62;
    padding-top: 0;
  }
  .form-next-required-rail__btn {
    flex-direction: row;
    width: auto;
    min-width: 0;
    padding: 10px 14px 10px 12px;
    border-radius: 999px;
    gap: 10px;
  }
  .form-next-required-rail__text {
    align-items: flex-start;
    text-align: left;
  }
  .form-next-required-rail__icon {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
  }
  .form-next-required-rail__label {
    font-size: 0.88rem;
  }
  .form-next-required-rail__hint {
    font-size: 0.72rem;
  }
  html[data-rithma-native-app="1"] .form-next-required-dock,
  body:has(.bottom-nav.bottom-nav--ready) .form-next-required-dock {
    bottom: calc(
      12px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
        var(--rithma-safe-bottom)
    );
  }
  body:has(.main-chat-fab:not([hidden])) .form-next-required-dock {
    bottom: calc(
      max(20px, var(--rithma-safe-bottom)) + var(--floating-action-size) + var(--floating-action-gap)
    );
  }
  body:has(.bottom-nav.bottom-nav--ready):has(.main-chat-fab:not([hidden])) .form-next-required-dock {
    bottom: calc(
      12px + var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
        var(--rithma-safe-bottom) + var(--floating-action-size) + var(--floating-action-gap)
    );
  }
}
@media (prefers-reduced-motion: reduce) {
  .form-next-required-rail__btn {
    transition: border-color 0.01s, background 0.01s, box-shadow 0.01s;
  }
  .form-next-required-rail__btn:hover {
    transform: none;
  }
}
.input-error {
  display: none;
  color: var(--danger);
  font-size: 0.82em;
  margin-top: 4px;
  line-height: 1.3;
}

/* Live password requirements */
.password-policy-hint {
  margin-top: 8px;
}
.password-policy-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.password-policy-card.is-complete {
  border-color: rgba(22, 163, 74, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}
.password-policy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
}
.password-policy-head strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.password-policy-card.is-complete .password-policy-head strong {
  color: var(--success);
}
.password-policy-meter {
  height: 6px;
  margin: 8px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.password-policy-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--warning);
  transition: width 160ms ease, background-color 160ms ease;
}
.password-policy-card.is-complete .password-policy-meter span {
  background: var(--success);
}
.password-policy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.password-policy-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.25;
}
.password-policy-row strong {
  display: block;
  color: inherit;
  font-size: 0.84rem;
}
.password-policy-row small {
  display: block;
  margin-top: 1px;
  color: inherit;
  font-size: 0.78rem;
}
.password-policy-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
}
.password-policy-row.met {
  color: var(--success);
}
.password-policy-row.met .password-policy-mark {
  border-color: rgba(22, 163, 74, 0.25);
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}
.password-confirm-message {
  margin: 6px 0 0;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.3;
}
.password-confirm-warn {
  background: #fef2f2;
  color: var(--danger);
}
.password-confirm-ok {
  background: #f0fdf4;
  color: var(--success);
}
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 768px) {
  .form-row,
  .form-row-3,
  .form-row-4 {
    grid-template-columns: 1fr;
  }
  /* Inline grid-template-columns on .form-row beat the rule above — force stack on phones. */
  .form-row[style*="grid-template-columns"],
  .form-row-3[style*="grid-template-columns"],
  .form-row-4[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .form-row .form-group[style*="grid-column"],
  .form-row-3 .form-group[style*="grid-column"],
  .form-row-4 .form-group[style*="grid-column"] {
    grid-column: auto !important;
  }
}
@media (max-width: 900px) {
  .form-row-4 {
    grid-template-columns: 1fr;
  }
}

/* Client Intake Form sections — visually grouped to mirror the
   numbered sections of the paper PDF. Each <fieldset> sits on a soft
   blue rule so the form scans like a clinical document. */
.intake-section {
  border: 1px solid #d6e3ec;
  border-radius: 8px;
  padding: 14px 16px 18px;
  margin-top: 18px;
  background: var(--bg, #fff);
}
.intake-section > legend {
  padding: 0 8px;
  font-weight: 700;
  color: var(--primary, #2563eb);
  font-size: 1.05rem;
}
fieldset.intake-readonly,
.intake-readonly input,
.intake-readonly select,
.intake-readonly textarea {
  pointer-events: none;
  opacity: 0.92;
}
.intake-subhead {
  margin: 14px 0 6px;
  font-size: 0.95rem;
  color: var(--text, #111);
}

/* Client care plan — written plan form */
.care-plan-status-card {
  margin-bottom: 14px;
}
.care-plan-status-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.care-plan-generate-status {
  margin: 10px 0 0;
}
.care-plan-generate-status--error {
  color: var(--danger, #dc2626);
}
.care-plan-generate-status--success {
  color: var(--success, #16a34a);
}
.care-plan-generate-btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}
.care-plan-generate-progress {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
}
.care-plan-generate-progress__spinner {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 2px solid #93c5fd;
  border-top-color: var(--primary, #2563eb);
  border-radius: 999px;
  animation: assessment-discharge-spin 0.75s linear infinite;
}
.care-plan-generate-progress__title {
  margin: 0 0 4px;
  font-weight: 600;
  color: #1e3a8a;
}
.care-plan-generate-progress__text {
  margin: 0;
  line-height: 1.45;
}
.care-plan-suggestions-form-intro {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #f8fbff;
  line-height: 1.45;
}
.care-plan-field-suggestion {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #f8fbff;
}
.care-plan-field-suggestion--busy {
  opacity: 0.65;
}
.care-plan-field-suggestion__header {
  margin-bottom: 6px;
}
.care-plan-field-suggestion__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.care-plan-field-suggestion__text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.92rem;
  color: #1e3a8a;
}
.care-plan-field-suggestion__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.care-plan-field.care-plan-field--textarea + .care-plan-field-suggestion,
.care-plan-field .care-plan-field-suggestion {
  grid-column: 1 / -1;
}
.assessment-discharge-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.assessment-discharge-panel__header {
  margin-bottom: 14px;
}
.assessment-discharge-panel__title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.assessment-discharge-panel__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--primary, #2563eb);
}
.assessment-discharge-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.assessment-discharge-panel__intro {
  margin: 4px 0 0;
  line-height: 1.45;
}
.assessment-discharge-panel__cost {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 500;
}
.assessment-discharge-panel__review-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #78350f;
  font-size: 0.88rem;
  line-height: 1.45;
}
.assessment-ai-review-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  line-height: 1.45;
}
.assessment-discharge-panel__form--blocked .assessment-discharge-panel__actions {
  display: none;
}
.assessment-discharge-dropzone--disabled {
  pointer-events: none;
  opacity: 0.72;
  cursor: not-allowed;
  background: #f8fafc;
}
.assessment-discharge-panel__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.assessment-discharge-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  padding: 22px 18px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.assessment-discharge-dropzone:hover,
.assessment-discharge-dropzone:focus-within {
  border-color: var(--primary, #2563eb);
  background: #f8fbff;
}
.assessment-discharge-dropzone.is-dragover {
  border-color: var(--primary, #2563eb);
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}
.assessment-discharge-dropzone.is-loading {
  pointer-events: none;
  border-color: #93c5fd;
  background: #f8fbff;
  cursor: wait;
}
.assessment-discharge-dropzone__empty,
.assessment-discharge-dropzone__selected,
.assessment-discharge-dropzone__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.assessment-discharge-dropzone__loading[hidden],
.assessment-discharge-dropzone__selected[hidden],
.assessment-discharge-dropzone__empty[hidden] {
  display: none !important;
}
.assessment-discharge-dropzone__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary, #2563eb);
}
.assessment-discharge-dropzone__title {
  font-weight: 600;
  color: var(--text, #0f172a);
}
.assessment-discharge-dropzone__hint {
  font-size: 0.82rem;
  color: var(--muted, #64748b);
  max-width: 320px;
  line-height: 1.4;
}
.assessment-discharge-dropzone__file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.assessment-discharge-dropzone__file-name {
  font-weight: 600;
  color: var(--text, #0f172a);
  word-break: break-word;
  max-width: 100%;
}
.assessment-discharge-dropzone__file-meta,
.assessment-discharge-dropzone__replace {
  margin: 0;
  line-height: 1.4;
}
.assessment-discharge-dropzone__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: assessment-discharge-spin 0.75s linear infinite;
}
.assessment-discharge-dropzone__loading-text {
  font-weight: 500;
  color: var(--text, #0f172a);
}
@keyframes assessment-discharge-spin {
  to { transform: rotate(360deg); }
}
.assessment-discharge-dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.assessment-discharge-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.assessment-discharge-panel__submit[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}
.assessment-discharge-panel__note {
  margin: 0;
  line-height: 1.45;
}
.clients-discharge-panel {
  margin-top: 16px;
}
.clients-discharge-import-form__mode,
.clients-discharge-import-form__client {
  max-width: 420px;
}
.clients-discharge-import-form__client[hidden] {
  display: none;
}
.clients-discharge-import-jobs {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.clients-discharge-import-jobs__header {
  margin-bottom: 12px;
}
.clients-discharge-import-jobs__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.clients-discharge-import-jobs__intro {
  margin: 6px 0 0;
}
.clients-discharge-import-jobs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.clients-discharge-import-jobs__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.clients-discharge-import-jobs__item--pending {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.clients-discharge-import-jobs__item--ready {
  border-color: #bbf7d0;
  background: #f7fef9;
}
.clients-discharge-import-jobs__item--error {
  border-color: #fecaca;
  background: #fffafa;
}
.clients-discharge-import-jobs__item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.clients-discharge-import-jobs__client {
  font-weight: 600;
  color: var(--text, #0f172a);
}
.clients-discharge-import-jobs__file {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px;
}
.clients-discharge-import-jobs__item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.clients-discharge-import-jobs__status {
  font-size: 0.875rem;
  font-weight: 500;
}
.clients-discharge-import-jobs__status--pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1d4ed8;
}
.clients-discharge-import-jobs__status--ready {
  color: #15803d;
}
.clients-discharge-import-jobs__status--error {
  color: #b91c1c;
  max-width: 320px;
}
.clients-discharge-import-jobs__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: assessment-discharge-spin 0.75s linear infinite;
  flex-shrink: 0;
}
.clients-discharge-import-jobs__empty {
  padding: 12px 0;
  margin: 0;
}
.clients-discharge-review-form {
  margin-top: 16px;
}
.clients-discharge-review-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.clients-discharge-review-steps__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 0.88rem;
}
.clients-discharge-review-steps__item--current {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
  font-weight: 600;
}
.clients-discharge-review-steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}
.clients-discharge-review-steps__item--current .clients-discharge-review-steps__num {
  background: var(--primary, #2563eb);
  color: #fff;
}
.clients-discharge-review-profile {
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}
.clients-discharge-review-profile__notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.88rem;
  line-height: 1.5;
}
.clients-discharge-review-profile__hint {
  display: block;
  margin-top: 6px;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 400;
}
.clients-discharge-review-profile__footer-note {
  flex: 1 1 100%;
  margin: 0 0 4px;
  line-height: 1.45;
}
.assessment-discharge-panel__status {
  margin: 10px 0 0;
}
@media (max-width: 640px) {
  .assessment-discharge-panel__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .assessment-discharge-panel__actions .btn {
    width: 100%;
  }
}
.care-plan-reference {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e8e8e8);
}
.care-plan-reference__body {
  margin-top: 8px;
}
.care-plan-reference__body p {
  margin: 0 0 8px;
}
.care-plan-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.care-plan-section-nav__link {
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border, #d1d5db);
  background: var(--bg, #fff);
  color: var(--text, #111);
  text-decoration: none;
  line-height: 1.3;
}
.care-plan-section-nav__link:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}
.care-plan-section-nav__link--partial {
  border-color: color-mix(in srgb, var(--warning, #d97706) 45%, var(--border, #d1d5db));
}
.care-plan-section-nav__link--complete {
  border-color: color-mix(in srgb, var(--success, #16a34a) 45%, var(--border, #d1d5db));
}
.care-plan-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.care-plan-form--readonly .care-plan-section {
  opacity: 0.96;
}
.care-plan-form--readonly input,
.care-plan-form--readonly select,
.care-plan-form--readonly textarea {
  background: var(--bg-muted, #f8fafc);
}
.care-plan-section.card {
  scroll-margin-top: 88px;
  margin-bottom: 0;
}
.care-plan-section__intro {
  margin: 0 0 12px;
}
.care-plan-section__body .form-group:last-child {
  margin-bottom: 0;
}
.care-plan-field__help {
  margin: 0 0 6px;
}
.care-plan-adl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 14px;
  margin-bottom: 4px;
}
.care-plan-adl-grid .form-group {
  margin-bottom: 0;
}
.care-plan-adl-grid .care-plan-field__help--below {
  margin: 6px 0 0;
}
.care-plan-compact-grid .form-group {
  margin-bottom: 0;
}
.care-plan-compact-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
  align-items: start;
}
.care-plan-compact-grid--cols-1 {
  grid-template-columns: minmax(0, 1fr);
}
.care-plan-compact-grid--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.care-plan-compact-grid--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.care-plan-compact-grid--cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.care-plan-compact-grid .care-plan-field__help--below {
  margin: 6px 0 0;
}
/* Intake, care plan, assessment — long labels/values wrap instead of clipping */
.intake-section,
.care-plan-form,
.care-plan-section,
.cms-485-form,
.custom-form-fields,
.added-form-fields,
.form-grid {
  min-width: 0;
}
.form-grid {
  display: grid;
  gap: 14px;
}
.form-grid--2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid .form-group--full {
  grid-column: 1 / -1;
}
.intake-section .form-group,
.care-plan-form .form-group,
.care-plan-section .form-group,
.cms-485-form .form-group {
  min-width: 0;
}
.cms-485-truncated-full__body {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  max-height: 12rem;
  overflow: auto;
}
.care-plan-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e8e8e8);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}
.care-plan-upload-card {
  margin-bottom: 12px;
}
.care-plan-upload-form .form-group:last-child {
  margin-bottom: 0;
}
.care-plan-document-card {
  margin-bottom: 0;
}
.care-plan-document-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 12px;
}
.care-plan-document-meta__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.care-plan-document-preview {
  width: 100%;
  max-width: 920px;
  height: 640px;
  margin: 0 auto 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
}
.care-plan-document-preview__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.main .care-plan-document-preview iframe,
.main .care-plan-document-preview__frame {
  height: 100%;
  max-height: none;
}
.care-plan-document-preview__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.care-plan-document-preview__fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
}
.signing-document-preview--pages {
  height: auto;
  max-height: min(70vh, 720px);
  overflow-y: auto;
}
.signing-document-preview__pages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}
.signing-document-preview__page {
  display: block;
  width: 100%;
  height: auto;
  min-height: 120px;
  background: #fff;
  border-radius: 4px;
}
.signing-document-preview__page[data-signing-preview-loading] {
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: signing-preview-shimmer 1.2s ease-in-out infinite;
}
.signing-document-preview__page--error {
  min-height: 80px;
  object-fit: none;
  padding: 16px;
  box-sizing: border-box;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  text-align: center;
}
/* Never paint an inline PDF iframe in the native shell — WKWebView can hijack
   the whole frame with no way to dismiss. PNG pages load via JS instead. */
html[data-rithma-native-app="1"] .signing-document-preview__frame {
  display: none !important;
  pointer-events: none !important;
}
@keyframes signing-preview-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.signing-document-preview--pages {
  height: auto;
  max-height: min(70vh, 720px);
  overflow-y: auto;
}
.signing-document-preview__pages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}
.signing-document-preview__page {
  display: block;
  width: 100%;
  height: auto;
  min-height: 120px;
  background: #fff;
  border-radius: 4px;
}
.signing-document-preview__page[data-signing-preview-loading] {
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: signing-preview-shimmer 1.2s ease-in-out infinite;
}
.signing-document-preview__page--error {
  min-height: 80px;
  object-fit: none;
  padding: 16px;
  box-sizing: border-box;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  text-align: center;
}
/* Never paint an inline PDF iframe in the native shell — WKWebView can hijack
   the whole frame with no way to dismiss. PNG pages load via JS instead. */
html[data-rithma-native-app="1"] .signing-document-preview__frame {
  display: none !important;
  pointer-events: none !important;
}
@keyframes signing-preview-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.signing-document-preview {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.signing-document-card {
  margin-bottom: 16px;
}
.care-plan-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.care-plan-document-history,
.care-plan-document-replace {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e8e8e8);
}
.care-plan-document-history__list {
  margin: 8px 0 0;
  padding-left: 18px;
}
.care-plan-document-history__list li {
  margin-bottom: 6px;
}
@media (max-width: 640px) {
  .care-plan-section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .care-plan-section-nav__link {
    flex: 0 0 auto;
  }
  .care-plan-adl-grid {
    grid-template-columns: 1fr;
  }
  .care-plan-compact-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .care-plan-document-preview {
    height: 420px;
  }
  .signing-document-preview {
    height: 420px;
  }
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 14px;
  margin-top: 4px;
}
.checkbox-grid__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
  font-size: 0.92rem;
  cursor: pointer;
}
.checkbox-grid__item input[type="checkbox"] {
  flex-shrink: 0;
}

/* Caregiver application — read-only document view (agency / household) */
.caregiver-application-page {
  max-width: 960px;
}
.caregiver-application {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.caregiver-application__hero {
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(255, 255, 255, 1) 55%);
  border-color: #c7d9ea;
}
.caregiver-application__hero-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
}
.caregiver-application__eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary, #2563eb);
}
.caregiver-application__name {
  margin: 4px 0 0;
  font-size: 1.45rem;
  line-height: 1.2;
}
.caregiver-application__hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.caregiver-application__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(37, 99, 235, 0.12);
}
.caregiver-application__meta > div {
  min-width: 120px;
}
.caregiver-application__meta dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}
.caregiver-application__meta dd {
  margin: 2px 0 0;
  font-weight: 600;
}
.caregiver-application__section {
  padding: 18px 20px 20px;
}
.caregiver-application__section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 1.05rem;
  color: var(--text, #0f172a);
}
.caregiver-application__section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}
.caregiver-application__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px 20px;
  margin: 0;
}
.caregiver-app-field dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #64748b);
}
.caregiver-app-field dd {
  margin: 4px 0 0;
  font-size: 0.98rem;
  line-height: 1.45;
  word-break: break-word;
}
.caregiver-app-field--full {
  grid-column: 1 / -1;
}
.app-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.app-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1e40af;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}
.app-tag--success {
  background: #ecfdf5;
  color: #047857;
}
.caregiver-application__text-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.caregiver-application__text-block h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #64748b);
}
.caregiver-application__text-block p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}
.caregiver-application__schedule h4 {
  margin: 16px 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #64748b);
}
.caregiver-application__refs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.caregiver-application__ref-card {
  padding: 14px 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-subtle, #f8fafc);
}
.caregiver-application__ref-card h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}
.caregiver-application__ref-name {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
}
.caregiver-application__signatures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.caregiver-application__signature {
  padding: 14px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fafbfc;
}
.caregiver-application__sig-name {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-style: italic;
}
@media (max-width: 640px) {
  .caregiver-application__grid {
    grid-template-columns: 1fr;
  }
  .caregiver-application__hero {
    padding: 16px;
  }
}

/* Standalone production error page (no app chrome) */
.error-page {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--text, #0f172a);
}
.error-page__main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  box-sizing: border-box;
}
.error-page__card {
  width: 100%;
  max-width: 480px;
  text-align: center;
}
.error-page__card h1 {
  margin: 8px 0 12px;
  font-size: 1.5rem;
}
.error-page__eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary, #2563eb);
}
.error-page__ref {
  margin-top: 16px;
}
.error-page__actions {
  margin-top: 20px;
}

/* Standalone 404 page (dashboard / app host) */
.not-found-page .not-found-card {
  max-width: 520px;
  padding: 32px 28px;
  text-align: center;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}
.not-found-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 88px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.12) 0%, rgba(14, 165, 233, 0.08) 100%);
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: var(--primary, #2563eb);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.not-found-lead {
  margin-bottom: 16px;
}
.not-found-path {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.not-found-path__label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.not-found-path code {
  display: block;
  word-break: break-all;
  font-size: 0.92rem;
  color: var(--text, #0f172a);
}
.not-found-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.not-found-hint {
  margin: 0;
  line-height: 1.45;
}

/* Standalone 403 page (dashboard / app host) */
.forbidden-page .forbidden-card {
  max-width: 520px;
  padding: 32px 28px;
  text-align: center;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}
.forbidden-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 88px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #b45309;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.forbidden-lead {
  margin-bottom: 16px;
}
.forbidden-detail {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text, #0f172a);
  font-size: 0.92rem;
  line-height: 1.45;
}
.forbidden-path {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.forbidden-path__label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.forbidden-path code {
  display: block;
  word-break: break-all;
  font-size: 0.92rem;
  color: var(--text, #0f172a);
}
.forbidden-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.forbidden-hint {
  margin: 0;
  line-height: 1.45;
}

/* Standalone HTTP error pages (429, 500, …) */
.http-error-page .http-error-card {
  max-width: 520px;
  padding: 32px 28px;
  text-align: center;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}
.http-error-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 88px;
  margin: 0 auto 16px;
  border-radius: 22px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.http-error-page--client .http-error-code {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #b45309;
}
.http-error-page--server .http-error-code {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.24);
  color: #b91c1c;
}
.http-error-lead {
  margin-bottom: 12px;
}
.http-error-detail {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text, #0f172a);
  font-size: 0.92rem;
  line-height: 1.45;
}
.http-error-ref {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.12);
}
.http-error-ref__label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.http-error-ref code {
  display: block;
  word-break: break-all;
  font-size: 0.92rem;
}
.http-error-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.http-error-hint {
  margin: 0;
  line-height: 1.45;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  margin-top: 4px;
}
.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
  font-size: 0.92rem;
  cursor: pointer;
}
.screening-checklist {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.screening-checklist__group {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e6edf2);
}
.screening-checklist__group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.screening-checklist__row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e6edf2);
}
.screening-checklist__group .screening-checklist__row {
  border-bottom: none;
  padding-bottom: 8px;
}
.screening-checklist__group .screening-checklist__row:last-child {
  padding-bottom: 0;
}
.screening-checklist__row--child {
  margin-left: 28px;
}
.screening-checklist__row--child .screening-checklist__title strong {
  font-weight: 600;
}
.screening-checklist__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.screening-checklist__status {
  font-size: 1.1rem;
  line-height: 1.4;
  width: 1.5rem;
  flex-shrink: 0;
}
.screening-checklist__body {
  flex: 1;
  min-width: 0;
}
.screening-checklist__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.screening-checklist__badge {
  font-size: 0.75rem;
}
.state-rule-readiness-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.state-rule-readiness-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.state-rule-readiness-card__next-line {
  margin: -4px 0 14px;
  padding: 10px 12px;
  background: var(--surface-muted, #f9fafb);
  border-radius: 8px;
}
.state-rule-readiness-card__checklist {
  margin-bottom: 0;
}
.state-rule-readiness-card__sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.state-rule-readiness-group {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 0 12px;
}
.state-rule-readiness-group__summary {
  padding-block: 10px;
  font-weight: 600;
}
.state-rule-readiness-group__summary::-webkit-details-marker {
  color: var(--warning);
}
.state-rule-readiness-group--passing .state-rule-readiness-group__summary::-webkit-details-marker,
.state-rule-readiness-group--complete .state-rule-readiness-group__summary::-webkit-details-marker {
  color: var(--success, #16a34a);
}
.state-rule-readiness-group__title {
  display: inline;
}
.state-rule-readiness-group__counts {
  display: inline;
  font-weight: 400;
  margin-left: 0.35em;
}
.state-rule-readiness-group__body {
  padding-bottom: 10px;
}
.state-rule-readiness-check {
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.state-rule-readiness-check:last-child {
  border-bottom: none;
}
.state-rule-readiness-check__summary {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  list-style: none;
}
.state-rule-readiness-check__summary::-webkit-details-marker {
  display: none;
}
.state-rule-readiness-check__status {
  flex-shrink: 0;
  line-height: 1.4;
}
.state-rule-readiness-check__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.state-rule-readiness-check__body {
  padding: 0 0 10px 1.75rem;
}
.state-rule-readiness-card__items {
  margin: 6px 0 0;
  padding-left: 1.1em;
  line-height: 1.45;
}
.state-rule-readiness-card__items li {
  margin-bottom: 4px;
}
.state-rule-readiness-card__notes {
  margin: 4px 0 12px;
}
.state-rule-readiness-card__notes summary {
  cursor: pointer;
}
.screening-manual-form__row {
  display: grid;
  grid-template-columns: auto minmax(140px, 180px) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}
.screening-manual-form__row .form-group {
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .screening-manual-form__row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* Caregiver application — credential expiration panel (checked items only) */
.credential-expiry-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.credential-expiry-panel__intro {
  margin: 4px 0 12px;
}
.credential-expiry-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.credential-expiry-field .form-group,
.credential-expiry-field.form-group {
  margin-bottom: 0;
}
.credential-expiry-field input[type="date"] {
  width: 100%;
  max-width: 280px;
}
.credential-expiry-field label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.credential-expiry-field__hint {
  font-size: 0.85em;
  font-weight: normal;
  color: var(--muted);
}
.credential-expiry-field--optional input[type="date"]:not(:focus):placeholder-shown {
  border-style: dashed;
}

/* Radio "pills" — small toggle-style choices for Yes/No and short
   enumerations, so the agency can choose with one tap on tablets. */
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #d6e3ec;
  border-radius: 16px;
  background: var(--bg, #fff);
  cursor: pointer;
  font-weight: normal;
  font-size: 0.9rem;
  user-select: none;
}
.radio-pill:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 10%, var(--bg, #fff));
}

/* Weekly availability picker (part-time caregivers) */
.availability-grid-wrap { margin: 14px 0; }
.availability-grid {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  background: white;
}
.availability-grid > legend {
  padding: 0 8px;
  font-weight: 600;
  font-size: 0.95em;
}
.avail-day {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.avail-day:first-of-type { border-top: none; }
.avail-day .avail-day-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  font-weight: normal;
  cursor: pointer;
  color: var(--muted);
}
.avail-day.is-on .avail-day-toggle { color: var(--text); }
.avail-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.avail-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.avail-slot input[type="time"] {
  /* The time-picker hides the native input and inserts its own .tp-wrap chip;
     this rule covers the rare case where it hasn't upgraded yet. */
  width: auto;
  min-width: 110px;
}
.avail-sep { color: var(--muted); }
.avail-add-slot {
  align-self: start;
  padding-top: 6px;
  white-space: nowrap;
}
.avail-remove-slot {
  color: var(--danger);
  font-size: 1.2em;
  line-height: 1;
  padding: 0 6px;
}
.avail-day:not(.is-on) .avail-slots,
.avail-day:not(.is-on) .avail-add-slot { display: none; }
@media (max-width: 700px) {
  .avail-day {
    grid-template-columns: 1fr;
  }
  .avail-day .avail-day-toggle { padding-top: 0; }
}

/* Friendly read-only display of structured availability. */
.avail-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0 0;
}
.avail-summary-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  font-size: 0.92em;
}
.avail-summary-row .avail-day-name { color: var(--muted); font-weight: 500; }

/* Role picker (login) */
.role-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.role-picker label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 5.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  box-sizing: border-box;
}
.role-picker label > span {
  display: block;
  width: 100%;
  font-size: 0.82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.role-picker input { display: none; }
.role-picker input:checked + span { color: var(--primary-dark); }
.role-picker label:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.role-picker .role-icon { display: block; font-size: 1.4em; margin-bottom: 4px; }

@media (max-width: 899px) {
  .auth-card--register .role-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Register: caregiver subtype (shown only after Caregiver is selected) */
.caregiver-type-panel {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius, 10px);
  background: var(--card);
}
.caregiver-type-panel[hidden] {
  display: none !important;
}
.caregiver-type-panel__legend {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0;
  margin: 0 0 8px;
  color: var(--text);
}
.caregiver-type-panel__choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.caregiver-type-panel__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-weight: 500;
}
.caregiver-type-panel__row:hover {
  background: rgba(37, 99, 235, 0.04);
}
.caregiver-type-panel__row:has(input:checked) {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-dark);
}
.caregiver-type-panel__row input[type="radio"] {
  flex-shrink: 0;
  margin-top: 3px;
}
.caregiver-type-panel__row span {
  flex: 1;
  line-height: 1.4;
}

/* Buttons */
.btn {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  padding: 9px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-block { display: block; width: 100%; }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-outline {
  background: white;
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.4);
}
.btn-danger-outline:hover { background: #fef2f2; color: #b91c1c; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 5px 12px; font-size: 0.85em; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.is-loading {
  position: relative;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Button labels wrap in narrow toolbars, cards, tables, and dialogs */
:is(
  .row-flex,
  .page-header-actions,
  .page-header .row-flex,
  .card-head,
  .card-head__actions,
  .filter-bar,
  .schedule-filter-bar,
  .calendar-filter-bar,
  .scheduler-page-header-actions,
  .scheduler-shift-btn-row,
  .scheduler-quick-row,
  .period-window-actions,
  .documents-filter-bar,
  .schedule-change-modal__actions,
  .recruiting-filter-bar,
  .task-followup-filter-bar,
  .app-actions,
  .table-row-actions__main,
  .doc-row-actions__main,
  .leave-approve-form,
  .messenger-toolbar,
  .rithma-dialog__actions,
  .rithma-app-dialog__actions,
  .shift-end-dialog__actions,
  .travel-map-dialog__actions,
  .payment-handles-help-dialog__actions,
  .docusign-send-footer,
  .open-shift-offer-status,
  .telephony-evv-compliance-card
) :is(.btn, a.btn, button.btn) {
  min-width: 0;
}

/* Icon + label flex buttons */
:is(
  .schedule-change-btn,
  .messenger-new-group-btn,
  .travel-map-open-btn,
  .travel-drive-btn,
  .docusign-add-recipient-btn,
  .form-template-card__upload-btn,
  .doc-signature__saved-thumb-btn,
  .password-input-reveal-btn,
  .btn.scheduler-paste-btn,
  .btn.scheduler-copy-submit,
  .scheduler-today-btn,
  .table-row-actions__more-trigger,
  .doc-row-actions__more-trigger
) {
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  flex-wrap: wrap;
  text-align: center;
}

:is(
  .schedule-change-btn,
  .messenger-new-group-btn,
  .travel-map-open-btn,
  .travel-drive-btn,
  .docusign-add-recipient-btn,
  .form-template-card__upload-btn,
  .doc-signature__saved-thumb-btn,
  .password-input-reveal-btn,
  .btn.scheduler-paste-btn,
  .btn.scheduler-copy-submit,
  .scheduler-today-btn,
  .table-row-actions__more-trigger,
  .doc-row-actions__more-trigger
) > span {
  min-width: 0;
  text-align: center;
}

/* Cards & layout */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card h2 { margin-top: 0; }
/* Generic card/section header row: title on the left, action(s) on the right.
   Replaces ad-hoc inline flex headers (display:flex;justify-content:space-between)
   scattered across cards so every card header lines up the same way. */
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-head > :first-child { margin: 0; }
.card-head :where(h1, h2, h3, h4, h5) { margin: 0; }
/* Destructive "danger zone" card (e.g. remove client / team member). Uses the
   shared danger token instead of one-off hardcoded reds. */
.card--danger { border: 1px solid var(--danger); }
/* Use when the left side has a title + subtitle (multi-line) so the action
   button aligns to the top instead of vertically centering. */
.card-head--top { align-items: flex-start; }
.card-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { margin: 0; font-size: 1.6em; }
.page-header__titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.page-header__subtitle {
  margin: 0;
  max-width: 720px;
  color: var(--text-muted, #64748b);
  font-size: 0.92rem;
  line-height: 1.45;
}
.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.empty-state {
  max-width: 520px;
  margin: 12px auto;
  padding: 28px 22px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  text-align: center;
}
.empty-state--compact {
  max-width: none;
  margin: 8px 0;
  padding: 16px;
  text-align: left;
}
.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
}
.empty-state__title {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--text);
}
.empty-state p {
  margin: 0;
}

.notice-card {
  margin: 12px 0;
  padding: 11px 13px;
  border: 1px solid rgba(14, 165, 233, 0.24);
  border-left: 4px solid var(--info);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.06);
  color: #075985;
  font-size: 0.9rem;
}
.notice-card--warning {
  border-color: rgba(245, 158, 11, 0.28);
  border-left-color: var(--warning);
  background: #fffbeb;
  color: #92400e;
}
.notice-card--danger {
  border-color: rgba(220, 38, 38, 0.28);
  border-left-color: var(--danger);
  background: #fef2f2;
  color: #991b1b;
}
.notice-card strong {
  color: inherit;
}
.incident-state-rules-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin-bottom: 14px;
}
.incident-state-rules-banner__body {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}
.incident-state-rules-banner__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: -4px -4px 0 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.72;
}
.incident-state-rules-banner__close:hover,
.incident-state-rules-banner__close:focus-visible {
  opacity: 1;
  background: rgba(15, 23, 42, 0.08);
}

.table-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 0;
}

.schedule-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(200px, 1.2fr) auto auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.filter-bar__search {
  margin-bottom: 0;
  min-width: 0;
}
.filter-bar__search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-bar__search-input {
  flex: 1 1 180px;
  min-width: 0;
}
.filter-search-box .filter-bar__search {
  flex: 1 1 auto;
  margin-bottom: 0;
}
.filter-search-box__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.filter-search-box--below {
  margin-top: 0;
}
.card > .filter-search-box.card {
  margin-top: 0;
}
.compliance-section-filters {
  margin-bottom: 0;
}
.compliance-section-filters .compliance-gaps-filter {
  margin: 0;
}
.compliance-gaps-filter-card {
  margin-bottom: 14px;
}

/* Visit documentation — unified period + workflow */
.visit-docs-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.visit-docs-toolbar {
  padding: 16px 18px;
}
.visit-docs-toolbar__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.visit-docs-toolbar__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
}
.visit-docs-toolbar__hint {
  margin: 0;
  max-width: 42rem;
}
.visit-docs-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
}
.visit-docs-toolbar__date {
  min-width: 10.5rem;
}
.visit-docs-toolbar__gaps {
  margin: 0;
  margin-left: auto;
}
.visit-docs-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.visit-docs-toolbar__status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.visit-docs-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.875rem;
}
.visit-docs-stat__label {
  color: var(--text-muted, #6b7280);
}
.visit-docs-stat__value {
  font-weight: 600;
  font-size: 1rem;
}
.visit-docs-workflow {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.visit-docs-workflow__step-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
}
.visit-docs-telephony-link {
  margin: 0;
}
.evv-export-period-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-muted, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
}
.visit-docs-audit {
  margin-top: 4px;
}
.visit-docs-audit__stats {
  margin-bottom: 14px;
}

/* Medicaid EVV → claims pipeline dashboard */
.visit-docs-pipeline {
  margin-bottom: 14px;
}
.visit-docs-pipeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.visit-docs-pipeline__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.visit-docs-pipeline__step {
  flex: 1 1 140px;
  min-width: 120px;
}
.visit-docs-pipeline__step-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--surface-muted, #f9fafb);
  min-height: 72px;
}
.visit-docs-pipeline__step--active .visit-docs-pipeline__step-link {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
}
.visit-docs-pipeline__step--done .visit-docs-pipeline__step-link {
  border-color: var(--success, #16a34a);
  opacity: 0.92;
}
.visit-docs-pipeline__step-num {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b7280);
}
.visit-docs-pipeline__step-label {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}
.visit-docs-pipeline__step-count {
  font-size: 1.125rem;
  font-weight: 700;
}
.visit-docs-pipeline__scope {
  margin-bottom: 12px;
}
.visit-docs-pipeline__scope summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted, #6b7280);
}
.visit-docs-pipeline__scope-list {
  margin: 10px 0 0;
  padding-left: 1.25rem;
  line-height: 1.55;
}
.visit-docs-pipeline__table-title {
  font-weight: 600;
  margin: 0 0 8px;
}
.visit-docs-pipeline__table-wrap {
  margin-top: 8px;
}
.visit-docs-pipeline__footer {
  margin: 14px 0 0;
}
.visit-docs-incomplete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface-muted, #f9fafb);
}
.visit-docs-incomplete--attention {
  border-color: var(--warning, #d97706);
  background: rgba(217, 119, 6, 0.06);
}
.visit-docs-incomplete__stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.visit-docs-incomplete__value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.visit-docs-incomplete__label {
  font-size: 0.875rem;
  font-weight: 600;
}
.visit-docs-incomplete__detail {
  margin: 0;
  flex: 1 1 220px;
}
.visit-docs-incomplete-card .visit-docs-incomplete {
  margin-bottom: 0;
}
.visit-docs-incomplete-card--attention {
  border-color: var(--warning, #d97706);
}

/* Visit-level EVV export — period + ordered action rows */
.evv-export-period {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface-muted, #f9fafb);
}
.evv-export-period__label {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 8px;
}
.evv-export-period__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}
.evv-export-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.evv-export-group__title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.evv-export-group__intro {
  margin: 0 0 10px;
}
.evv-export-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.evv-export-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface, #fff);
}
.evv-export-action__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.evv-export-action__desc {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.evv-export-action__body {
  flex: 1 1 220px;
  min-width: 0;
}
.evv-export-action__cta {
  flex: 0 0 auto;
}
.evv-export-action--primary {
  border-color: var(--primary-border, #c7d2fe);
  background: var(--primary-surface, #eef2ff);
}
.evv-export-action--muted {
  opacity: 0.92;
}
.evv-export-action--muted .evv-export-action__cta {
  font-size: 0.8125rem;
  color: var(--muted, #6b7280);
}
.evv-batch-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.evv-batch-claim-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

/* Telephony EVV — setup guide + preferences */
.telephony-evv-webhook-url {
  font-size: 0.8125rem;
  word-break: break-all;
}
.telephony-evv-steps {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.55;
}
.telephony-evv-payload {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-muted, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  font-size: 0.8125rem;
  overflow-x: auto;
}
.telephony-evv-partner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.telephony-evv-partner {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface, #fff);
}
.telephony-evv-partner summary {
  cursor: pointer;
  font-size: 0.9375rem;
}
.telephony-evv-compliance-card .btn {
  margin-top: 4px;
}

.filter-bar {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.schedule-changes-filter {
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.schedule-changes-list__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.schedule-changes-list__meta-line {
  margin-top: 6px;
}
.schedule-changes-list__reason,
.schedule-changes-list__denial-note {
  margin-top: 6px;
}
.schedule-changes-list__requester {
  margin-top: 4px;
}
.schedule-changes-list__empty {
  margin: 0;
}
.filter-bar__count {
  align-self: center;
  justify-self: end;
  padding-bottom: 0 !important;
  font-weight: 600;
}

.turnover-retention-nudge-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.open-shift-offer-status {
  margin-top: 8px;
}
.open-shift-offer-status--compact {
  margin-top: 6px;
}
.open-shift-offer-status__list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.open-shift-offer-status__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.open-shift-offer-status__name {
  font-weight: 500;
}
.open-shift-offer-status__badge {
  white-space: nowrap;
}

.open-shift-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.open-shift-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 10px;
}
.open-shift-card__meta {
  flex: 1 1 180px;
  min-width: 0;
}
.open-shift-card__title {
  margin: 0;
  font-size: 1.05rem;
}
.open-shift-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
}
.open-shift-card__recommendation {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 8px);
  background: rgba(var(--success-rgb, 34, 197, 94), 0.08);
}
.open-shift-card__recommendation-text {
  margin: 0;
  flex: 1 1 200px;
}
.open-shift-card__recommendation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.open-shift-assign-form,
.open-shift-notify-form {
  display: inline-flex;
  margin: 0;
}
.open-shift-auto-fill-master {
  margin-bottom: 18px;
}
.open-shift-auto-fill-triggers {
  margin-bottom: 18px;
}
.open-shift-auto-fill-triggers.is-disabled {
  opacity: 0.62;
}
.open-shift-auto-fill-triggers.is-disabled .open-shift-trigger-card {
  pointer-events: none;
}
.open-shift-auto-fill-triggers__head {
  margin-bottom: 12px;
}
.open-shift-auto-fill-triggers__title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
}
.open-shift-auto-fill-triggers__intro {
  margin: 0;
  max-width: 640px;
}
.open-shift-trigger-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.open-shift-trigger-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card, #fff);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.open-shift-trigger-card.is-active {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--card, #fff));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent);
}
.open-shift-trigger-card__label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  cursor: pointer;
}
.open-shift-trigger-card__label > input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.open-shift-trigger-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.open-shift-trigger-card__title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}
.open-shift-trigger-card__desc {
  margin: 0;
  line-height: 1.45;
}
.open-shift-trigger-card__switch {
  flex: 0 0 44px;
  margin-top: 2px;
  pointer-events: none;
}
.open-shift-trigger-card__switch .scheduler-switch-slider {
  background: var(--border);
}
.open-shift-trigger-card.is-active .open-shift-trigger-card__switch .scheduler-switch-slider {
  background: var(--primary);
}
.open-shift-trigger-card.is-active .open-shift-trigger-card__switch .scheduler-switch-slider::after {
  transform: translateX(20px);
}
.open-shift-trigger-card:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.open-shift-auto-fill-limit {
  display: grid;
  gap: 6px;
  max-width: 280px;
}
.open-shift-auto-fill-limit.is-disabled {
  opacity: 0.62;
  pointer-events: none;
}
.open-shift-auto-fill-limit.is-disabled input,
.open-shift-auto-fill-limit.is-disabled select,
.open-shift-auto-fill-limit.is-disabled textarea {
  pointer-events: none;
}
.open-shift-auto-fill-limit__input {
  max-width: 6rem;
}
.open-shift-auto-fill-limit__hint {
  margin: 0;
}
.schedule-filter-bar .form-group {
  margin-bottom: 0;
}
.schedule-filter-bar .text-sm {
  padding-bottom: 7px;
}
.schedule-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 14px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary-dark);
  padding: 4px 9px;
  font-size: 0.84rem;
}
.filter-chip button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0 0 1px;
}
@media (max-width: 760px) {
  .schedule-filter-bar {
    grid-template-columns: 1fr;
  }
  .schedule-filter-bar .text-sm {
    padding-bottom: 0;
  }
}

/* Right-side slide-in panels */
.side-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.34);
  opacity: 0;
  transition: opacity 180ms ease;
}
.side-panel-backdrop.is-open {
  opacity: 1;
}
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(440px, 100vw);
  /* `dvh` keeps the panel inside the visible viewport on iOS (so the close
     button isn't hidden under the dynamic toolbars). `vh` is the fallback. */
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--card);
  box-shadow: -18px 0 36px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 180ms ease;
  display: flex;
  flex-direction: column;
}
.side-panel.is-open {
  transform: translateX(0);
}
.side-panel--wide {
  width: min(760px, 100vw);
}
.side-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  /* Push the header below the iOS notch / status bar when the WebView
     overlays the system UI. Falls back to the base 20px on browsers
     without env() support. */
  padding-top: max(20px, calc(var(--rithma-safe-top) + 12px));
  border-bottom: 1px solid var(--border);
}
.side-panel__header h3 {
  margin: 0 0 4px;
}
.side-panel__header p {
  margin: 0;
}
.side-panel__body {
  padding: 20px 22px 28px;
  /* Keep the submit button above the iPhone home indicator. */
  padding-bottom: max(28px, calc(var(--rithma-safe-bottom) + 20px));
  /* Fill the remaining panel height and scroll inside instead of letting a
     long form push past the bottom edge. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Lock the underlying page scroll while a side panel is open so the body
   doesn't drift behind the backdrop on touch. */
body.has-side-panel-open {
  overflow: hidden;
  touch-action: none;
}
.side-panel-validation {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 8px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 0.88rem;
}
.side-panel-validation strong {
  display: block;
  margin-bottom: 4px;
}
.side-panel-validation ul {
  margin: 0;
  padding-left: 18px;
}
.senior-detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}
.senior-detail-list > div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.senior-detail-list > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.senior-detail-list dt {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.senior-detail-list dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.senior-detail-section__title {
  margin: 18px 0 10px 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.senior-shift-detail-panel-body .senior-detail-section:first-child .senior-detail-section__title {
  margin-top: 0;
}
.recurring-daily-suggestion {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  background: #eff6ff;
  color: var(--primary-dark);
  font-size: 0.84rem;
}
.recurring-daily-suggestion .btn {
  margin-left: 6px;
}
@media (max-width: 520px) {
  .side-panel {
    width: 100vw;
  }
  .side-panel__header,
  .side-panel__body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .side-panel--wide .table,
  .manual-segments-table {
    min-width: 620px;
  }
  .manual-seg-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Stat grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--card);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat-card .label { color: var(--muted); font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 1.9em; font-weight: 700; color: var(--primary); margin-top: 4px; word-break: break-word; }

/* Phone & small tablet: pack two compact stat cards per row instead of
   one tall card. Restyled to feel like an iOS widget — soft gradient
   surface, layered shadow, tabular numerics, and a chip-style action
   link instead of a plain web underline. Desktop styling above is
   unchanged. Breakpoint matches the `table-app-list` mobile threshold
   so all mobile UI patterns flip together. */
@media (max-width: 830px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card {
    /* Layered surface: subtle top highlight gradient + soft border + a
       short close shadow paired with a softer ambient one. */
    padding: 14px 14px 12px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, #ffffff 0%, var(--card) 60%);
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.04),
      0 6px 16px rgba(15, 23, 42, 0.06);
    min-height: 96px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: transform 120ms ease, box-shadow 120ms ease;
    -webkit-tap-highlight-color: transparent;
  }
  .stat-card:active {
    transform: scale(0.985);
    box-shadow:
      0 1px 1px rgba(15, 23, 42, 0.05),
      0 2px 6px rgba(15, 23, 42, 0.05);
  }
  .stat-card .label {
    font-size: 0.66em;
    letter-spacing: 0.8px;
    line-height: 1.25;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
  }
  .stat-card .value {
    font-size: 1.7em;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
  }
  /* Status text (e.g. "Needs attention") sits right under the value. */
  .stat-card span.text-sm {
    font-size: 0.74em;
    margin-top: 2px;
    line-height: 1.3;
  }
  /* Action link styled as a pill chip pinned to the bottom of the card —
     the same affordance pattern used by iOS Home-screen widgets. */
  .stat-card a.text-sm {
    align-self: flex-start;
    margin-top: auto;
    padding: 5px 10px 5px 11px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.74em;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.25;
    -webkit-tap-highlight-color: transparent;
    transition: background 120ms ease, transform 120ms ease;
  }
  .stat-card a.text-sm::after {
    content: "›";
    margin-left: 4px;
    font-weight: 700;
    opacity: 0.7;
  }
  .stat-card a.text-sm:active {
    background: rgba(37, 99, 235, 0.18);
    transform: scale(0.97);
  }
}

/* Dashboard — calmer hierarchy, flatter surfaces */
.dashboard {
  max-width: 1080px;
  width: 100%;
  min-width: 0;
}
.dashboard .page-header {
  margin-bottom: 20px;
  align-items: flex-end;
  gap: 14px;
}
.dashboard .page-header h1 {
  font-size: 1.45em;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.dashboard-eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dashboard-next-shift {
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.dashboard-next-shift__card,
.dashboard-next-shift__empty {
  padding: 24px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.06) 0%, var(--card) 42%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: clip;
  font-size: 1.2rem;
  line-height: 1.35;
}
.dashboard-next-shift__card > *,
.dashboard-next-shift__empty > *,
.dashboard-next-shift__following > * {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.dashboard-next-shift__eyebrow,
.dashboard-next-shift__client,
.dashboard-next-shift__schedule,
.dashboard-next-shift__address,
.dashboard-next-shift__countdown,
.dashboard-next-shift__following-label,
.dashboard-next-shift__following-client,
.dashboard-next-shift__following-schedule,
.dashboard-next-shift__countdown--following,
.dashboard-next-shift__timing-hint,
.dashboard-next-shift__dev-hint,
.dashboard-next-shift__clock-btn,
.dashboard-next-shift__card .cs-permission-error,
.dashboard-next-shift__card .start-rithma-popup,
.dashboard-next-shift__card form {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dashboard-next-shift__card .text-sm,
.dashboard-next-shift__empty .text-sm {
  font-size: 1.1rem;
}
.dashboard-next-shift__card .badge,
.dashboard-next-shift__empty .badge {
  font-size: 1rem;
  padding: 0.35em 0.75em;
}
.dashboard-next-shift__empty-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 4.5vw, 1.9rem);
  font-weight: 650;
}
.dashboard-next-shift__eyebrow {
  margin: 0 0 8px;
  font-size: clamp(1rem, 3vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dashboard-next-shift__client {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 5.5vw, 2.15rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.dashboard .dashboard-next-shift__card h2.dashboard-next-shift__client,
.dashboard .dashboard-next-shift__empty h2.dashboard-next-shift__client {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 8vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.dashboard-next-shift__schedule {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 500;
  color: var(--text);
}
.dashboard-next-shift__address {
  margin-top: 6px;
  font-size: clamp(1.1rem, 3.5vw, 1.3rem);
}
.dashboard-next-shift__countdown {
  margin: 18px 0 16px;
  font-size: clamp(2rem, 7vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.dashboard-next-shift__countdown--live {
  color: var(--success);
}
.dashboard-next-shift__countdown--warn {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  color: var(--warning);
}
.dashboard-next-shift__countdown--muted {
  font-size: clamp(1.45rem, 4.5vw, 1.95rem);
  color: var(--muted);
}
.dashboard-next-shift__countdown--late {
  color: var(--danger);
}
.dashboard-next-shift__clock-btn {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  padding: 16px 22px;
  font-size: clamp(1.25rem, 4vw, 1.45rem);
  font-weight: 650;
  border-radius: 12px;
}
.dashboard-next-shift__timing-hint {
  margin: 12px 0 0;
  font-size: clamp(1.05rem, 3.2vw, 1.2rem);
}
.dashboard-next-shift__dev-hint {
  margin: 0 0 14px;
  padding: 12px 14px;
  font-size: clamp(1rem, 3vw, 1.15rem);
}
.dashboard-next-shift__following {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.dashboard-next-shift__following-label {
  margin: 0 0 10px;
  font-size: clamp(1rem, 3vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dashboard-next-shift__following-client {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 4.5vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.dashboard .dashboard-next-shift__card h3.dashboard-next-shift__following-client {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.dashboard-next-shift__following-schedule {
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}
.dashboard-next-shift__countdown--following {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 2.45rem);
  color: var(--primary);
}
.dashboard-next-shift__card .cs-permission-error,
.dashboard-next-shift__card .start-rithma-popup {
  font-size: clamp(1.05rem, 3.2vw, 1.2rem);
  max-width: 420px;
  width: 100%;
}

@media (max-width: 830px) {
  .dashboard-next-shift__card,
  .dashboard-next-shift__empty {
    padding: 20px 14px;
  }
  /* Long date/time lines must wrap instead of forcing horizontal overflow,
     which blocks vertical scroll on iOS WebView and narrow mobile browsers. */
  .dashboard-next-shift__schedule,
  .dashboard-next-shift__following-schedule {
    font-size: clamp(1.05rem, 3.8vw, 1.25rem);
    line-height: 1.35;
  }
  .dashboard-next-shift__address {
    font-size: clamp(1rem, 3.4vw, 1.15rem);
    line-height: 1.35;
  }
  /* Large hero typography can widen the flex column on Chrome mobile and trap
     touch scrolling on the document. Pin vertical scroll on .main (web + native). */
  html:has(.layout .dashboard) {
    height: 100%;
    overflow: hidden;
  }
  body:has(.layout .dashboard) {
    overflow: hidden;
  }
  .layout:has(.dashboard) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  .main:has(.dashboard) {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .dashboard,
  .dashboard-next-shift {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }
}
.dashboard-meta {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}
.dashboard .stats-grid {
  gap: 10px;
  margin-bottom: 18px;
}
.dashboard .stat-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: none;
  background: var(--card);
}
.dashboard .stat-card .label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}
.dashboard .stat-card .value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.dashboard .stat-card .value.stat-value--ok { color: var(--success); }
.dashboard .stat-card .value.stat-value--warn { color: var(--warning); }
.dashboard .stat-card .value.stat-value--danger { color: var(--danger); }
.dashboard .stat-card .value.stat-value--id {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
}
.dashboard .stat-card a.text-sm {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}
.dashboard .stat-card a.text-sm:hover { text-decoration: underline; }
.dashboard .stat-split-row > div + div {
  border-left-color: rgba(226, 232, 240, 0.9);
  padding-left: 12px;
}
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 4px;
}
.dashboard-actions .btn {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 14px;
  min-height: 0;
  border-radius: 8px;
  box-shadow: none;
}
.dashboard-actions .btn-secondary {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}
.dashboard-actions .btn-secondary:hover {
  background: var(--bg);
  border-color: #cbd5e1;
}
.dashboard-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Agency analytics — charts & tables */
.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.analytics-period-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.analytics-view-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card, #fff);
  gap: 2px;
}
.analytics-view-toggle__btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.analytics-view-toggle__btn:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.04);
}
.analytics-view-toggle__btn--active,
.analytics-view-toggle__btn[aria-selected="true"] {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}
.analytics-view-toggle__btn--active:hover,
.analytics-view-toggle__btn[aria-selected="true"]:hover {
  color: #fff;
  background: var(--primary);
}
.analytics-view[hidden] {
  display: none !important;
}
.analytics-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.analytics-panels--tables {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}
.analytics-panel {
  padding: 16px 18px;
  margin-bottom: 0;
  overflow: visible;
}
.analytics-panel--wide {
  grid-column: 1 / -1;
}
.analytics-panel__head {
  margin-bottom: 12px;
}
.analytics-panel__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
}
.analytics-panel__subtitle {
  margin: 0;
}
.analytics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
.analytics-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.analytics-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.analytics-legend__swatch--scheduled { background: #bfdbfe; }
.analytics-legend__swatch--completed { background: #059669; }
.analytics-legend__swatch--fill { background: #6366f1; }
.analytics-bar-chart-scroller {
  overflow-x: auto;
  overflow-y: visible;
  margin: 0 -4px;
  padding: 0 4px;
}
.analytics-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 180px;
  padding-top: 8px;
}
.analytics-bar-chart__col {
  flex: 1 1 0;
  min-width: 28px;
  max-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  outline: none;
}
.analytics-bar-chart__col:focus-visible .analytics-bar-chart__stack {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
  border-radius: 6px;
}
.analytics-bar-chart__stack {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  position: relative;
  overflow: hidden;
}
.analytics-bar-chart__tooltip {
  min-width: 118px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.72rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  white-space: nowrap;
  pointer-events: none;
}
.analytics-bar-chart__tooltip--fixed {
  position: fixed;
  z-index: 10050;
  transform: translate(-50%, calc(-100% - 8px));
}
.analytics-bar-chart__tooltip--fixed::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0f172a;
}
.analytics-bar-chart__tooltip-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: #fff;
}
.analytics-bar-chart__tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.analytics-bar-chart__tooltip-row + .analytics-bar-chart__tooltip-row {
  margin-top: 3px;
}
.analytics-bar-chart__tooltip-row strong {
  margin-left: auto;
  font-weight: 700;
  color: #fff;
}
.analytics-bar-chart__tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.analytics-bar-chart__tooltip-dot--scheduled { background: #93c5fd; }
.analytics-bar-chart__tooltip-dot--completed { background: #34d399; }
.analytics-bar-chart__tooltip-dot--fill { background: #818cf8; }
.analytics-bar-chart__tooltip-dot--muted { background: #94a3b8; }
.analytics-bar-chart__tooltip-dot--star-5 { background: #059669; }
.analytics-bar-chart__tooltip-dot--star-4 { background: #10b981; }
.analytics-bar-chart__tooltip-dot--star-3 { background: #d97706; }
.analytics-bar-chart__tooltip-dot--star-2 { background: #f97316; }
.analytics-bar-chart__tooltip-dot--star-1 { background: #dc2626; }
.analytics-bar-chart__col--active .analytics-bar-chart__bar,
.analytics-bar-chart__col:hover .analytics-bar-chart__bar,
.analytics-bar-chart__col:focus-within .analytics-bar-chart__bar {
  filter: brightness(1.05);
}
.analytics-bar-chart__bar {
  width: 42%;
  min-height: 0;
  height: max(2px, calc(var(--bar-pct, 0) / 100 * 140px));
  max-height: 140px;
  flex-shrink: 0;
  border-radius: 4px 4px 0 0;
  transition: height 0.2s ease, filter 0.15s ease;
  cursor: default;
}
.analytics-bar-chart__stack--single .analytics-bar-chart__bar {
  width: 58%;
}
.analytics-bar-chart__bar--scheduled:hover,
.analytics-bar-chart__bar--completed:hover {
  filter: brightness(1.12);
}
.analytics-bar-chart__bar--scheduled {
  background: linear-gradient(180deg, #93c5fd 0%, #bfdbfe 100%);
}
.analytics-bar-chart__bar--completed {
  background: linear-gradient(180deg, #059669 0%, #10b981 100%);
}
.analytics-bar-chart__bar--fill {
  background: linear-gradient(180deg, #6366f1 0%, #818cf8 100%);
}
.analytics-bar-chart__label {
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
  word-break: break-word;
}
.analytics-hbar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.analytics-donut-chart-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px 28px;
}
.analytics-donut-chart {
  position: relative;
  width: 168px;
  height: 168px;
  flex-shrink: 0;
}
.analytics-donut-chart__svg {
  width: 100%;
  height: 100%;
  display: block;
}
.analytics-donut-chart__segment {
  cursor: default;
  transition: filter 0.15s ease;
}
.analytics-donut-chart__segment--active,
.analytics-donut-chart__segment:hover {
  filter: brightness(1.08);
}
.analytics-donut-chart__center {
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: var(--card, #fff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  padding: 6px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  pointer-events: none;
}
.analytics-donut-chart__value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.analytics-donut-chart__label {
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
}
.analytics-donut-chart__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 148px;
}
.analytics-donut-chart__legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text);
  border-radius: 6px;
  outline: none;
}
.analytics-donut-chart__legend-item--active,
.analytics-donut-chart__legend-item:hover {
  filter: brightness(1.04);
}
.analytics-donut-chart__legend-item:focus-visible {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}
.analytics-donut-chart__legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.analytics-donut-chart__legend-swatch--fill { background: #6366f1; }
.analytics-donut-chart__legend-swatch--muted { background: #cbd5e1; }
.analytics-donut-chart__legend-swatch--star-5 { background: #059669; }
.analytics-donut-chart__legend-swatch--star-4 { background: #10b981; }
.analytics-donut-chart__legend-swatch--star-3 { background: #d97706; }
.analytics-donut-chart__legend-swatch--star-2 { background: #f97316; }
.analytics-donut-chart__legend-swatch--star-1 { background: #dc2626; }
.analytics-donut-chart__legend-text {
  color: var(--muted);
}
.analytics-donut-chart__legend-value {
  font-weight: 600;
  color: var(--text);
}
.analytics-hbar-chart__row {
  display: grid;
  grid-template-columns: minmax(72px, 92px) 1fr minmax(48px, 72px);
  gap: 10px;
  align-items: center;
}
.analytics-hbar-chart__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.analytics-hbar-chart__track {
  height: 10px;
  border-radius: 999px;
  background: var(--border, #e2e8f0);
  overflow: hidden;
}
.analytics-hbar-chart__fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}
.analytics-hbar-chart__fill--ok,
.analytics-hbar-chart__fill--star-5,
.analytics-hbar-chart__fill--star-4 { background: #059669; }
.analytics-hbar-chart__fill--warn,
.analytics-hbar-chart__fill--star-3 { background: #d97706; }
.analytics-hbar-chart__fill--danger,
.analytics-hbar-chart__fill--star-2,
.analytics-hbar-chart__fill--star-1 { background: #dc2626; }
.analytics-hbar-chart__value {
  font-size: 0.82rem;
  text-align: right;
  white-space: nowrap;
}
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.analytics-table th,
.analytics-table td {
  padding: 10px 8px;
  border-top: 1px solid var(--border, #e2e8f0);
  text-align: left;
  vertical-align: top;
}
.analytics-table td:has(.analytics-rating),
.analytics-table td:has(.badge) {
  white-space: nowrap;
  width: 1%;
}
.analytics-table thead th {
  border-top: none;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.analytics-table--summary th {
  width: 55%;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
}
.analytics-table--summary td {
  font-weight: 600;
  color: var(--primary);
}
.analytics-table__comment {
  max-width: 220px;
  word-break: break-word;
}
.analytics-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  flex-shrink: 0;
}
.analytics-rating--ok {
  background: #dcfce7;
  color: #166534;
}
.analytics-rating--low {
  background: #fef3c7;
  color: #92400e;
}
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th,
.data-table td {
  padding: 10px 8px;
  border-top: 1px solid var(--border, #e2e8f0);
  text-align: left;
  vertical-align: top;
}
.data-table thead th {
  border-top: none;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.custom-reports-saved-empty {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
}
.custom-reports-saved-table__actions {
  min-width: 280px;
  white-space: nowrap;
}
.custom-reports-saved-table .table-row-actions__main {
  justify-content: flex-start;
}
.custom-reports-fold.card {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.custom-reports-fold__body {
  padding-top: 10px;
}
.custom-reports-fold__intro {
  margin: 0 0 12px;
}
.custom-reports-results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
@media (max-width: 720px) {
  .custom-reports-saved-table__actions {
    min-width: 0;
    white-space: normal;
  }
  .analytics-bar-chart__col {
    min-width: 22px;
  }
  .analytics-hbar-chart__row {
    grid-template-columns: 64px 1fr 40px;
    gap: 8px;
  }
}

.dashboard .card {
  padding: 18px 20px;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: none;
}
.dashboard .card h2,
.dashboard .card h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dashboard .grid-2 {
  gap: 12px;
}
.dashboard .dash-upcoming-card {
  border-left-width: 3px;
  border-left-color: rgba(20, 184, 166, 0.45);
  border-radius: 10px;
  box-shadow: none;
  padding: 12px 14px;
}
.dashboard .dash-upcoming-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
  border-left-color: var(--accent);
  background: #f8fafc;
}

.family-live-feed__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.family-live-feed__shift-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  padding: 0;
  list-style: none;
}
.family-live-feed__shift-divider-line {
  flex: 1 1 auto;
  height: 1px;
  background: rgba(148, 163, 184, 0.45);
}
.family-live-feed__shift-divider-label {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: min(100%, 20rem);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: #475569;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.family-live-feed__shift-divider-label:hover {
  color: var(--primary, #2563eb);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
}
.family-live-feed__shift-divider-senior {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}
.family-live-feed__item {
  --feed-accent: #64748b;
  --feed-chip-bg: rgba(100, 116, 139, 0.12);
  --feed-icon-bg: rgba(100, 116, 139, 0.12);
  --feed-bg: #fff;
  --feed-border: rgba(148, 163, 184, 0.35);
  border: 1px solid var(--feed-border);
  border-left: 4px solid var(--feed-accent);
  border-radius: 12px;
  background: var(--feed-bg);
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.family-live-feed__item:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}
.family-live-feed__item--new {
  animation: family-live-feed-enter 0.35s ease-out;
}
@keyframes family-live-feed-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.family-live-feed__item--en_route {
  --feed-accent: #2563eb;
  --feed-chip-bg: rgba(37, 99, 235, 0.12);
  --feed-icon-bg: rgba(37, 99, 235, 0.12);
  --feed-bg: linear-gradient(135deg, #fff 0%, rgba(37, 99, 235, 0.04) 100%);
}
.family-live-feed__item--arrived {
  --feed-accent: #0891b2;
  --feed-chip-bg: rgba(8, 145, 178, 0.12);
  --feed-icon-bg: rgba(8, 145, 178, 0.12);
  --feed-bg: linear-gradient(135deg, #fff 0%, rgba(8, 145, 178, 0.04) 100%);
}
.family-live-feed__item--shift_started {
  --feed-accent: #059669;
  --feed-chip-bg: rgba(5, 150, 105, 0.12);
  --feed-icon-bg: rgba(5, 150, 105, 0.12);
  --feed-bg: linear-gradient(135deg, #fff 0%, rgba(5, 150, 105, 0.05) 100%);
}
.family-live-feed__item--shift_ended {
  --feed-accent: #d97706;
  --feed-chip-bg: rgba(217, 119, 6, 0.12);
  --feed-icon-bg: rgba(217, 119, 6, 0.12);
  --feed-bg: linear-gradient(135deg, #fff 0%, rgba(217, 119, 6, 0.04) 100%);
}
.family-live-feed__item--visit_completed {
  --feed-accent: #7c3aed;
  --feed-chip-bg: rgba(124, 58, 237, 0.12);
  --feed-icon-bg: rgba(124, 58, 237, 0.12);
  --feed-bg: linear-gradient(135deg, #fff 0%, rgba(124, 58, 237, 0.04) 100%);
}
.family-live-feed__item--task_completed {
  --feed-accent: #16a34a;
  --feed-chip-bg: rgba(22, 163, 74, 0.12);
  --feed-icon-bg: rgba(22, 163, 74, 0.12);
  --feed-bg: linear-gradient(135deg, #fff 0%, rgba(22, 163, 74, 0.04) 100%);
}
.family-live-feed__item--snippet {
  --feed-accent: #475569;
  --feed-chip-bg: rgba(71, 85, 105, 0.1);
  --feed-icon-bg: rgba(71, 85, 105, 0.1);
  --feed-bg: linear-gradient(135deg, #fff 0%, rgba(71, 85, 105, 0.03) 100%);
}
.family-live-feed__item--photo {
  --feed-accent: #db2777;
  --feed-chip-bg: rgba(219, 39, 119, 0.12);
  --feed-icon-bg: rgba(219, 39, 119, 0.12);
  --feed-bg: linear-gradient(135deg, #fff 0%, rgba(219, 39, 119, 0.04) 100%);
}
.family-live-feed__item--shift_summary {
  --feed-accent: #4f46e5;
  --feed-chip-bg: rgba(79, 70, 229, 0.12);
  --feed-icon-bg: rgba(79, 70, 229, 0.12);
  --feed-bg: linear-gradient(135deg, #fff 0%, rgba(79, 70, 229, 0.05) 100%);
}
.family-live-feed__item-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}
.family-live-feed__icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--feed-icon-bg);
  color: var(--feed-accent);
}
.family-live-feed__content {
  flex: 1 1 auto;
  min-width: 0;
}
.family-live-feed__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.family-live-feed__chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--feed-accent);
  background: var(--feed-chip-bg);
}
.family-live-feed__time {
  flex-shrink: 0;
  white-space: nowrap;
}
.family-live-feed__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text, #0f172a);
}
.family-live-feed__body {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text, #334155);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  white-space: pre-wrap;
}
.family-live-feed__item--snippet .family-live-feed__body,
.family-live-feed__item--shift_summary .family-live-feed__body {
  border-left: 3px solid var(--feed-accent);
}
.family-live-feed__photo-link {
  display: block;
  margin-top: 10px;
}
.family-live-feed__photo {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 280px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.family-live-feed__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.family-live-feed__empty-icon {
  color: #94a3b8;
}
.family-live-feed__status {
  margin-bottom: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.1);
}
.family-live-feed--static .family-live-feed__list {
  margin-top: 0;
}

/* Live visit feed — past shift history */
.family-live-feed-history__summary {
  margin: 0 0 12px;
}
.family-live-feed-history__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.family-live-feed-history__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.family-live-feed-history__row:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}
.family-live-feed-history__row-main {
  flex: 1 1 auto;
  min-width: 0;
}
.family-live-feed-history__row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.family-live-feed-history__row-date {
  font-size: 1rem;
}
.family-live-feed-history__row-household,
.family-live-feed-history__row-caregiver,
.family-live-feed-history__row-preview {
  margin: 4px 0 0;
  line-height: 1.45;
}
.family-live-feed-history__row-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.family-live-feed-history__row-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.family-live-feed-history__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.family-live-feed-history__chevron {
  color: #94a3b8;
}
.family-live-feed-history__empty {
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.family-live-feed-history__load-wrap {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}
.dashboard .family-live-feed-widget {
  border-left: 3px solid rgba(20, 184, 166, 0.45);
}
.dashboard .dash-upcoming-card__time {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.dashboard .dash-upcoming-card__date {
  font-weight: 600;
  font-size: 0.9rem;
}
.dashboard .task-followup-details.card,
.dashboard .overtime-details.card,
.dashboard .pending-leave-details.card,
.dashboard .shift-proposal-dash.card,
.dashboard .agency-profile-missing-card.card,
.dashboard .profile-dash-gaps-card.card,
.dashboard .profile-self-missing-card.card,
.dashboard .agency-dash-link-requests {
  border-left-width: 3px;
  margin-top: 0 !important;
}
@media (max-width: 830px) {
  .dashboard .stat-card {
    min-height: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--card);
    box-shadow: none;
    border: 1px solid var(--border);
  }
  .dashboard .stat-card .label {
    font-size: 0.72rem;
    letter-spacing: 0;
    text-transform: none;
  }
  .dashboard .stat-card .value {
    font-size: 1.35rem;
  }
  .dashboard .stat-card a.text-sm {
    margin-top: 6px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--primary);
  }
  .dashboard .stat-card a.text-sm::after {
    content: none;
  }
}

/* Tables */
.table { width: 100%; border-collapse: collapse; table-layout: auto; }
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92em;
  max-width: 280px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.table th { background: var(--bg); color: var(--muted); text-transform: uppercase; font-size: 0.78em; letter-spacing: 0.5px; }
.table tr:hover { background: var(--bg); }

/* Horizontally scrollable wrapper for tables. Lets wide tables scroll
   sideways inside their card without pushing past the page boundary, and
   keeps the leading id/name columns pinned in place via `table-sticky-1`
   or `table-sticky-2` on the inner <table>. */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.table-scroll-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
}
.table-scroll-wrap > .table-scroll {
  width: 100%;
}
.table-scroll-hint {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 6;
  width: 40px;
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.table-scroll-hint[hidden] {
  display: none !important;
}
.table-scroll-wrap--scrollable .table-scroll-hint:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}
.table-scroll-hint--prev {
  left: 0;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--card) 94%, var(--text) 6%) 35%,
    transparent
  );
}
.table-scroll-hint--next {
  right: 0;
  background: linear-gradient(
    to left,
    color-mix(in srgb, var(--card) 94%, var(--text) 6%) 35%,
    transparent
  );
}
.table-scroll-hint__icon {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  opacity: 0.42;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--card) 80%, transparent));
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.table-scroll-hint--prev .table-scroll-hint__icon {
  transform: rotate(-135deg);
  margin-left: 4px;
}
.table-scroll-hint--next .table-scroll-hint__icon {
  transform: rotate(45deg);
  margin-right: 4px;
}
.table-scroll-hint:hover .table-scroll-hint__icon,
.table-scroll-hint:focus-visible .table-scroll-hint__icon {
  opacity: 0.78;
}
.table-scroll-hint:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
  outline-offset: -2px;
}
@media (max-width: 830px) {
  .table-scroll-wrap:has(> .table-scroll > .table.table-app-list) .table-scroll-hint {
    display: none !important;
  }
}
.table-scroll > .table { margin: 0; width: 100%; }
.table-scroll > .table.table-wide { min-width: 720px; }

.table-scroll > .table.table-sticky-1,
.table-scroll > .table.table-sticky-2 {
  /* Sticky cells need separated borders so they paint reliably in WebKit. */
  border-collapse: separate;
  border-spacing: 0;
}
.table-scroll > .table.table-sticky-1 th,
.table-scroll > .table.table-sticky-1 td,
.table-scroll > .table.table-sticky-2 th,
.table-scroll > .table.table-sticky-2 td {
  border-bottom: 1px solid var(--border);
}

.table-scroll > .table.table-sticky-1 > thead > tr > th:first-child,
.table-scroll > .table.table-sticky-1 > tbody > tr > td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card);
  box-shadow: 1px 0 0 var(--border);
  min-width: 160px;
  max-width: 240px;
  white-space: normal;
}
.table-scroll > .table.table-sticky-1 > thead > tr > th:first-child {
  background: var(--bg);
  z-index: 3;
}

.table-scroll > .table.table-sticky-2 > thead > tr > th:nth-child(1),
.table-scroll > .table.table-sticky-2 > tbody > tr > td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card);
  width: 110px;
  min-width: 110px;
  max-width: 130px;
  white-space: nowrap;
}
.table-scroll > .table.table-sticky-2 > thead > tr > th:nth-child(2),
.table-scroll > .table.table-sticky-2 > tbody > tr > td:nth-child(2) {
  position: sticky;
  left: 110px;
  z-index: 2;
  background: var(--card);
  min-width: 160px;
  max-width: 240px;
  box-shadow: 1px 0 0 var(--border);
}
.table-scroll > .table.table-sticky-2 > thead > tr > th:nth-child(1),
.table-scroll > .table.table-sticky-2 > thead > tr > th:nth-child(2) {
  background: var(--bg);
  z-index: 3;
}

/* Keep row hover consistent across sticky and non-sticky cells. Sticky cells
   paint their own backgrounds, so we need to repaint them on hover too. */
.table-scroll > .table.table-sticky-1 tbody tr:hover > td,
.table-scroll > .table.table-sticky-2 tbody tr:hover > td {
  background: var(--bg);
}

/* Cells that span multiple columns (e.g. empty-state rows that say
   "no results") should opt out of sticky positioning so they render
   across the full row instead of getting pinned to the left edge. */
.table-scroll > .table.table-sticky-1 > tbody > tr > td[colspan]:first-child,
.table-scroll > .table.table-sticky-2 > tbody > tr > td[colspan]:nth-child(1),
.table-scroll > .table.table-sticky-2 > tbody > tr > td[colspan]:nth-child(2) {
  position: static;
  width: auto;
  min-width: 0;
  max-width: none;
  box-shadow: none;
  white-space: normal;
}

/* Tighter sticky-column widths on phones so the scrolling area still has
   room for the trailing data columns. */
@media (max-width: 480px) {
  .table-scroll > .table.table-sticky-2 > thead > tr > th:nth-child(1),
  .table-scroll > .table.table-sticky-2 > tbody > tr > td:nth-child(1) {
    width: 88px;
    min-width: 88px;
    max-width: 100px;
  }
  .table-scroll > .table.table-sticky-2 > thead > tr > th:nth-child(2),
  .table-scroll > .table.table-sticky-2 > tbody > tr > td:nth-child(2) {
    left: 88px;
    min-width: 130px;
    max-width: 170px;
  }
  .table-scroll > .table.table-sticky-1 > thead > tr > th:first-child,
  .table-scroll > .table.table-sticky-1 > tbody > tr > td:first-child {
    min-width: 130px;
    max-width: 170px;
  }
}

/* === Table column min-widths (desktop) ====================================
   Scrollable list tables keep readable column floors; the wrapper scrolls
   horizontally on narrow viewports. Skipped at max-width 830px where
   `table-app-list` reflows rows into stacked cards. */
@media (min-width: 831px) {
  .table-scroll > .table.table-app-list,
  .table-scroll > .table.table-wide {
    width: max-content;
    min-width: 100%;
  }

  .table-scroll > .table.table-app-list thead th,
  .table-scroll > .table.table-app-list tbody td,
  .table-scroll > .table.table-wide thead th,
  .table-scroll > .table.table-wide tbody td {
    min-width: 88px;
    max-width: 280px;
  }

  .table-scroll > .table .app-id { min-width: 104px; max-width: 140px; }
  .table-scroll > .table .app-name { min-width: 136px; max-width: 240px; }
  .table-scroll > .table .app-meta { min-width: 120px; max-width: 280px; }
  .table-scroll > .table .app-actions { min-width: 168px; max-width: 220px; vertical-align: middle; }
  .table-scroll > .table .app-detail { min-width: 112px; max-width: 280px; }

  .table-scroll > .table .tbl-col--id { min-width: 100px; max-width: 140px; }
  .table-scroll > .table .tbl-col--name { min-width: 140px; max-width: 240px; }
  .table-scroll > .table .tbl-col--email { min-width: 176px; max-width: 280px; }
  .table-scroll > .table .tbl-col--phone { min-width: 118px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--cert { min-width: 100px; max-width: 140px; }
  .table-scroll > .table .tbl-col--status { min-width: 92px; max-width: 140px; }
  .table-scroll > .table .tbl-col--badge { min-width: 88px; max-width: 120px; }
  .table-scroll > .table .tbl-col--date { min-width: 128px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--datetime { min-width: 148px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--submitted { min-width: 128px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--type { min-width: 108px; max-width: 160px; }
  .table-scroll > .table .tbl-col--when { min-width: 168px; max-width: 220px; }
  .table-scroll > .table .tbl-col--reason { width: 220px; min-width: 220px; max-width: 220px; }
  .table-scroll > .table .tbl-col--text { min-width: 160px; max-width: 280px; }
  .table-scroll > .table .tbl-col--text-lg { min-width: 200px; max-width: 360px; }
  .table-scroll > .table .tbl-col--text-xl { min-width: 280px; max-width: 520px; }
  .table-scroll > .table .tbl-col--hours { min-width: 120px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--recurrence { min-width: 132px; max-width: 180px; }
  .table-scroll > .table .tbl-col--time { min-width: 128px; max-width: 160px; }
  .table-scroll > .table .tbl-col--range { min-width: 140px; max-width: 180px; }
  .table-scroll > .table .tbl-col--count { min-width: 120px; max-width: 140px; }
  .table-scroll > .table .tbl-col--filename { min-width: 160px; max-width: 280px; }
  .table-scroll > .table .tbl-col--fields { min-width: 72px; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--actions { width: 168px; min-width: 168px; max-width: 168px; }
  .table-scroll > .table .tbl-col--actions-lg { min-width: 196px; max-width: 240px; }
  .table-scroll > .table .tbl-col--caregiver { min-width: 132px; max-width: 200px; }
  .table-scroll > .table .tbl-col--client { min-width: 132px; max-width: 200px; }
  .table-scroll > .table .tbl-col--role { min-width: 120px; max-width: 180px; }
  .table-scroll > .table .tbl-col--relationship { min-width: 112px; max-width: 160px; }
  .table-scroll > .table .tbl-col--login { min-width: 80px; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--metric { min-width: 108px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--money { min-width: 112px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--score { min-width: 100px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table-scroll > .table .tbl-col--units { min-width: 100px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .table-scroll > .table .tbl-col--wrap {
    white-space: normal;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  .family-eod-summary-text {
    white-space: pre-line;
    line-height: 1.5;
  }
  #saved-summaries .tbl-col--date {
    min-width: 168px;
    max-width: 280px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.35;
  }
}

/* === Visible-row cap (~10 rows) =========================================
   Opt-in via `table-scroll--max-rows` on the .table-scroll wrapper.
   Caps the visible portion of a list at roughly the first 10 body rows
   on desktop; anything past that scrolls in place. The thead stays
   pinned so the column labels are always visible while scrolling.

   Phone widths intentionally skip the cap: `table-app-list` reflows
   rows into stacked cards and the wrapper's existing
   `overflow: visible` rule (further below) keeps mobile lists flowing
   with the page scroll instead of nesting a fixed-height scroll
   region inside the card. */
@media (min-width: 831px) {
  .table-scroll--max-rows {
    /* thead (~40px) + 10 typical rows (~48px each) + 8px hint that
       reveals the next row's top edge when the cap is engaged. */
    max-height: calc(40px + 48px * 10 + 8px);
    overflow: auto;
    contain: paint;
  }
  .table-scroll--max-rows > .table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--bg);
  }
  /* Re-assert z-index for sticky-left thead cells (table-sticky-1 /
     table-sticky-2) so they keep painting above the non-corner sticky-
     top thead cells when the user scrolls horizontally too. Same
     specificity as the originals; source order wins. */
  .table-scroll--max-rows > .table.table-sticky-1 > thead > tr > th:first-child,
  .table-scroll--max-rows > .table.table-sticky-2 > thead > tr > th:nth-child(1),
  .table-scroll--max-rows > .table.table-sticky-2 > thead > tr > th:nth-child(2) {
    z-index: 5;
  }
}

/* === Working-hours card control rows ===================================
   Used by the Caregivers page to lay out the prev/next month controls
   and the custom-range date pickers. The `hidden` global attribute
   takes precedence (display:none) when present, so toggling a row's
   visibility is just `el.hidden = true/false` from JS — no inline
   style flips required. */
.hours-controls-row {
  display: flex;
}
.hours-controls-row[hidden] {
  display: none;
}

/* Actual-hours adjustment modal (Caregivers → Working hours). */
.hours-adjust-modal {
  width: min(calc(100vw - 32px), 420px);
}
.hours-adjust-modal__head {
  margin-bottom: 16px;
}
.hours-adjust-modal__title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  line-height: 1.3;
}
.hours-adjust-modal__subtitle {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.hours-adjust-modal__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.hours-adjust-modal__stat {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg-muted, #f8fafc);
}
.hours-adjust-modal__stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.hours-adjust-modal__stat-value {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
  line-height: 1.2;
}
.hours-adjust-modal__stat-hint {
  display: block;
  margin-top: 4px;
}
.hours-adjust-modal__field {
  margin-bottom: 0;
}
.hours-adjust-modal__input {
  max-width: 9rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.hours-adjust-modal__hint {
  margin: 8px 0 0;
}
@media (max-width: 480px) {
  .hours-adjust-modal__stats {
    grid-template-columns: 1fr;
  }
}

   wired to a click handler that opens the inline preview modal
   instead of navigating. We keep the underline-on-hover affordance
   so the user can still see it's interactive. */
.document-preview-row--active {
  background: rgba(59, 130, 246, 0.08);
  transition: background 0.4s ease;
}
.document-preview-trigger {
  cursor: pointer;
}
.document-preview-trigger:hover {
  text-decoration: underline;
}

/* Inline preview modal for agency Documents.
   --------------------------------------------------------------------
   Hidden by default; the [open] attribute (toggled in JS) flips it to
   a centered flex overlay. Click on the backdrop or the close button
   tears it down. The body region is sized to the viewport so a tall
   PDF gets a real, scrollable preview area without pushing the page
   layout around.
*/
.document-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.document-preview-modal[open] {
  display: flex;
}
.document-preview-modal__backdrop {
  position: absolute;
  inset: 0;
}
.document-preview-modal__content {
  position: relative;
  background: var(--bg, #fff);
  border-radius: 10px;
  max-width: min(1100px, 95vw);
  width: 100%;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.document-preview-modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.document-preview-modal__title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-preview-modal__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  color: inherit;
}
.document-preview-modal__body {
  flex: 1 1 auto;
  overflow: auto;
  background: #2b2b2b;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.document-preview-modal__body iframe {
  width: 100%;
  height: 75vh;
  border: 0;
  background: #fff;
  display: block;
}
.document-preview-modal__body img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #fff;
  display: block;
}
.document-preview-modal__body--pages {
  display: block;
  align-items: stretch;
  justify-content: flex-start;
  background: var(--bg, #f8fafc);
}
.document-preview-modal__pages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
}
.document-preview-modal__page {
  width: 100%;
  height: auto;
  max-height: none;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  border-radius: 4px;
}
.document-preview-modal__page[data-doc-preview-loading] {
  min-height: 120px;
  background: #e2e8f0;
}
.document-preview-modal__page--error {
  min-height: 80px;
  padding: 16px;
  object-fit: contain;
}
.document-preview-modal__fallback {
  padding: 40px;
  text-align: center;
  color: var(--text, #1e293b);
  background: var(--bg, #fff);
  width: 100%;
  align-self: stretch;
}
.document-preview-modal__footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border, #e2e8f0);
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  /* Phone-friendly full-bleed preview — modal padding becomes
     wasted space when the screen is small. */
  .document-preview-modal { padding: 0; }
  .document-preview-modal__content {
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  .document-preview-modal__body iframe { height: 70vh; }
}
/* Lock body scroll while the preview overlay is open so the
   underlying page doesn't scroll out from under it on touch
   devices when the user pans inside the modal. */
html.document-preview-modal-open,
html.document-preview-modal-open body {
  overflow: hidden;
}

/* Documents page tab strip — sits directly above the file list and
   the upload form. Active tab gets a 2px underline that visually
   continues the bottom border of the container, mirroring the
   "tab over a card" pattern other agency pages use. */
.documents-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
button.documents-tab {
  background: transparent;
  border: none;
  font: inherit;
  font-family: inherit;
  cursor: pointer;
}
.documents-tab:hover {
  background: var(--bg);
}
.documents-tab--active {
  border-bottom-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}

/* Documents page — panels, filters, upload, row actions */
.documents-page-intro {
  max-width: 720px;
  margin: 6px 0 0;
}
.documents-encryption-note {
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg, #f8fafc) 80%, var(--surface, #fff));
}
.documents-encryption-note > summary {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
}
.documents-encryption-note[open] > summary {
  margin-bottom: 8px;
  color: var(--text, #0f172a);
}
.documents-encryption-note__body {
  margin: 0;
  max-width: 720px;
}
.documents-tab-panel {
  padding-top: 4px;
}
.documents-panel {
  margin-bottom: 20px;
}
.documents-panel:last-child {
  margin-bottom: 0;
}
.documents-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.documents-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.documents-panel__intro {
  margin: 0 0 14px;
  max-width: 720px;
}
.documents-filter-bar {
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto;
  margin: 12px 0 18px;
}
@media (max-width: 900px) {
  .documents-filter-bar {
    grid-template-columns: 1fr 1fr;
  }
  .documents-filter-bar .btn,
  .documents-filter-bar a.btn {
    grid-column: span 1;
  }
}
.documents-upload-panel {
  padding: 16px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg, #f8fafc);
}
.documents-upload-form__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
@media (max-width: 900px) {
  .documents-upload-form__grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .documents-upload-form__grid {
    grid-template-columns: 1fr;
  }
}
.documents-upload-form__grid .form-field {
  margin: 0;
}
.documents-upload-form__file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  margin-bottom: 10px;
}
.documents-upload-form__file-row .form-field {
  flex: 1 1 260px;
  margin: 0;
  min-width: 0;
}
.documents-upload-form__actions {
  flex: 0 0 auto;
}
.documents-upload-form__hint {
  margin: 0;
  max-width: 720px;
}
.documents-upload-form__filename-hint {
  display: block;
  margin-top: 4px;
}
.documents-list-empty {
  margin: 0;
}

/* Structured row action toolbar (all tables) */
.table-row-actions,
.doc-row-actions,
.documents-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}
.table-row-actions__main,
.doc-row-actions__main {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}
.table .app-actions:not(.app-actions--custom) {
  vertical-align: middle;
}
.table .app-actions:not(.app-actions--custom) .table-row-actions,
.table .app-actions:not(.app-actions--custom) .doc-row-actions {
  width: 100%;
  justify-content: flex-end;
}
.table-row-actions__form,
.doc-row-actions__form,
.documents-row-actions form {
  margin: 0;
  display: inline-flex;
}
.table-row-actions__btn,
.doc-row-actions__btn {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  max-width: 100%;
}
.table-row-actions__more,
.doc-row-actions__more {
  position: relative;
  flex-shrink: 0;
}
.table-row-actions__more-trigger,
.doc-row-actions__more-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.table-row-actions__more-trigger::-webkit-details-marker,
.doc-row-actions__more-trigger::-webkit-details-marker {
  display: none;
}
.table-row-actions__more-caret,
.doc-row-actions__more-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.72;
}
.table-row-actions__panel,
.doc-row-actions__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 168px;
  padding: 6px;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.table-row-actions__item,
.doc-row-actions__item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.table-row-actions__item:hover,
.table-row-actions__item:focus-visible,
.doc-row-actions__item:hover,
.doc-row-actions__item:focus-visible {
  background: var(--bg);
  text-decoration: none;
  outline: none;
}
.table-row-actions__item--danger,
.doc-row-actions__item--danger {
  color: var(--danger);
}
.table-row-actions__item--danger:hover,
.table-row-actions__item--danger:focus-visible,
.doc-row-actions__item--danger:hover,
.doc-row-actions__item--danger:focus-visible {
  background: #fef2f2;
  color: #b91c1c;
}
.table-row-actions__form--menu,
.doc-row-actions__form--menu {
  display: block;
  width: 100%;
}

/* Ready documents — structured row action toolbar */
.documents-ready-table .documents-row-actions-cell {
  vertical-align: middle;
}
.documents-ready-table .tbl-col--actions-lg {
  width: auto;
  min-width: 200px;
  max-width: none;
}

@media (max-width: 830px) {
  .table.table-app-list > tbody > tr > .app-actions .table-row-actions,
  .table.table-app-list > tbody > tr > .app-actions .doc-row-actions,
  .documents-ready-table .table-row-actions,
  .documents-ready-table .doc-row-actions {
    justify-content: stretch;
    width: 100%;
  }
  .table.table-app-list > tbody > tr > .app-actions .table-row-actions__main,
  .table.table-app-list > tbody > tr > .app-actions .doc-row-actions__main,
  .documents-ready-table .table-row-actions__main,
  .documents-ready-table .doc-row-actions__main {
    flex: 1 1 auto;
    justify-content: flex-start;
  }
  .table.table-app-list > tbody > tr > .app-actions .table-row-actions__panel,
  .table.table-app-list > tbody > tr > .app-actions .doc-row-actions__panel,
  .documents-ready-table .table-row-actions__panel,
  .documents-ready-table .doc-row-actions__panel {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }
  .table.table-app-list > tbody > tr > .app-actions .table-row-actions__more[open],
  .table.table-app-list > tbody > tr > .app-actions .doc-row-actions__more[open],
  .documents-ready-table .table-row-actions__more[open],
  .documents-ready-table .doc-row-actions__more[open] {
    flex: 1 1 100%;
  }
}

/* Agency policies library — room for Preview + Upload + Don't need */
.agency-policies-library-table .tbl-col--actions-lg {
  width: auto;
  min-width: 240px;
  max-width: 320px;
}
#agency-policies-library .documents-row-actions {
  justify-content: flex-start;
}
@media (min-width: 831px) {
  #agency-policies-library .app-actions {
    vertical-align: middle;
  }
}
.documents-signing-panel + .documents-signing-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* === App-list mobile pattern ============================================
   Opt-in via `table-app-list` on a <table>. On phone widths each row
   becomes a card: `app-name` + `app-id` on the title row, labeled
   detail rows (`app-detail` / `app-meta[data-label]`) for every other
   column, and `app-actions` at the bottom. `table-app-list.js` copies
   column headers into `data-label` on load. Desktop layout is untouched. */
@media (max-width: 830px) {
  /* Neutralize the horizontal scroll wrapper for app-list tables so cards
     flow naturally instead of being trapped inside a scroller. */
  .table-scroll:has(> .table.table-app-list) {
    overflow: visible;
    border: 0;
    -webkit-overflow-scrolling: auto;
    overscroll-behavior-x: auto;
  }

  .table.table-app-list,
  .table-scroll > .table.table-app-list {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }
  .table.table-app-list > thead { display: none; }
  .table.table-app-list > tbody { display: block; }

  /* Card surface — matches `.dash-upcoming-card` exactly so all of the
     mobile lists share the same visual language. */
  .table.table-app-list > tbody > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 0;
    padding: 14px 16px;
    margin: 0 0 11px;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    box-sizing: border-box;
    position: static;
    transition:
      border-color 0.15s ease,
      box-shadow 0.15s ease,
      transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .table.table-app-list > tbody > tr:last-child {
    margin-bottom: 0;
  }
  /* Tactile press feedback — same teal-tinted shadow used by the
     upcoming-shift cards on hover. */
  .table.table-app-list > tbody > tr:active {
    transform: scale(0.995);
    box-shadow: 0 2px 10px rgba(20, 184, 166, 0.12);
  }
  /* Respect the [hidden] attribute on rows (e.g. filter empty-state row). */
  .table.table-app-list > tbody > tr[hidden] {
    display: none;
  }

  /* Hide every cell by default — only the explicitly tagged ones show. */
  .table.table-app-list > tbody > tr > td {
    display: none;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
    width: auto;
    min-width: 0;
    max-width: none;
    position: static !important;
    left: auto !important;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Top row, left side — primary title. Mirrors
     `.dash-upcoming-card__date` (bold, slightly tightened tracking). */
  .table.table-app-list > tbody > tr > .app-name {
    grid-row: 1;
    grid-column: 1;
    display: block;
    align-self: center;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text);
  }
  /* Top row, right side — id chip pinned to the trailing edge, the same
     way the status badge sits in `.dash-upcoming-card__head`. */
  .table.table-app-list > tbody > tr > .app-id {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
    min-width: max-content;
    max-width: 45%;
    font-size: 0.85em;
    line-height: 1.2;
    overflow-wrap: normal;
    word-break: normal;
  }
  .table.table-app-list > tbody > tr > .app-id .badge {
    font-size: 0.76rem;
    padding: 4px 9px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    flex-shrink: 0;
  }
  /* Defensive: if a row has no id chip, let the name span the full row. */
  .table.table-app-list > tbody > tr:not(:has(> .app-id)):not(:has(> .app-list-bulk-select)) > .app-name {
    grid-column: 1 / -1;
  }

  /* Bulk-select checkbox — top-right of the card title row (no "Select" label row). */
  .table.table-app-list > tbody > tr > .app-list-bulk-select {
    grid-row: 1;
    grid-column: 2;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
    min-width: 0;
    padding: 0;
    margin: 0;
  }
  .table.table-app-list > tbody > tr:has(> .app-list-bulk-select) > .app-name {
    grid-column: 1;
    padding-right: 8px;
  }

  /* Labeled detail rows — one column header + value per line. */
  .table.table-app-list > tbody > tr > .app-detail,
  .table.table-app-list > tbody > tr > .app-meta[data-label] {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    margin-top: 0;
    padding: 4px 0;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.45;
  }
  .table.table-app-list > tbody > tr > .app-detail::before,
  .table.table-app-list > tbody > tr > .app-meta[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    line-height: 1.45;
  }
  .table.table-app-list > tbody > tr > .app-detail__value {
    display: block;
    min-width: 0;
  }
  /* Divider before the first detail row that follows the title row. */
  .table.table-app-list > tbody > tr > .app-name ~ :is(.app-detail, .app-meta[data-label]):first-of-type {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .table.table-app-list > tbody > tr > :is(.app-detail, .app-meta[data-label]) strong {
    color: var(--text);
    font-weight: 600;
  }
  .table.table-app-list > tbody > tr > :is(.app-detail, .app-meta[data-label]) .badge {
    font-size: 0.74rem;
    padding: 3px 8px;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    flex-shrink: 0;
  }
  /* Unlabeled meta (pre-enrichment fallback) — compact inline chips. */
  .table.table-app-list > tbody > tr > .app-meta:not([data-label]) {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
  }

  /* Action row sits below a hairline divider so the buttons read as a
     distinct affordance shelf rather than competing with the summary. */
  .table.table-app-list > tbody > tr > .app-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .table.table-app-list > tbody > tr > .app-actions form {
    margin: 0;
    display: inline-flex;
  }
  .table.table-app-list > tbody > tr > .app-actions .btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 14px;
    font-size: 0.88rem;
  }
  /* Inline button groups inside the actions cell shouldn't stretch — pull
     them out of their row-flex wrapper so each button stays tight. */
  .table.table-app-list > tbody > tr > .app-actions .row-flex {
    display: contents;
  }

  /* Empty-state / informational rows that span every column should fill the
     card width instead of squeezing into the name slot. */
  .table.table-app-list > tbody > tr > td[colspan] {
    display: block;
    grid-column: 1 / -1;
    grid-row: auto;
  }

  /* Cancel the row-hover background reset that the sticky tables add. */
  .table-scroll > .table.table-app-list tbody tr:hover > td {
    background: transparent !important;
  }

  /* Fallback for scrollable tables without table-app-list — keep columns
     readable via horizontal scroll instead of per-character wrapping. */
  .table-scroll > .table:not(.table-app-list):not(.manual-segments-table),
  .table-wrap > .table:not(.table-app-list),
  .table-wrap > .analytics-table,
  .table-wrap > .data-table {
    width: max-content;
    min-width: 520px;
  }
  .table-scroll > .table:not(.table-app-list):not(.manual-segments-table) th,
  .table-scroll > .table:not(.table-app-list):not(.manual-segments-table) td,
  .table-wrap > .table:not(.table-app-list) th,
  .table-wrap > .table:not(.table-app-list) td,
  .table-wrap > .analytics-table th,
  .table-wrap > .analytics-table td,
  .table-wrap > .data-table th,
  .table-wrap > .data-table td {
    min-width: 72px;
    word-break: normal;
    overflow-wrap: normal;
  }
}

.upcoming-shifts-scroll {
  max-height: min(40vh, 20rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Senior / Family — upcoming visits as scannable cards */
.dash-upcoming-stack {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.dash-upcoming-stack > li {
  margin: 0;
}
.dash-upcoming-card {
  display: block;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--card);
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}
.dash-upcoming-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(20, 184, 166, 0.12);
  text-decoration: none;
  transform: translateY(-1px);
  color: inherit;
}
.dash-upcoming-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.dash-upcoming-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.dash-upcoming-card__date {
  font-weight: 700;
  font-size: 0.94em;
  color: var(--text);
  letter-spacing: -0.01em;
}
.dash-upcoming-card__time {
  font-size: 1.12em;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.dash-upcoming-card__who {
  font-size: 0.9em;
  line-height: 1.45;
  color: var(--muted);
}
.dash-upcoming-card__who strong {
  color: var(--text);
  font-weight: 600;
}
.dash-upcoming-card__unassigned {
  font-style: italic;
}
.dash-upcoming-group__title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dash-upcoming-group__title--spaced {
  margin-top: 16px;
}
.dash-upcoming-card--pending-approval {
  border-left-color: var(--warning);
  background: #fffbeb;
}
.dash-upcoming-card--pending-approval:hover {
  border-color: #f59e0b;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.14);
}
@media (max-width: 830px) {
  .dash-upcoming-card:hover {
    transform: none;
  }
}

.upcoming-shifts-scroll--cards {
  max-height: min(52vh, 28rem);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 0.78em;
  font-weight: 500;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  flex-shrink: 0;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-consider { background: #ffedd5; color: #9a3412; }
.badge-optional-gap { background: #e0e7ff; color: #4338ca; }
.badge-danger { background: #fee2e2; color: #991b1b; }

.caregiver-score-summary { margin-top: 8px; }
.caregiver-score-overall { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.caregiver-score-value { font-size: 1.1rem; }
.badge-info { background: var(--primary-light); color: var(--primary-dark); }
.badge-muted { background: #e2e8f0; color: var(--muted); }

.task-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}
.task-source-badge--shift { background: #ecfdf5; color: #047857; }
.task-source-badge--period { background: #eff6ff; color: var(--primary-dark); }
.task-source-badge--manual { background: #f5f3ff; color: #6d28d9; }

/* Flash messages */
.flash { padding: 11px 16px; border-radius: 6px; margin-bottom: 12px; font-size: 0.92em; }
.flash-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.flash-error { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.flash-info { background: var(--primary-light); color: var(--primary-dark); border-left: 4px solid var(--primary); }
.flash-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }

/* Toasts: flash messages promoted after in-place navigation (page-swap.js) */
.rithma-toast-host {
  position: fixed;
  top: max(12px, calc(var(--rithma-safe-top) + 8px));
  right: max(12px, env(safe-area-inset-right));
  left: max(12px, env(safe-area-inset-left));
  z-index: 10003;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  margin-left: auto;
}
.rithma-toast-host .rithma-toast {
  pointer-events: auto;
  width: 100%;
  max-width: 420px;
  margin-bottom: 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  transform: translateY(-12px) scale(0.98);
  opacity: 0;
  transition:
    opacity 280ms cubic-bezier(0.33, 1, 0.68, 1),
    transform 280ms cubic-bezier(0.33, 1, 0.68, 1);
}
.rithma-toast-host .rithma-toast.rithma-toast--in {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.rithma-toast-host .rithma-toast.rithma-toast--out {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}
@media (max-width: 600px) {
  .rithma-toast-host {
    left: 10px;
    right: 10px;
    align-items: stretch;
    max-width: none;
  }
  .rithma-toast-host .rithma-toast { max-width: none; }
}

/* Calendar */
.month-title {
  font-size: 1.15em;
  font-weight: 600;
  margin: 4px 4px 10px;
  color: var(--text);
}
.calendar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
}
.calendar-month .calendar-weekdays,
.calendar-weekly .calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.calendar-month .calendar-weekdays > div,
.calendar-weekly .calendar-weekdays > div {
  text-align: center;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
}
.calendar-month .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(110px, auto);
  gap: 6px;
}
.calendar-day {
  background: var(--bg);
  padding: 8px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.calendar-day .day-num {
  font-weight: 600;
  font-size: 0.92em;
  margin-bottom: 2px;
  color: var(--text);
}
.calendar-day .day-num-long { display: none; }
.calendar-day.out-of-month { background: transparent; }
.calendar-day.out-of-month .day-num { color: var(--muted); opacity: 0.55; }
.calendar-day.out-of-month .calendar-shift { opacity: 0.55; }
.calendar-day.today { background: var(--primary-light); }
.calendar-day.today .day-num-short {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.82em;
}
.calendar-shift {
  background: white;
  border-left: 3px solid var(--primary);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.74em;
  line-height: 1.25;
  display: block;
  color: var(--text);
  overflow: hidden;
  white-space: normal;
}
.calendar-shift:hover { background: var(--primary-light); text-decoration: none; }
.calendar-shift.upcoming-shift {
  background: #dbeafe;
  border-left-color: var(--primary);
}
.calendar-shift.upcoming-shift:hover { background: #bfdbfe; }
.calendar-shift.past-shift {
  background: #dcfce7;
  border-left-color: var(--success);
}
.calendar-shift.past-shift:hover { background: #bbf7d0; }
.calendar-shift.unassigned { border-left-color: var(--warning); }
.calendar-shift.pending-approval {
  background: #fef3c7;
  border-left-color: var(--warning);
}
.calendar-shift.pending-approval:hover { background: #fde68a; }
.calendar-shift.schedule-change-pending {
  border-left-color: #7c3aed;
  background: #f5f3ff;
}
.calendar-shift.schedule-change-pending:hover { background: #ede9fe; }
.calendar-shift.schedule-cancel-pending {
  border-left-color: #dc2626;
  background: #fef2f2;
}
.calendar-shift.schedule-cancel-pending:hover { background: #fee2e2; }
.calendar-shift.missed,
.calendar-shift.past-shift.missed,
.calendar-shift.upcoming-shift.missed {
  background: #fef2f2;
  border-left-color: #dc2626;
  opacity: 1;
}
.calendar-shift.missed:hover,
.calendar-shift.past-shift.missed:hover,
.calendar-shift.upcoming-shift.missed:hover {
  background: #fee2e2;
}
.badge-schedule-reschedule { background: #ede9fe; color: #5b21b6; }
.pending-schedule-item--cancel {
  border-left: 3px solid #dc2626;
  padding-left: 12px;
  margin-left: -2px;
}
.pending-schedule-item--new-visit {
  border-left: 3px solid var(--primary, #2563eb);
  padding-left: 12px;
  margin-left: -2px;
}
.calendar-shift-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.calendar-shift-link:hover { text-decoration: none; }

/* Schedule change request — trigger buttons + modal */
.schedule-change-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 14px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 100%);
  color: #6d28d9;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  flex-wrap: wrap;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.schedule-change-btn:hover {
  background: #ede9fe;
  border-color: rgba(109, 40, 217, 0.5);
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.12);
}
.schedule-change-btn:active {
  transform: scale(0.98);
}
.schedule-change-btn__icon {
  flex-shrink: 0;
  display: block;
}
.schedule-change-btn span {
  min-width: 0;
  text-align: center;
}
.schedule-change-btn--inline {
  margin-top: 6px;
  width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.72);
}
.schedule-change-btn--inline:hover {
  background: #fff;
}
.page-header .schedule-change-btn {
  min-width: 0;
  max-width: 100%;
}
.schedule-change-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, calc(var(--rithma-safe-top) + 8px)) max(16px, var(--rithma-safe-right))
    max(16px, var(--rithma-safe-bottom)) max(16px, var(--rithma-safe-left));
}
.schedule-change-modal[open] {
  display: flex;
}
.schedule-change-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
}
.schedule-change-modal__panel {
  position: relative;
  width: min(100%, 480px);
  max-height: min(92vh, 720px);
  overflow: auto;
  border-radius: 14px;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  padding: 18px 18px 16px;
}
.schedule-change-modal__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.schedule-change-modal__header-text {
  flex: 1 1 auto;
  min-width: 0;
}
.schedule-change-modal__title {
  margin: 0 0 4px;
  font-size: 1.15rem;
}
.schedule-change-modal__lead {
  margin: 0;
}
.schedule-change-modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.schedule-change-modal__close:hover {
  background: rgba(15, 23, 42, 0.06);
}
.schedule-change-modal__context {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f3ff;
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: #5b21b6;
}
.schedule-change-type-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.schedule-change-type-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.92rem;
  line-height: 1.35;
  cursor: pointer;
}
.schedule-change-type-option input {
  margin-top: 3px;
}
.schedule-change-modal__form .form-field:last-of-type {
  margin-bottom: 0;
}
.schedule-change-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
html.schedule-change-modal-open,
html.schedule-change-modal-open body {
  overflow: hidden;
}

.schedule-change-split-dialog {
  border: none;
  padding: 0;
  width: min(calc(100vw - 24px), 760px);
  max-width: min(calc(100vw - 24px), 760px);
  margin: auto;
  background: transparent;
  color: var(--text, #0f172a);
  overflow: visible;
}
.schedule-change-split-dialog.schedule-change-split-dialog--manual {
  width: min(calc(100vw - 24px), 820px);
  max-width: min(calc(100vw - 24px), 820px);
}
.schedule-change-split-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}
.schedule-change-split-dialog__surface {
  width: 100%;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  overflow: visible;
  max-height: none;
  display: flex;
  flex-direction: column;
}
.schedule-change-split-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card, #fff);
  overflow-y: auto;
  overflow-x: visible;
  max-height: min(calc(92vh - 170px), 520px);
  -webkit-overflow-scrolling: touch;
}
.schedule-change-split-dialog--manual .schedule-change-split-dialog__body {
  overflow: visible;
  max-height: none;
}
.schedule-change-split-dialog--manual .schedule-change-split-dialog__surface {
  max-height: none;
  overflow: visible;
}
.schedule-change-split-dialog__lead {
  margin: 0;
  line-height: 1.45;
}
.schedule-change-split-equal,
.schedule-change-split-manual {
  background: var(--bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  overflow: visible;
}
.schedule-change-split-manual__help {
  margin: 0 0 10px;
  line-height: 1.45;
}
.schedule-change-split-manual__table-wrap {
  overflow: visible;
}
.schedule-change-split-manual .manual-segments-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.schedule-change-split-manual .manual-segments-table th:first-child,
.schedule-change-split-manual .manual-segments-table td:first-child {
  width: 2.25rem;
}
.schedule-change-split-manual .manual-segments-table th:nth-child(2),
.schedule-change-split-manual .manual-segments-table th:nth-child(3),
.schedule-change-split-manual .manual-segments-table td:nth-child(2),
.schedule-change-split-manual .manual-segments-table td:nth-child(3) {
  width: calc((100% - 2.25rem) / 2);
}
.schedule-change-split-manual .tp-wrap {
  display: block;
  width: 100%;
  margin-top: 0;
}
.schedule-change-split-manual .tp-display {
  width: 100%;
  min-width: 0;
}
.schedule-change-split-manual__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.schedule-change-split-manual input[type="time"] {
  position: relative;
  z-index: 1;
  min-width: 7.5rem;
}
.schedule-change-split-manual input[type="time"]:focus {
  z-index: 30;
}
.schedule-change-split-dialog--manual:has(input[type="time"]:focus) {
  overflow: visible;
}
.schedule-change-split-dialog--manual:has(input[type="time"]:focus) .schedule-change-split-dialog__surface,
.schedule-change-split-dialog--manual:has(input[type="time"]:focus) .schedule-change-split-dialog__body,
.schedule-change-split-dialog--manual:has(input[type="time"]:focus) .schedule-change-split-manual,
.schedule-change-split-dialog--manual:has(input[type="time"]:focus) .schedule-change-split-manual__table-wrap {
  overflow: visible;
}
.schedule-change-split-preview__heading {
  margin: 0 0 8px;
  font-weight: 600;
}
.schedule-change-split-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.schedule-change-split-preview__item {
  display: grid;
  grid-template-columns: 5.5rem 7.5rem 1fr;
  gap: 8px 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--border, #e2e8f0);
  line-height: 1.4;
}
.schedule-change-split-preview__item:first-child {
  border-top: 0;
  padding-top: 0;
}
.schedule-change-split-preview__label {
  font-weight: 600;
}
.schedule-change-split-preview__date {
  color: var(--muted, #64748b);
  font-size: 0.88rem;
}
.schedule-change-split-preview__time {
  font-variant-numeric: tabular-nums;
}
.schedule-change-split-preview__overnight {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--muted, #64748b);
}
.schedule-change-split-mode {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schedule-change-split-mode__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.schedule-change-split-mode__option:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(239, 246, 255, 0.7);
}
.schedule-change-split-mode__option input {
  margin-top: 3px;
}
.schedule-change-split-table input[type="time"] {
  width: 100%;
  min-width: 7.5rem;
}
.schedule-change-split-dialog__error {
  margin: 0;
  color: #b91c1c;
}

.calendar-shift.in-progress { border-left-color: var(--success); }
.calendar-shift.completed { border-left-color: var(--muted); opacity: 0.7; }
.calendar-shift .time { font-weight: 600; }
.calendar-shift--overnight .time::after {
  content: " · overnight";
  font-weight: 500;
  font-size: 0.85em;
  color: var(--muted);
}
.calendar-shift .name { color: var(--muted); font-size: 0.95em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-shift__status {
  color: #92400e;
  font-size: 0.85em;
  font-weight: 600;
  margin-top: 2px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.calendar-month-empty {
  display: none;
  margin: 0;
  padding: 18px 14px;
  text-align: center;
  line-height: 1.45;
}
.calendar-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 4px 12px;
}

.weekly-cal-scroll {
  overflow: auto;
  max-height: calc(100vh - 220px);
}
.calendar-weekly {
  min-width: 900px;
}
.weekly-cal-matrix {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.weekly-cal-matrix-header {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--card);
  padding-bottom: 2px;
}
.weekly-cal-matrix-row {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 6px;
  align-items: stretch;
}
.weekly-cal-weekdays {
  margin-bottom: 0;
}
.weekly-cal-weekday-name {
  display: block;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.weekly-cal-weekday-date {
  display: block;
  font-size: 0.82em;
  color: var(--muted);
  margin-top: 2px;
}
.weekly-cal-weekday-date--today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
}
.weekly-cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-weekly .calendar-day {
  min-height: 92px;
}
.weekly-cal-day-cell--drop-target {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
}
.weekly-cal-day-cell--drop-unavailable {
  outline-color: var(--danger, #dc2626);
  background: rgba(220, 38, 38, 0.08);
}
.weekly-cal-day-cell--drop-copy {
  outline-style: solid;
}
.weekly-cal-day-cell--drop-choice {
  outline-style: dotted;
}
[data-calendar-cell-add-shift] .weekly-cal-day-cell,
[data-calendar-cell-add-shift] .calendar-grid .calendar-day[data-cal-day] {
  cursor: pointer;
}
.weekly-cal-move-copy-dialog__actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.weekly-cal-shift--draggable {
  cursor: grab;
  touch-action: none;
}
.weekly-cal-shift--draggable:active {
  cursor: grabbing;
}
.weekly-cal-shift--dragging {
  opacity: 0.55;
}
.weekly-cal-day-label {
  display: none;
  font-weight: 600;
  font-size: 0.92em;
  margin-bottom: 4px;
  color: var(--text);
}
.weekly-cal-client-col {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  padding: 10px 8px 8px 0;
  font-weight: 600;
  background: var(--card);
}
.weekly-cal-client-col--header {
  padding-top: 4px;
}
.weekly-cal-client-col a {
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
}
.weekly-cal-client-col a:hover {
  color: var(--primary);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .calendar-weekly {
    min-width: 0;
  }
  .weekly-cal-matrix-header {
    display: none;
  }
  .weekly-cal-matrix-row {
    grid-template-columns: 1fr;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    background: var(--bg);
  }
  .weekly-cal-client-col {
    position: static;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }
  .weekly-cal-week-grid {
    grid-template-columns: 1fr;
  }
  .calendar-weekly .calendar-day {
    min-height: auto;
  }
  .weekly-cal-day-label {
    display: block;
  }
  .calendar-weekly .calendar-day:not(:has(.calendar-shift)) {
    display: none;
  }
}

@media (max-width: 900px) {
  .calendar-month .calendar-weekdays { display: none; }
  .calendar-month .calendar-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .calendar-day { min-height: auto; }
  .calendar-day.out-of-month { display: none; }
  .calendar-day:not(:has(.calendar-shift)) { display: none; }
  .calendar-month--empty .calendar-grid {
    display: none;
  }
  .calendar-month--empty .calendar-month-empty {
    display: block;
  }
  .calendar-day .day-num-short { display: none; }
  .calendar-day .day-num-long { display: inline; }
  .calendar-day.today .day-num-long {
    background: var(--primary);
    color: white;
    border-radius: 999px;
    padding: 2px 10px;
  }
  .calendar-shift { white-space: normal; font-size: 0.85em; }
}

/* Daily scheduler (agency) */
.scheduler-page { max-width: 1100px; margin: 0 auto; }
.scheduler-page-header {
  align-items: flex-start;
}
.scheduler-page-heading { min-width: min(100%, 340px); }
.scheduler-page-heading h1 { margin-bottom: 6px; font-size: 1.75em; letter-spacing: -0.02em; }
.scheduler-page-sub { margin: 0; font-size: 0.95em; line-height: 1.45; }
.scheduler-page-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.scheduler-optimize-progress {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
}
.scheduler-optimize-progress[hidden] {
  display: none !important;
}
.scheduler-optimize-progress__spinner {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 2px solid #93c5fd;
  border-top-color: var(--primary, #2563eb);
  border-radius: 999px;
  animation: assessment-discharge-spin 0.75s linear infinite;
}
.scheduler-optimize-progress__title {
  margin: 0 0 4px;
  font-weight: 600;
  color: #1e3a8a;
  font-size: 0.95rem;
}
.scheduler-optimize-progress__text {
  margin: 0;
  line-height: 1.45;
}
.scheduler-optimize-reason--change {
  font-size: 0.875rem;
  font-weight: 500;
}
.scheduler-optimize-table .scheduler-optimize-row--change td {
  background: rgba(59, 130, 246, 0.06);
}

/* Smart Schedule — 2-week plan builder */
.scheduler-plan-header .scheduler-plan-lead {
  max-width: 42rem;
  margin: 0;
  line-height: 1.5;
}
.scheduler-plan-toolbar {
  margin-bottom: 16px;
  padding: 16px 18px;
}
.scheduler-plan-toolbar__form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 18px;
}
.scheduler-plan-toolbar__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.scheduler-plan-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scheduler-plan-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: min(100%, 180px);
}
.scheduler-plan-field__label {
  font-size: 0.78em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.scheduler-plan-period {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.scheduler-plan-empty-state {
  margin-bottom: 16px;
  padding: 22px 20px;
  text-align: center;
}
.scheduler-plan-empty-state__text {
  margin: 0 0 8px;
  line-height: 1.5;
}
.scheduler-plan-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px 20px;
}
.scheduler-plan-progress__title {
  margin: 0 0 4px;
  font-weight: 600;
}
.scheduler-plan-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.scheduler-plan-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 10px;
}
.scheduler-plan-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.scheduler-plan-stat--warn .scheduler-plan-stat__value { color: var(--warning); }
.scheduler-plan-stat--ok .scheduler-plan-stat__value { color: #059669; }
.scheduler-plan-stat--muted .scheduler-plan-stat__value { color: var(--muted); }
.scheduler-plan-stat__value {
  display: block;
  font-size: 1.45em;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.15;
}
.scheduler-plan-stat__label {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.scheduler-plan-main {
  width: 100%;
}
.scheduler-plan-insight {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.07) 0%, rgba(255, 255, 255, 0) 42%),
    var(--card);
  box-shadow: var(--shadow);
}
.scheduler-plan-insight::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed 55%, #2563eb);
}
.scheduler-plan-insight__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.scheduler-plan-insight__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
  flex-shrink: 0;
}
.scheduler-plan-insight__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}
.scheduler-plan-insight__subtitle {
  margin: 4px 0 0;
}
.scheduler-plan-insight__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.scheduler-plan-insight-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.scheduler-plan-insight-chip--ok {
  background: #d1fae5;
  color: #065f46;
}
.scheduler-plan-insight-chip--warn {
  background: #ffedd5;
  color: #9a3412;
}
.scheduler-plan-insight-chip--alert {
  background: #fee2e2;
  color: #991b1b;
}
.scheduler-plan-insight-chip--neutral {
  background: #f1f5f9;
  color: #475569;
}
.scheduler-plan-insight__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.scheduler-plan-insight__para {
  margin: 0;
  line-height: 1.6;
  color: var(--text);
}
.scheduler-plan-insight__para--lead {
  font-size: 1.02em;
  font-weight: 500;
  color: var(--text);
}
.scheduler-plan-insight__callout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92em;
  line-height: 1.45;
}
.scheduler-plan-insight__callout strong {
  font-size: 0.95em;
}
.scheduler-plan-insight__callout--warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #92400e;
}
.scheduler-plan-insight__callout--ok {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #065f46;
}
.scheduler-plan-runs {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scheduler-plan-runs--inline {
  flex-direction: row;
  flex-wrap: wrap;
}
.scheduler-plan-runs--inline .scheduler-plan-run {
  flex: 1 1 min(100%, 220px);
  max-width: 100%;
}
.scheduler-plan-run {
  margin: 0;
}
.scheduler-plan-run a {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.scheduler-plan-run a:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.04);
}
.scheduler-plan-run__dates {
  display: block;
  font-weight: 600;
  font-size: 0.92em;
}
.scheduler-plan-run__meta {
  display: block;
  margin-top: 2px;
  font-size: 0.82em;
  color: var(--muted);
}
.scheduler-plan-run__meta--published { color: #059669; }
.scheduler-plan-main__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.scheduler-plan-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.scheduler-plan-table-toolbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.scheduler-plan-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.scheduler-plan-sort__label {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--muted);
}
.scheduler-plan-assign-select {
  min-width: 160px;
  max-width: 220px;
}
.scheduler-plan-time-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.scheduler-plan-time-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 88px;
}
.scheduler-plan-time-field__label {
  font-size: 0.72em;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.scheduler-plan-time-input {
  min-width: 0;
  width: 100%;
}
.scheduler-plan-table .scheduler-plan-row--edited td {
  box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.55);
}
.scheduler-plan-edited-badge {
  margin-left: 6px;
  font-size: 0.75em;
}
.scheduler-plan-edits {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(37, 99, 235, 0.04);
  border: 1px solid rgba(37, 99, 235, 0.12);
}
.scheduler-plan-edits__title {
  margin: 0 0 6px;
  font-size: 1rem;
}
.scheduler-plan-edits__list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.scheduler-plan-edits__item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
}
.scheduler-plan-edits__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.scheduler-plan-edits__detail {
  font-size: 0.92em;
  line-height: 1.45;
}
.card--nested {
  box-shadow: none;
}
.scheduler-plan-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.scheduler-plan-filter {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.scheduler-plan-filter:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.scheduler-plan-filter.is-active {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}
.scheduler-plan-table .scheduler-plan-row--new td { background: rgba(16, 185, 129, 0.04); }
.scheduler-plan-table .scheduler-plan-row--reassign td { background: rgba(245, 158, 11, 0.06); }
.scheduler-plan-table tr.is-filtered-out { display: none; }

/* Smart Schedule proposals table — readable columns on desktop, card rows on phone. */
.table-scroll > .table.scheduler-plan-table {
  min-width: 880px;
}
.table-scroll > .table.scheduler-plan-table .tbl-col--pick {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
}
.table-scroll > .table.scheduler-plan-table .scheduler-plan-col--type,
.table-scroll > .table.scheduler-plan-table .scheduler-plan-col--when,
.table-scroll > .table.scheduler-plan-table .scheduler-plan-col--client {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
.table-scroll > .table.scheduler-plan-table .scheduler-plan-col--assignment {
  min-width: 180px;
}
.table-scroll > .table.scheduler-plan-table .scheduler-plan-col--reason {
  white-space: normal;
  line-height: 1.45;
}

@media (max-width: 830px) {
  .table-scroll:has(> .table.scheduler-plan-table) {
    overflow: visible;
    border: 0;
    -webkit-overflow-scrolling: auto;
    overscroll-behavior-x: auto;
  }

  .table.scheduler-plan-table,
  .table-scroll > .table.scheduler-plan-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border: 0;
    background: transparent;
  }
  .table.scheduler-plan-table > thead { display: none; }
  .table.scheduler-plan-table > tbody { display: block; }

  .table.scheduler-plan-table > tbody > tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
    padding: 14px 16px;
    margin: 0 0 11px;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    box-sizing: border-box;
  }
  .table.scheduler-plan-table > tbody > tr:last-child { margin-bottom: 0; }
  .table.scheduler-plan-table > tbody > tr.is-filtered-out { display: none; }

  .table.scheduler-plan-table > tbody > tr > td {
    display: none;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
    width: auto;
    min-width: 0;
    max-width: none;
    position: static !important;
    left: auto !important;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .table.scheduler-plan-table > tbody > tr > .scheduler-plan-col--pick {
    grid-row: 1;
    grid-column: 1;
    display: flex;
    align-items: center;
    align-self: center;
  }
  .table.scheduler-plan-table > tbody > tr > .app-name {
    grid-row: 1;
    grid-column: 2;
    display: block;
    align-self: center;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .table.scheduler-plan-table > tbody > tr > .app-id {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }
  .table.scheduler-plan-table > tbody > tr > .app-id .badge {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }

  .table.scheduler-plan-table > tbody > tr > .app-meta[data-label] {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    margin-top: 0;
    padding: 4px 0;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.45;
  }
  .table.scheduler-plan-table > tbody > tr > .app-meta[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    line-height: 1.45;
  }
  .table.scheduler-plan-table > tbody > tr > .app-name ~ .app-meta[data-label]:first-of-type {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .table.scheduler-plan-table .scheduler-plan-assign-select {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
  .table.scheduler-plan-table .scheduler-plan-time-edit {
    width: 100%;
  }
}

.scheduler-plan-skipped {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.scheduler-plan-skipped h3 {
  margin: 0 0 6px;
  font-size: 0.95em;
}
.scheduler-plan-empty {
  margin: 0;
  padding: 28px 12px;
  text-align: center;
}

.scheduler-date-banner {
  background: linear-gradient(145deg, #ffffff 0%, var(--primary-light) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.scheduler-date-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
}
.scheduler-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.scheduler-nav-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  text-decoration: none;
}
.scheduler-date-center { flex: 1; max-width: 420px; text-align: center; }
.scheduler-date-label {
  display: block;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.scheduler-date-value-wrap { position: relative; display: inline-block; width: 100%; max-width: 320px; }
.scheduler-headline-date {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  display: block;
  padding-right: 42px;
  pointer-events: none;
}
.scheduler-date-value-wrap { cursor: pointer; }
.scheduler-date-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.scheduler-date-value-wrap::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center/18px no-repeat;
  border: 1px solid var(--border);
  pointer-events: none;
}
.scheduler-date-help { margin: 10px 0 0; font-size: 0.85em; }

.scheduler-quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(37, 99, 235, 0.12);
}
.scheduler-today-btn {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}
.scheduler-today-btn:hover { background: var(--bg); }
.scheduler-today-btn,
.scheduler-add-primary {
  padding-left: 22px;
  padding-right: 22px;
  font-weight: 600;
  font-size: 0.95em;
}
.scheduler-add-form-actions {
  margin-top: 20px;
}

.scheduler-continuity-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-left: 3px solid #b45309;
}

.scheduler-stats {
  display: grid;
  grid-template-columns: repeat(var(--scheduler-stat-cols, 4), minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.scheduler-stats-focus {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.scheduler-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.scheduler-stat--warn .scheduler-stat-value { color: var(--warning); }
.scheduler-stat-value {
  display: block;
  font-size: 1.65em;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.15;
}
.scheduler-stat-label {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Scheduler sub-views (Schedule vs Duplicate visits) */
.scheduler-subtabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px;
  margin: 0 0 18px;
  padding: 0 2px;
  border-bottom: 1px solid var(--border);
}
.scheduler-subtab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin-bottom: -1px;
  border-radius: 8px 8px 0 0;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.scheduler-subtab:hover {
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary);
}
.scheduler-subtab--active {
  border-bottom-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
  background: rgba(37, 99, 235, 0.04);
}
.scheduler-subtab-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
  animation: scheduler-clipboard-pulse 2s ease-in-out infinite;
}

.scheduler-period-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.scheduler-period-row label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.scheduler-source-period {
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}
.scheduler-paste-live {
  min-height: 1.25em;
  margin: 10px 0 0;
}

/* ----- Scheduler copy & paste (interactive) ----- */
.scheduler-copy-panel {
  overflow: hidden;
  margin-bottom: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.04) 0%, var(--card) 42%, var(--card) 100%);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}
.scheduler-copy-panel-inner {
  padding: 18px 20px 22px;
}
.scheduler-copy-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.scheduler-copy-panel-head-text h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.scheduler-copy-badge-dot {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  animation: scheduler-clipboard-pulse 2s ease-in-out infinite;
}
.scheduler-copy-panel-head--empty .scheduler-copy-badge-dot {
  background: var(--muted);
  box-shadow: none;
  animation: none;
}
@keyframes scheduler-clipboard-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.92); }
}
.scheduler-copy-lead {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.45;
  color: var(--muted);
  max-width: 52ch;
}
.scheduler-copy-grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 920px) {
  .scheduler-copy-grid-2col {
    grid-template-columns: 1fr;
  }
}
.scheduler-duplicate-single-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 920px) {
  .scheduler-duplicate-single-grid {
    grid-template-columns: 1fr;
  }
}
.scheduler-copy-column,
.scheduler-paste-column {
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--card);
  min-height: 100%;
  box-sizing: border-box;
}
.scheduler-copy-column {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.scheduler-paste-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.scheduler-paste-column--ready {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08), 0 8px 24px rgba(37, 99, 235, 0.08);
}
.scheduler-field-legend {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 10px;
  padding: 0;
}
.scheduler-scope-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.scheduler-scope-chip {
  position: relative;
  cursor: pointer;
  margin: 0;
}
.scheduler-scope-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.scheduler-scope-chip span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.scheduler-scope-chip:hover span {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.05);
}
.scheduler-scope-chip input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.scheduler-scope-chip input:checked + span {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.scheduler-scope-chip-icon {
  font-size: 1.1em;
  line-height: 1;
  opacity: 0.9;
}
.scheduler-shift-pick {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: opacity 0.2s, max-height 0.25s ease;
  max-height: 280px;
  opacity: 1;
}
.scheduler-shift-pick[hidden] {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  pointer-events: none;
}
.scheduler-shift-pick label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.scheduler-select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.92rem;
  background: var(--card);
  color: var(--text);
}
.scheduler-copy-row {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.scheduler-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.scheduler-switch-row .scheduler-switch-caption {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.scheduler-switch {
  position: relative;
  width: 44px;
  max-width: 44px;
  height: 24px;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.scheduler-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.scheduler-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.2s;
  cursor: pointer;
}
.scheduler-switch-slider::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}
.scheduler-switch input:checked + .scheduler-switch-slider {
  background: var(--primary);
}
.scheduler-switch input:checked + .scheduler-switch-slider::after {
  transform: translateX(20px);
}
.scheduler-switch input:focus-visible + .scheduler-switch-slider {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.rithma-minical {
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--card);
  box-sizing: border-box;
  user-select: none;
}
.rithma-minical-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.rithma-minical-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  flex: 1;
  text-align: center;
}
.rithma-minical-nav {
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--text);
  flex: 0 0 auto;
}
.rithma-minical-nav:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.35);
}
.rithma-minical-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}
.rithma-minical-weekdays > span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  padding: 4px 0;
}
.rithma-minical-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.rithma-minical-cell {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 0;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.rithma-minical-cell:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.06);
}
.rithma-minical-cell.is-other {
  color: var(--muted);
  opacity: 0.55;
}
.rithma-minical-cell.is-in-range {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--text);
}
.rithma-minical-cell.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}
.rithma-minical-cell.is-disabled,
.rithma-minical-cell:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.rithma-minical-cell:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.scheduler-copy-preview {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.07);
  border: 1px dashed rgba(37, 99, 235, 0.28);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  min-height: 3.2em;
  margin-bottom: 14px;
}
.scheduler-copy-preview strong {
  color: var(--primary);
}
.scheduler-copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn.scheduler-copy-submit {
  font-weight: 600;
  padding-left: 20px;
  padding-right: 20px;
}
.scheduler-paste-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 12px;
  min-height: 160px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  background: rgba(15, 23, 42, 0.02);
}
.scheduler-paste-placeholder-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.65;
}
.scheduler-paste-ready-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.scheduler-paste-ready-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.scheduler-paste-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}
.scheduler-paste-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.scheduler-paste-date-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  flex: 1 1 180px;
}
.scheduler-paste-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.scheduler-paste-quick button {
  padding: 6px 11px;
  font-size: 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.scheduler-paste-quick button:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}
.scheduler-paste-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.btn.scheduler-paste-btn {
  font-weight: 700;
  padding-left: 22px;
  padding-right: 22px;
}
.scheduler-paste-clear {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
}
.scheduler-paste-clear:hover {
  color: var(--text);
}

.scheduler-shifts-card { padding-top: 20px; }
.scheduler-shifts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.scheduler-shifts-title { margin: 0; font-size: 1.15rem; font-weight: 600; }
.scheduler-shifts-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.scheduler-shift-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.scheduler-shift-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(to bottom, #ffffff, #fafbff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.scheduler-shift-card:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.scheduler-shift-card--upcoming {
  border-left: 4px solid var(--primary);
  background: #ffffff;
}
.scheduler-shift-card--past {
  border-left: 4px solid var(--success);
  background: #ffffff;
}
.scheduler-shift-card--unassigned {
  border-left: 4px solid var(--warning);
}
.scheduler-shift-card--pending {
  border-left: 4px solid var(--warning);
  background: #ffffff;
}

.scheduler-shift-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1 1 280px;
  min-width: 0;
}
.scheduler-shift-timeblock {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 88px;
  max-width: 88px;
  max-height: 5.5rem;
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  text-align: center;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.scheduler-shift-time-start,
.scheduler-shift-time-end {
  display: block;
  font-weight: 700;
  font-size: 0.95em;
}
.scheduler-shift-time-sep {
  display: block;
  font-size: 0.7em;
  opacity: 0.7;
  line-height: 1.2;
}
.scheduler-shift-body { min-width: 0; flex: 1; }
.scheduler-shift-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.scheduler-shift-client {
  font-size: 1.08em;
  font-weight: 600;
  color: var(--text);
}
.scheduler-shift-id { font-weight: 400; }
.scheduler-shift-status { margin-left: auto; }

.scheduler-shift-assign-row { margin-top: 2px; }
.scheduler-assign-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
}
.scheduler-assign-pill--ok {
  background: #ecfdf5;
  color: #047857;
}
.scheduler-assign-icon { font-size: 0.85em; }
.scheduler-assign-pill--warn {
  background: #fff7ed;
  color: #c2410c;
  font-weight: 500;
}

.scheduler-shift-actions {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  overflow: visible;
}
.scheduler-assign-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.scheduler-assign-score-hint {
  margin: 0 0 12px;
  font-size: 0.82em;
  line-height: 1.4;
}
.scheduler-cg-picker {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
  max-width: 100%;
}
.scheduler-cg-picker--open {
  z-index: 50;
}
.table-scroll:has(.scheduler-cg-picker--open),
.manual-seg-panel .table-scroll:has(.scheduler-cg-picker--open),
.manual-seg-panel:has(.scheduler-cg-picker--open),
.side-panel:has(.scheduler-cg-picker--open),
.side-panel__body:has(.scheduler-cg-picker--open) {
  overflow: visible;
}
.side-panel .scheduler-cg-picker--open {
  z-index: 5;
}
.side-panel .scheduler-cg-picker-menu {
  z-index: 6;
}
.scheduler-cg-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 10px 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.9em;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.scheduler-cg-picker-trigger:hover {
  border-color: #cbd5e1;
}
.scheduler-cg-picker-trigger:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.scheduler-cg-picker--open .scheduler-cg-picker-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.scheduler-cg-picker-trigger-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.scheduler-cg-picker-name {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.scheduler-cg-picker-chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted, #64748b);
  transition: transform 0.15s ease;
}
.scheduler-cg-picker--open .scheduler-cg-picker-chevron {
  transform: rotate(180deg);
}
.scheduler-cg-picker-score {
  display: inline-flex;
  align-items: stretch;
  justify-content: center;
  flex-shrink: 0;
  gap: 8px;
  min-width: 7.25rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-light, #e8f0fe);
  color: var(--primary, #2563eb);
}
.scheduler-cg-picker-score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  gap: 1px;
}
.scheduler-cg-picker-score-lbl {
  font-size: 0.62em;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--muted, #64748b);
}
.scheduler-cg-picker-score-lbl--weekly {
  text-transform: none;
  font-size: 0.55em;
  letter-spacing: 0;
  line-height: 1.05;
  max-width: 2.6rem;
  white-space: normal;
  text-align: center;
}
.scheduler-cg-picker-score-val {
  font-size: 0.88em;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.scheduler-cg-picker-score--none {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4em;
  padding: 4px 8px;
  font-size: 0.82em;
  font-weight: 600;
  background: var(--bg, #f1f5f9);
  color: var(--text-muted, #94a3b8);
}
.scheduler-cg-picker-score--poor .scheduler-cg-picker-score-val {
  color: #b91c1c;
}
.scheduler-cg-picker-score--poor {
  background: #fef2f2;
}
.scheduler-cg-picker-score-col--weekly {
  padding: 2px 6px;
  border-radius: 5px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  min-width: 2.4rem;
}
.scheduler-cg-picker-score-col--weekly .scheduler-cg-picker-score-lbl,
.scheduler-cg-picker-score-col--weekly .scheduler-cg-picker-score-val {
  color: #15803d;
  font-weight: 700;
}
.scheduler-cg-picker-score-col--over-weekly {
  background: #fee2e2;
  border-color: #f87171;
}
.scheduler-cg-picker-score-col--over-weekly .scheduler-cg-picker-score-lbl,
.scheduler-cg-picker-score-col--over-weekly .scheduler-cg-picker-score-val {
  color: #991b1b;
}
.scheduler-cg-picker-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(280px, 50vh);
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.migration-mapping-row--needs-attention td:first-child {
  background: #fffbeb;
}
.migration-mapping-table select {
  min-width: 12rem;
}
.scheduler-cg-picker-section {
  padding: 6px 8px 4px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}
.scheduler-cg-picker-status {
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 8px;
  font-size: 0.78em;
  line-height: 1.4;
}
.scheduler-cg-picker-status--refreshing {
  background: #f0f9ff;
  color: #0369a1;
}
.scheduler-cg-picker-status--stale {
  background: #fffbeb;
  color: #92400e;
}
.scheduler-cg-picker-option {
  display: grid;
  grid-template-columns: minmax(5.75rem, auto) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  gap: 4px 12px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.9em;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
.scheduler-cg-picker-option .scheduler-cg-picker-score,
.scheduler-cg-picker-option [data-picker-score] {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}
.scheduler-cg-picker-option:has(.scheduler-cg-picker-option-note) .scheduler-cg-picker-score,
.scheduler-cg-picker-option:has(.scheduler-cg-picker-option-note) [data-picker-score] {
  grid-row: 1 / -1;
}
.scheduler-cg-picker-option-name {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 500;
  line-height: 1.3;
}
.scheduler-cg-picker-option-note {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.78em;
  color: var(--muted, #64748b);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.scheduler-cg-picker-option:not(:has(.scheduler-cg-picker-option-note)) {
  grid-template-rows: auto;
  align-items: center;
}
.scheduler-cg-picker-option:hover:not([aria-disabled="true"]) {
  background: var(--bg, #f8fafc);
}
.scheduler-cg-picker-option--selected:not([aria-disabled="true"]) {
  background: var(--primary-light, #eff6ff);
}
.scheduler-cg-picker-option--disabled,
.scheduler-cg-picker-option[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.scheduler-cg-picker-menu--above:not(.scheduler-cg-picker-menu--fixed) {
  top: auto;
  bottom: calc(100% + 4px);
}
.scheduler-cg-picker-menu--fixed {
  position: fixed;
  z-index: 200;
  left: 16px;
  right: 16px;
  width: auto;
  top: auto;
  bottom: auto;
}
@media (max-width: 830px) {
  .scheduler-cg-picker-trigger {
    min-height: 44px;
    padding: 8px 12px 8px 10px;
  }
  .scheduler-cg-picker-option {
    min-height: 44px;
    padding: 10px 12px;
  }
  .scheduler-cg-picker-menu {
    max-height: min(320px, 45vh);
  }
}

/* Branch admin — client assign picker */
.branch-clients-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.branch-clients-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.branch-clients-panel__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.branch-clients-panel__empty {
  margin: 0 0 12px;
}
.branch-assigned-clients {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.branch-assigned-client {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
}
.branch-assigned-client__name {
  font-size: 0.9em;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.branch-assigned-client__remove {
  margin: 0;
  flex-shrink: 0;
}
.branch-assign-form {
  margin-top: 4px;
}
.branch-assign-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.branch-assign-form__submit {
  flex-shrink: 0;
}
.branch-assign-form__hint {
  margin: 8px 0 0;
  line-height: 1.45;
}
.branch-client-picker {
  position: relative;
  flex: 1 1 280px;
  min-width: min(100%, 280px);
  max-width: 100%;
}
.branch-client-picker > .branch-client-picker__field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82em;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.branch-client-picker--open {
  z-index: 50;
}
.branch-client-picker__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  font-size: 0.9em;
  color: var(--text, #0f172a);
  cursor: pointer;
  text-align: left;
}
.branch-client-picker__trigger:hover {
  border-color: #cbd5e1;
}
.branch-client-picker__trigger:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px var(--primary-light, #e8f0fe);
}
.branch-client-picker--open .branch-client-picker__trigger {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px var(--primary-light, #e8f0fe);
}
.branch-client-picker__value--placeholder {
  color: var(--muted, #64748b);
}
.branch-client-picker__chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted, #64748b);
  transition: transform 0.15s ease;
}
.branch-client-picker--open .branch-client-picker__chevron {
  transform: rotate(180deg);
}
.branch-client-picker__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(300px, 50vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.branch-client-picker__search-wrap {
  padding: 2px 2px 6px;
  flex-shrink: 0;
}
.branch-client-picker__search {
  width: 100%;
  min-height: 36px;
}
.branch-client-picker__list {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.branch-client-picker__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.9em;
  text-align: left;
  cursor: pointer;
  color: var(--text, #0f172a);
}
.branch-client-picker__option:hover {
  background: var(--bg, #f8fafc);
}
.branch-client-picker__option--selected {
  background: var(--primary-light, #eff6ff);
}
.branch-client-picker__option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.branch-client-picker__option-meta {
  flex-shrink: 0;
  font-size: 0.78em;
  color: var(--muted, #64748b);
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.branch-client-picker__option-meta--branch {
  color: #92400e;
  background: #fffbeb;
  padding: 2px 8px;
  border-radius: 999px;
}
.branch-client-picker__empty {
  margin: 0;
  padding: 10px 8px;
  text-align: center;
}
@media (max-width: 830px) {
  .branch-client-picker__trigger {
    min-height: 44px;
  }
  .branch-client-picker__option {
    min-height: 44px;
    padding: 10px 12px;
  }
  .branch-assign-form__submit {
    width: 100%;
  }
}

.scheduler-assign-save {
  flex-shrink: 0;
}
.scheduler-shift-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.scheduler-remove-form { display: inline; margin: 0; }

.scheduler-rec-panel {
  width: 100%;
  flex-basis: 100%;
  margin: 0;
  padding: 0;
  border: none;
}
.scheduler-rec-inner {
  margin-top: 4px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
}
.scheduler-rec-title { display: block; margin-bottom: 8px; font-size: 0.88em; }
.scheduler-rec-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.9em;
}
.scheduler-rec-item {
  margin: 4px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.scheduler-rec-item--disabled { opacity: 0.55; }
.scheduler-rec-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.82em;
  font-weight: 700;
  background: var(--primary-light, #e8f0fe);
  color: var(--primary, #2563eb);
}
.scheduler-rec-score--none {
  background: var(--bg, #eee);
  color: var(--text-muted, #888);
  font-weight: 600;
}
.scheduler-rec-score--poor {
  background: #fef2f2;
  color: #b91c1c;
}
.scheduler-rec-badge {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
}
.scheduler-rec-badge--ok { background: #d1fae5; color: #065f46; }
.scheduler-rec-badge--no { background: #fee2e2; color: #991b1b; }
.scheduler-rec-badge--warn { background: #ffedd5; color: #9a3412; }
.scheduler-rec-loading { padding: 8px 0; }

.scheduler-empty {
  text-align: center;
  padding: 36px 20px 28px;
  max-width: 420px;
  margin: 0 auto;
}
.scheduler-empty-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 12px;
  opacity: 0.85;
}
.scheduler-empty-title { margin: 0 0 8px; font-size: 1.15em; }
.scheduler-empty-second { margin-top: 10px; }
.scheduler-empty .muted { margin-bottom: 18px; }

/* —— Scheduler: Tasks for next 24 hours —— */
.scheduler-tasks-24h {
  padding: 22px 22px 26px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #ffffff 0%, #f8faff 48%, #ffffff 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.st24-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 18px;
}
.st24-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.st24-lead { margin: 0; line-height: 1.5; max-width: 42rem; }
.st24-header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}
.st24-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.st24-mode-pill--automatic {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.18);
}
.st24-mode-pill--manual {
  color: #475569;
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.16);
}
.st24-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.st24-stat {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  text-align: center;
}
.st24-stat--warn .st24-stat-value { color: var(--warning); }
.st24-stat-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.st24-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.st24-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 16px;
  margin-bottom: 16px;
}
.st24-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  align-self: flex-end;
}
.st24-filter-panel {
  flex: 1 1 320px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: linear-gradient(to bottom, rgba(248, 250, 255, 0.95), #fff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.st24-filter-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.st24-filter-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.st24-filter-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 0.95rem;
  line-height: 1;
}
.st24-filter-panel-count {
  margin: 0;
  flex: 1 1 auto;
}
.st24-filter-clear {
  margin-left: auto;
}
.st24-client-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 132px;
  overflow: auto;
  padding: 2px;
  margin: -2px;
}
.st24-client-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
}
.st24-client-chip:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.04);
}
.st24-client-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.st24-client-chip.is-active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.st24-client-chip--attention:not(.is-active) {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(255, 251, 235, 0.9);
}
.st24-client-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st24-client-chip-count {
  flex: 0 0 auto;
  min-width: 1.4em;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}
.st24-client-chip.is-active .st24-client-chip-count {
  background: rgba(37, 99, 235, 0.16);
  color: var(--primary);
}
.st24-client-chip--attention:not(.is-active) .st24-client-chip-count {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}
.st24-visit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.st24-visit-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.st24-visit-card:hover {
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.st24-visit-card--urgent {
  border-left: 4px solid var(--warning);
}
.st24-visit-card--unassigned:not(.st24-visit-card--urgent) {
  border-left: 4px solid rgba(245, 158, 11, 0.65);
}
.st24-visit-card--attention:not(.st24-visit-card--urgent):not(.st24-visit-card--unassigned) {
  border-left: 4px solid rgba(37, 99, 235, 0.35);
}
.st24-visit-card--collapsed .st24-task-board {
  display: none;
}
.st24-visit-toggle {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  margin: -4px 0 -4px -6px;
  padding: 0;
  border: none;
  border-radius: 8px 0 0 8px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.st24-visit-toggle:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}
.st24-visit-toggle-icon {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  margin-top: -2px;
}
.st24-visit-card:not(.st24-visit-card--collapsed) .st24-visit-toggle-icon {
  transform: rotate(45deg);
  margin-top: 2px;
}
.st24-visit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 18px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(to bottom, rgba(248, 250, 255, 0.9), #fff);
  cursor: pointer;
}
.st24-visit-card--collapsed .st24-visit-head {
  border-bottom: none;
  padding-bottom: 16px;
}
.st24-visit-card:not(.st24-visit-card--collapsed) .st24-visit-head {
  cursor: default;
}
.st24-visit-timeblock {
  flex: 0 0 auto;
  min-width: 118px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.1);
  text-align: center;
}
.st24-visit-date {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}
.st24-visit-clock {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.st24-visit-main { flex: 1 1 220px; min-width: 0; }
.st24-visit-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}
.st24-visit-client {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}
.st24-starts-in {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
  white-space: nowrap;
}
.st24-starts-in--urgent {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}
.st24-visit-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.st24-assign-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.st24-assign-pill--ok {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}
.st24-assign-pill--warn {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}
.st24-visit-actions {
  margin-left: auto;
  align-self: center;
}
.st24-task-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.st24-task-col {
  padding: 14px 18px 16px;
  min-width: 0;
}
.st24-task-col + .st24-task-col {
  border-left: 1px solid rgba(15, 23, 42, 0.06);
}
.st24-task-col--highlight {
  background: rgba(245, 158, 11, 0.04);
}
.st24-task-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.st24-task-col-head h4 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  flex: 1;
}
.st24-task-col-count {
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.st24-task-col-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.75rem;
}
.st24-task-col-icon--visit { background: rgba(100, 116, 139, 0.12); }
.st24-task-col-icon--care { background: rgba(16, 185, 129, 0.12); color: #047857; }
.st24-task-col-icon--auto { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.st24-task-col-icon--pending { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.st24-task-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.st24-task-chip {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  border: 1px solid transparent;
  word-break: break-word;
}
.st24-task-chip--visit {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}
.st24-task-chip--care {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.14);
}
.st24-task-chip--care.st24-task-chip--done {
  opacity: 0.72;
}
.st24-task-chip--care.st24-task-chip--refused {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}
.st24-task-chip--auto {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.12);
}
.st24-task-chip--pending {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.22);
  border-style: dashed;
}
.st24-rec-meta { display: block; margin-bottom: 2px; }
.st24-task-empty { margin: 0; line-height: 1.45; }
.st24-no-results { margin: 12px 0 0; text-align: center; }
.st24-empty { margin-top: 8px; }
@media (max-width: 900px) {
  .st24-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st24-task-board { grid-template-columns: 1fr; }
  .st24-task-col + .st24-task-col {
    border-left: none;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
  }
  .st24-starts-in { margin-left: 0; }
  .st24-visit-actions { width: 100%; margin-left: 0; }
}
@media (max-width: 560px) {
  .scheduler-tasks-24h { padding: 16px 14px 20px; }
  .st24-header-meta { align-items: flex-start; text-align: left; }
  .st24-visit-head { flex-direction: column; }
  .st24-visit-timeblock { width: 100%; }
  .st24-toolbar-actions { width: 100%; align-self: stretch; }
  .st24-filter-clear { margin-left: 0; width: 100%; }
}

.auto-task-scope-dialog { max-width: 480px; }
.auto-task-scope-options {
  border: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auto-task-scope-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
}
.auto-task-scope-option:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.04);
}
.auto-task-scope-option input { margin-top: 3px; flex-shrink: 0; }
.auto-task-scope-option-desc { display: block; margin-top: 2px; }

/* Inline edit input for auto-generated shift tasks — the bare .input class has
   no base styling, so give this field the standard bordered input look. */
.shift-auto-task-edit-form .input {
  flex: 1 1 auto;
  min-width: 180px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
  color: var(--text, #0f172a);
  background: #fff;
}
.shift-auto-task-edit-form .input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

@media (max-width: 820px) {
  .scheduler-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .scheduler-page-header { flex-direction: column; align-items: stretch; }
  .scheduler-page-header-actions { justify-content: flex-start; }
  .scheduler-shift-main { flex-direction: column; }
  .scheduler-shift-timeblock {
    width: 100%;
    max-width: none;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  .scheduler-shift-time-start,
  .scheduler-shift-time-end { display: inline; }
  .scheduler-shift-time-sep { display: inline; }
  .scheduler-shift-status { margin-left: 0; }
  .scheduler-assign-form { align-items: stretch; }
  .scheduler-assign-form .scheduler-cg-picker { flex: 1 1 100%; }
  .scheduler-assign-form .scheduler-assign-save { width: 100%; }
}

/* Day roster (agency) — caregivers column + hourly timeline */
.day-roster-page {
  max-width: none;
  margin: 0;
}
.day-roster-shell {
  margin-top: 4px;
}
.day-roster-board {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  grid-template-rows: 36px repeat(var(--roster-row-count, 1), minmax(56px, auto));
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}
.day-roster-label-head {
  grid-column: 1;
  grid-row: 1;
  min-height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fbfbfc;
}
.day-roster-label-row {
  grid-column: 1;
  min-height: calc(var(--roster-lane-count, 1) * 56px);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fbfbfc;
  box-sizing: border-box;
}
.day-roster-hour {
  min-height: 36px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}
.day-roster-label-availability {
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-roster-label-availability--full-time {
  color: #166534;
}
.day-roster-label-availability--part-time,
.day-roster-label-availability--part-time-text {
  color: #1d4ed8;
}
.day-roster-label-availability--off-day {
  color: #92400e;
}
.day-roster-label-availability--leave {
  color: #b45309;
}
.day-roster-track--avail-leave {
  background-color: rgba(245, 158, 11, 0.06);
}
.day-roster-label-row--unassigned {
  background: rgba(245, 158, 11, 0.08);
}
.day-roster-label-name {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-roster-label-meta {
  font-size: 0.72rem;
}
.day-roster-timeline-wrap {
  grid-column: 2;
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: subgrid;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.day-roster-timeline {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: subgrid;
  min-width: max(100%, calc(var(--roster-hour-count, 24) * 56px));
}
.day-roster-hours {
  display: grid;
  grid-template-columns: repeat(var(--roster-hour-count, 24), minmax(56px, 1fr));
  border-bottom: 1px solid var(--border);
  background: #fbfbfc;
  box-sizing: border-box;
}
.day-roster-hour {
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  border-right: 1px solid var(--border);
}
.day-roster-hour:last-child {
  border-right: 0;
}
.day-roster-track {
  --roster-lane-count: 1;
  position: relative;
  min-height: calc(var(--roster-lane-count, 1) * 56px);
  height: calc(var(--roster-lane-count, 1) * 56px);
  align-self: stretch;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent calc(100% / var(--roster-hour-count, 24) - 1px),
      rgba(226, 232, 240, 0.9) calc(100% / var(--roster-hour-count, 24) - 1px),
      rgba(226, 232, 240, 0.9) calc(100% / var(--roster-hour-count, 24))
    );
}
.day-roster-avail-window {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px dashed rgba(22, 163, 74, 0.35);
  pointer-events: none;
  z-index: 0;
}
.day-roster-track--unassigned {
  background-color: rgba(245, 158, 11, 0.04);
}
.day-roster-track--avail-off-day {
  background-color: rgba(148, 163, 184, 0.08);
  background-image: none;
}
.day-roster-track--avail-part-time-text {
  background-color: rgba(59, 130, 246, 0.04);
}
.day-roster-block {
  --roster-lane: 0;
  position: absolute;
  z-index: 1;
  top: calc(4px + var(--roster-lane, 0) * ((100% - 8px) / var(--roster-lane-count, 1)));
  height: calc((100% - 8px) / var(--roster-lane-count, 1) - 3px);
  bottom: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 4px 7px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-dark);
  text-decoration: none;
  overflow: hidden;
  min-width: 44px;
  box-shadow: 0 1px 2px rgba(15, 23, 40, 0.06);
}
.day-roster-block:hover {
  text-decoration: none;
  background: rgba(37, 99, 235, 0.18);
}
.day-roster-block-time {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}
.day-roster-block-client {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continuity-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}

.continuity-badge--primary {
  background: rgba(34, 139, 84, 0.16);
  color: #1d6b41;
}

.continuity-badge--sub {
  background: rgba(217, 119, 6, 0.16);
  color: #b45309;
}

.continuity-badge--unassigned {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.continuity-badge--roster {
  display: block;
  margin-top: 2px;
  width: fit-content;
  font-size: 0.62rem;
}

.day-roster-block-travel-hint {
  display: block;
  margin-top: 1px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
  color: #b45309;
  white-space: normal;
}
.day-roster-label-travel-warn {
  color: #b45309;
  font-weight: 600;
}
.day-roster-block--unassigned {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}
.day-roster-block--pending {
  border-style: dashed;
}
.day-roster-block--active {
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.16);
  color: #0f766e;
}
.day-roster-block--done,
.day-roster-block--past {
  opacity: 0.72;
}
.day-roster-block--draggable {
  cursor: grab;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
}
.day-roster-block--dragging {
  opacity: 0.55;
  cursor: grabbing;
  z-index: 3;
}
.day-roster-track--drop-target {
  outline: 2px dashed rgba(37, 99, 235, 0.55);
  outline-offset: -2px;
  background-color: rgba(37, 99, 235, 0.06);
}
.day-roster-track--drop-time-change {
  outline-color: rgba(124, 58, 237, 0.65);
  background-color: rgba(124, 58, 237, 0.07);
}
.day-roster-track--drop-unavailable {
  outline: 2px dashed rgba(220, 38, 38, 0.8);
  outline-offset: -2px;
  background-color: rgba(220, 38, 38, 0.12);
}
.day-roster-track--drop-reassign {
  outline: 2px dashed rgba(22, 163, 74, 0.8);
  outline-offset: -2px;
  background-color: rgba(34, 197, 94, 0.12);
}
.day-roster-track--drop-travel-warning {
  outline: 2px dashed rgba(217, 119, 6, 0.85);
  outline-offset: -2px;
  background-color: rgba(251, 191, 36, 0.14);
}
.day-roster-drop-preview {
  position: absolute;
  top: 7px;
  bottom: 7px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 4px 7px;
  border-radius: 8px;
  border: 2px dashed rgba(37, 99, 235, 0.65);
  background: rgba(37, 99, 235, 0.1);
  pointer-events: none;
  min-width: 44px;
  box-shadow: 0 1px 3px rgba(15, 23, 40, 0.08);
}
.day-roster-drop-preview--time-change {
  border: 2px dashed rgba(124, 58, 237, 0.85);
  background: rgba(237, 233, 254, 0.95);
  box-shadow: 0 1px 4px rgba(124, 58, 237, 0.18);
}
.day-roster-drop-preview--unavailable {
  border: 2px dashed rgba(220, 38, 38, 0.92);
  background: rgba(254, 226, 226, 0.95);
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.22);
}
.day-roster-drop-preview--reassign {
  border: 2px dashed rgba(22, 163, 74, 0.92);
  background: rgba(220, 252, 231, 0.95);
  box-shadow: 0 1px 4px rgba(22, 163, 74, 0.2);
}
.day-roster-drop-preview--travel-warning {
  border: 2px dashed rgba(217, 119, 6, 0.92);
  background: rgba(254, 243, 199, 0.96);
  box-shadow: 0 1px 4px rgba(217, 119, 6, 0.22);
}
.day-roster-drop-preview__time {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  color: var(--primary-dark);
}
.day-roster-drop-preview--time-change .day-roster-drop-preview__time {
  color: #5b21b6;
}
.day-roster-drop-preview__hint {
  font-size: 0.62rem;
  line-height: 1.15;
  white-space: nowrap;
  opacity: 0.88;
  color: inherit;
}
.day-roster-drop-preview--time-change .day-roster-drop-preview__hint {
  color: #6d28d9;
}
.day-roster-drop-preview--unavailable .day-roster-drop-preview__time,
.day-roster-drop-preview--unavailable .day-roster-drop-preview__hint {
  color: #dc2626;
  font-weight: 700;
}
.day-roster-drop-preview--reassign .day-roster-drop-preview__time,
.day-roster-drop-preview--reassign .day-roster-drop-preview__hint {
  color: #15803d;
  font-weight: 700;
}
.day-roster-drop-preview--travel-warning .day-roster-drop-preview__time,
.day-roster-drop-preview--travel-warning .day-roster-drop-preview__hint {
  color: #b45309;
  font-weight: 700;
  white-space: normal;
}
@media (max-width: 830px) {
  .day-roster-board {
    grid-template-columns: 132px minmax(0, 1fr);
  }
}

/* Vaccination checklist */
.vaccination-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
.vaccination-list label {
  font-size: 0.92em;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
}
.vaccination-list label:has(input:checked) {
  background: #dcfce7;
  border-color: var(--success);
}
@media (max-width: 600px) { .vaccination-list { grid-template-columns: 1fr; } }

/* Family member input rows (legacy compact grid kept for any older callers) */
.family-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.family-row .form-group { margin-bottom: 0; }
@media (max-width: 700px) { .family-row { grid-template-columns: 1fr; } }

/* Card-style family member entries on Add Client */
.family-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.family-empty {
  padding: 12px 14px;
  margin: 0 0 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: var(--bg);
}
.family-empty[hidden] { display: none !important; }
.family-card {
  border: 1px solid #d6e3ec;
  border-radius: 10px;
  padding: 12px 14px 14px;
  background: #fff;
  margin: 0;
}
.family-card__legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 4px;
  font-weight: 600;
}
.family-card__title { font-size: 0.95rem; }
.family-card__remove {
  background: transparent;
  color: #b91c1c;
  border: 0;
  padding: 2px 6px;
  font-weight: 500;
  cursor: pointer;
}
.family-card__remove:hover { text-decoration: underline; }
.family-card .form-row { margin-bottom: 8px; }
.family-card .form-row:last-child { margin-bottom: 0; }
.family-card__login { align-items: top; }

/* Client intake — primary user designation (metadata only) */
.intake-primary-user {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e2e8f0);
}
.primary-user-radios {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.primary-user-radio {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: normal;
  cursor: pointer;
}
.primary-user-radio input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.primary-user-detail-form {
  margin-top: 12px;
}

.client-primary-caregiver-form__lives-with {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: normal;
  margin: 0 0 12px;
}

.client-primary-caregiver-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.client-primary-caregiver-card__recommended {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.client-primary-caregiver-card__recommended-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 6px;
}

.client-primary-caregiver-card__recommended-copy {
  margin: 0;
  line-height: 1.45;
}

.client-primary-caregiver-card__recommended-actions {
  margin-top: 10px;
}

.client-primary-caregiver-form__use-recommended {
  background: #fff;
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.35);
  font-weight: 600;
  text-decoration: none;
}

.client-primary-caregiver-form__use-recommended:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-dark);
  text-decoration: none;
}

.continuity-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}

.continuity-badge--recommended {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
}

.continuity-badge--none {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.continuity-confidence {
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.continuity-confidence--strong { color: #15803d; }
.continuity-confidence--moderate { color: #1d4ed8; }
.continuity-confidence--weak { color: #b45309; }

/* Senior / client feedback on shifts */
blockquote.senior-feedback-quote {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  font-size: 0.96em;
}

/* Snippets / chat-like */
.snippet {
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 3px solid var(--primary);
}
.snippet .meta { font-size: 0.78em; color: var(--muted); margin-bottom: 3px; }
/* Optimistic snippet appended on the Current Shift page while the device is
   offline. Visually distinct so the caregiver knows it hasn't been synced
   yet; the .snippet--pending class is removed by static/js/offline-queue.js
   once the queue successfully drains. */
.snippet--pending {
  border-left-color: #94a3b8;
  background: repeating-linear-gradient(
    -45deg,
    var(--bg),
    var(--bg) 10px,
    rgba(148, 163, 184, 0.08) 10px,
    rgba(148, 163, 184, 0.08) 20px
  );
}
.snippet--pending .snippet__pending-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.shift-log-row--pending td {
  background: rgba(148, 163, 184, 0.08);
}
.shift-log-form--pending {
  outline: 1px dashed #94a3b8;
  outline-offset: 4px;
}

/* --- Offline action queue banner --------------------------------------- */
/* Floating chip rendered by static/js/offline-queue.js on the caregiver
   Current Shift page (mobile shell only). Fixed to the bottom so it
   doesn't push the shift cards around as the queue grows / drains. */
.offline-status {
  position: fixed;
  left: 50%;
  bottom: max(16px, var(--rithma-safe-bottom));
  transform: translateX(-50%);
  z-index: 80;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
  pointer-events: none;
  max-width: calc(100% - 32px);
  text-align: center;
}
.offline-status[hidden] { display: none; }
.offline-status--offline {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.offline-status--syncing {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}
.offline-status--error {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* Task checklist */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li {
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 9px;
}
/* Layout classes (not inline styles) — Current Shift tab partials strip style="" */
.task-list form {
  display: inline;
  margin: 0;
}
.task-list .task-row-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.task-list .task-checkbox-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1.1em;
  padding: 0;
  line-height: 1;
}
.task-list .task-checkbox-btn:disabled {
  cursor: not-allowed;
}
.task-list .badge {
  font-size: 0.75rem;
}
.task-list li.done .task-detail-hover,
.task-list li.done .task-detail-hover__label {
  text-decoration: line-through;
  color: var(--muted);
}
.task-list li.done .task-detail-hover {
  border-bottom-color: transparent;
}
.task-delete-inline.task-delete-modal-form {
  margin-left: auto;
  flex-shrink: 0;
}

.task-list li.done { text-decoration: line-through; color: var(--muted); }
.task-list li.period-task-completed-in-shift { color: inherit; }
.task-list li.task-incomplete {
  border-left: 3px solid var(--warning, #f59e0b);
}
.task-list li.task-incomplete.task-incomplete--confirmed {
  border-left-color: var(--primary, #2563eb);
}
/* "Refused by client" state — visually distinct from .done so a
   refused task isn't mistaken for a completed one in a quick glance.
   Keep the strikethrough so it still reads as "out of the queue", but
   tint the row red-orange and the text muted instead of grey. */
.task-list li.refused {
  text-decoration: line-through;
  color: var(--muted);
  border-left: 3px solid var(--danger, #dc2626);
  background: color-mix(in srgb, var(--danger, #dc2626) 8%, var(--bg));
}
.task-list .task-refused-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 6px;
  white-space: nowrap;
}
.task-refuse-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1.05em;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.65;
}
.task-refuse-btn:hover { opacity: 1; }
.task-refuse-btn:disabled { cursor: not-allowed; opacity: 0.35; }
.task-refuse-btn.is-active { opacity: 1; }

.period-task-checkbox-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1.1em;
  padding: 0 4px 0 0;
  line-height: 1;
}

.period-shared-tasks-card .period-task-section + .period-task-section {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}
.period-shared-tasks-card__title,
.period-shared-tasks-card__meta {
  display: inline;
}
.period-shared-tasks-card__meta {
  font-weight: 400;
  margin-left: 0.35em;
}
.period-shared-tasks-card__body {
  margin-top: 4px;
}
.period-task-li {
  flex-wrap: wrap;
}
.period-task-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.period-task-ended-note {
  margin-top: 10px;
}

/* Native disclosure triangle — same left inset on all foldable summaries */
details:not(.msg-item):not(.visit-picker):not(.leave-reject-details):not(.leave-unassigned-details):not(.shift-log-row-correct):not(.state-rule-readiness-check):not(.task-assistant-rules--foldable) > summary:not(.btn):not(.state-rule-readiness-check__summary):not(.visit-picker__summary):not(.task-assistant-rules__summary) {
  cursor: pointer;
  display: list-item;
  list-style-position: outside;
  margin-inline-start: var(--disclosure-marker-inset);
  padding-block: 2px 4px;
  padding-inline-start: var(--disclosure-marker-gap);
  padding-inline-end: 0;
}
:is(
  .task-followup-details__summary,
  .overtime-details__summary,
  .pending-leave-details__summary,
  .shift-proposal-dash__summary,
  .pending-assessment-details__summary,
  .shift-clock-alerts-details__summary,
  .agency-profile-missing__summary,
  .profile-dash-gaps__summary,
  .profile-dash-gaps__person-sum,
  .agency-license-req__summary,
  .profile-self-missing__summary,
  .compliance-alerts__summary,
  .period-shared-tasks-card__summary
) {
  font-weight: 600;
}
.task-followup-details__summary::-webkit-details-marker,
.agency-profile-missing__summary::-webkit-details-marker,
.shift-clock-alerts-details__summary::-webkit-details-marker,
.shift-proposal-dash__summary::-webkit-details-marker {
  color: var(--info);
}
.overtime-details__summary::-webkit-details-marker,
.pending-leave-details__summary::-webkit-details-marker,
.pending-assessment-details__summary::-webkit-details-marker {
  color: var(--warning);
}
.profile-dash-gaps__summary::-webkit-details-marker,
.agency-license-req__summary::-webkit-details-marker,
.profile-self-missing__summary::-webkit-details-marker {
  color: var(--warning);
}
.compliance-alerts__summary::-webkit-details-marker {
  color: var(--danger);
}
.agency-license-req-card--complete .agency-license-req__summary::-webkit-details-marker {
  color: var(--success, #16a34a);
}
.compliance-alerts-card,
.shift-clock-alerts-details.card,
.pending-assessment-details.card {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.task-followup-details__title,
.overtime-details__title,
.pending-leave-details__title,
.pending-assessment-details__title,
.shift-clock-alerts-details__title,
.agency-profile-missing__title,
.profile-dash-gaps__title,
.agency-license-req__title,
.profile-self-missing__title,
.compliance-alerts__title {
  display: inline;
}
.task-followup-details__counts,
.overtime-details__counts,
.pending-leave-details__counts,
.pending-assessment-details__counts,
.shift-clock-alerts-details__counts,
.agency-profile-missing__counts,
.profile-dash-gaps__counts,
.agency-license-req__counts,
.profile-self-missing__counts,
.compliance-alerts__counts {
  display: inline;
  font-weight: 400;
  margin-left: 0.35em;
}
.task-followup-details.card,
.overtime-details.card,
.pending-leave-details.card,
.shift-proposal-dash.card,
.agency-profile-missing-card.card,
.profile-dash-gaps-card.card,
.agency-license-req-card.card,
.profile-self-missing-card.card,
.shared-expenses-defaults.card,
.period-shared-tasks-card--foldable.card {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.pending-leave-item {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border, #e8e8e8);
}
.pending-leave-item:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0;
}
.pending-leave-item__main {
  flex: 1;
  min-width: 200px;
}
.pending-leave-item__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 108px;
}
.pending-leave-item__actions .leave-approve-form,
.pending-leave-item__actions .leave-reject-form {
  margin: 0;
}
.pending-leave-item__actions .btn {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}

/* Dashboard — shift proposals (appointment coverage) */
.shift-proposal-dash {
  border-left: 4px solid var(--info, #0ea5e9);
}
.shift-proposal-dash__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
.shift-proposal-dash__summary::-webkit-details-marker {
  display: none;
}
.shift-proposal-dash__title {
  font-weight: 600;
  font-size: 1.05rem;
}
.shift-proposal-dash__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  color: var(--info, #0284c7);
  font-size: 0.8rem;
  font-weight: 700;
}
.shift-proposal-dash__subtitle {
  margin-left: 2px;
}
.shift-proposal-dash__intro {
  margin: 10px 0 16px;
  line-height: 1.45;
  max-width: 52rem;
}
.shift-proposal-dash__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shift-proposal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px 20px;
  padding: 16px 18px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--bg, #fafafa);
}
.shift-proposal-card__content {
  min-width: 0;
}
.shift-proposal-card__header {
  margin-bottom: 12px;
}
.shift-proposal-card__client {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}
.shift-proposal-card__appointment {
  display: block;
  margin-top: 2px;
  color: var(--text-muted, #64748b);
  font-size: 0.92rem;
}
.shift-proposal-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.shift-proposal-card__meta-block {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e8e8e8);
}
.shift-proposal-card__meta-block--proposed {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.06);
}
.shift-proposal-card__meta-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  margin-bottom: 4px;
}
.shift-proposal-card__meta-value {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}
.shift-proposal-card__meta-time {
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
}
.shift-proposal-card__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e8e8e8);
}
.shift-proposal-card__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shift-proposal-card__field {
  margin: 0;
}
.shift-proposal-card__field label {
  font-size: 0.8rem;
  margin-bottom: 4px;
}
.shift-proposal-card__accept-form {
  margin: 0;
}
.shift-proposal-card__buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.shift-proposal-card__buttons .btn {
  flex: 1;
  justify-content: center;
}
.shift-proposal-card__decline-form {
  margin: 0;
}
.shift-proposal-card__decline-form .btn {
  width: 100%;
  justify-content: center;
}
@media (max-width: 900px) {
  .shift-proposal-card {
    grid-template-columns: 1fr;
  }
  .shift-proposal-card__meta {
    grid-template-columns: 1fr;
  }
  .shift-proposal-card__buttons {
    flex-direction: column;
  }
}

@media (max-width: 830px) {
  .pending-leave-item__actions {
    width: 100%;
    flex-direction: row;
  }
  .pending-leave-item__actions .btn {
    flex: 1;
  }
}
.task-followup-filter-bar {
  margin-bottom: 14px;
}
.task-followup-item:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}
.task-followup-comment__label {
  margin-bottom: 4px;
}
.task-followup-comment__text {
  margin: 0 0 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  white-space: pre-wrap;
  line-height: 1.45;
}
.task-followup-comment__meta {
  margin: 0 0 10px;
}
.task-followup-comment__form {
  display: block;
}
.task-followup-comment__field {
  margin-bottom: 10px;
}
.task-followup-comment__field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.task-followup-comment__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.incomplete-ack-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.incomplete-ack-task-picks {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.incomplete-ack-task-picks__legend {
  font-weight: 600;
  margin-bottom: 4px;
  padding: 0;
}
.incomplete-ack-task-picks__hint {
  margin: 0 0 10px;
}
.incomplete-ack-task-picks__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.incomplete-ack-task-picks__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  line-height: 1.4;
}
.incomplete-ack-task-picks__text {
  flex: 1 1 12rem;
  min-width: 0;
}
.profile-dash-gaps__person-sum {
  font-weight: 600;
}
.profile-dash-gaps__person {
  margin-bottom: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.profile-dash-gaps__person:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* Login switch link */
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.92em; color: var(--muted); }
.auth-forgot-password { text-align: center; margin-top: 12px; margin-bottom: 0; font-size: 0.92em; }

/* Page actions row */
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Message inbox */
.message-list .message-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.message-list .message-item.unread { background: var(--primary-light); }
.message-list .message-item .from { font-weight: 600; }
.message-list .message-item .subject { color: var(--muted); font-size: 0.9em; }
.message-list .message-item .body { margin-top: 6px; font-size: 0.95em; }

/* GPS status */
.gps-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #dcfce7;
  color: #166534;
  border-radius: 20px;
  font-size: 0.85em;
}
.gps-indicator .dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: pulse 2s infinite; }
.gps-indicator[hidden] { display: none; }
.gps-indicator--hint {
  background: #f1f5f9;
  color: #334155;
}
.gps-indicator--hint .dot,
.gps-indicator .dot--muted {
  background: #94a3b8;
  animation: none;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* --- Persistent location-permission banner --------------------------- */
/* Lives in templates/base.html outside <main> so it survives client-side
   page-swaps. Populated by static/js/shift-gps.js whenever a caregiver
   in the native app has location permission denied. The slot itself is
   always present and just sizes to its (often empty) child. */
.gps-permission-banner-slot:empty {
  display: none;
}
.gps-permission-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #fef3c7;
  color: #78350f;
  border-bottom: 1px solid #fcd34d;
  font-size: 0.92em;
  line-height: 1.35;
}
.gps-permission-banner__msg {
  flex: 1 1 240px;
  min-width: 0;
}
.gps-permission-banner__btn {
  flex: 0 0 auto;
  background: #b45309;
  color: #fff;
  border: 0;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
}
.gps-permission-banner__btn:disabled {
  opacity: 0.7;
  cursor: progress;
}
.gps-permission-banner__btn:hover:not(:disabled) {
  background: #92400e;
}

/* Inline permission-error block under the Start Shift button. Mirrors
   the banner palette so the two reads as one error condition. */
.cs-permission-error {
  margin-top: 10px;
  padding: 12px 14px;
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  font-size: 0.92em;
  line-height: 1.4;
}
.cs-permission-error[hidden] { display: none; }
.cs-permission-error__msg {
  margin: 0 0 8px 0;
}
.start-rithma-popup {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.9em;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.start-rithma-popup[hidden] {
  display: none;
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}
.notification-item__body {
  flex: 1;
  min-width: 0;
}
.notification-item__actions {
  flex: 0 0 auto;
  flex-shrink: 0;
}
.notification-item__actions form {
  margin: 0;
}
.notification-item__actions .btn {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  min-width: 5.75rem;
}
.notification-item.unread {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.notification-item__body p {
  margin: 4px 0 6px;
  color: var(--muted);
}
.stat-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 10px;
}
.stat-split-row > div + div {
  border-left: 1px solid var(--border);
  padding-left: 10px;
}
.stat-split-row .value {
  line-height: 1;
}
.stat-split-row__value-link {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}
.stat-split-row__value-link:hover {
  text-decoration: underline;
}
.stat-card-link {
  display: block;
  color: inherit;
}
.stat-card-link:hover {
  text-decoration: none;
}

.stat-metric-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.stat-metric-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-muted, #f8fafc);
  color: inherit;
  text-decoration: none;
  min-height: 100%;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.stat-metric-tile:hover {
  border-color: var(--primary, #2563eb);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  text-decoration: none;
}

.stat-metric-tile:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}

.stat-metric-tile--static {
  cursor: default;
}

.stat-metric-tile--solo {
  margin-top: 8px;
  align-items: stretch;
}

.stat-metric-tile__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.stat-metric-tile__value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text, #0f172a);
}

.stat-metric-tile__value.stat-value--ok { color: var(--success); }
.stat-metric-tile__value.stat-value--warn { color: var(--warning); }
.stat-metric-tile__value.stat-value--danger { color: var(--danger); }

.stat-metric-tile__hint {
  margin-top: 2px;
  line-height: 1.3;
}

.dashboard .stat-card--metric-duo .stat-metric-tile__value {
  font-size: 1.75rem;
}

.assignment-status-card {
  border-left: 4px solid #2563eb;
  padding-left: 12px;
  margin-left: 8px;
}
.assignment-status-card h3 {
  margin-top: 0;
}
.assignment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 830px) {
  .assignment-status-card {
    margin-left: 12px;
    padding-left: 14px;
  }
}

.muted { color: var(--muted); }
.text-sm { font-size: 0.88em; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
/* Spacing helpers so pages stop hand-rolling inline margins. Scale follows the
   existing .mt-2/.mb-2 convention (step = 8px). */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mb-1 { margin-bottom: 8px; }
.mt-3 { margin-top: 24px; }
.mb-3 { margin-bottom: 24px; }
/* Tight bullet/numbered list used inside cards (replaces inline
   margin:0;padding-left:1.2rem). */
.list-compact { margin: 0; padding-left: 1.2rem; }
.list-compact > li + li { margin-top: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* --- Form aliases & layout used across role pages --- */
/* `.form-field` mirrors `.form-group` so old markup works the same. */
.form,
.form-field {
  margin-bottom: 14px;
}
.form-field label,
.form > label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9em;
  color: var(--text);
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="password"],
.form-field input[type="date"],
.form-field input[type="time"],
.form-field input[type="number"],
.form-field input[type="url"],
.form-field input[type="search"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
  background: white;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-field textarea { resize: vertical; min-height: 70px; }
/* Date/time/select controls use different native heights per browser — align them in form rows. */
.form-group select,
.form-group input[type="date"],
.form-group input[type="time"],
.form-field select,
.form-field input[type="date"],
.form-field input[type="time"] {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  line-height: 1.25;
}
.form-field input[type="checkbox"],
.form-field input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0 6px 0 0;
  vertical-align: middle;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-field label:has(> input[type="checkbox"]),
.form-field label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  cursor: pointer;
}

.leave-card--urgent {
  border-left: 4px solid #dc2626;
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.72) 0%, var(--card, #fff) 120px);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.08);
}
.leave-card-urgent-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.leave-card-urgent-note {
  margin: 0 0 4px;
  color: #7f1d1d;
  line-height: 1.45;
}
.badge-urgent-leave {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.leave-submit-urgent {
  font-weight: 600;
}
.leave-request-row--urgent {
  background: rgba(254, 242, 242, 0.45);
}
.leave-request-row--urgent:hover {
  background: rgba(254, 242, 242, 0.65);
}
.leave-type-urgent-icon {
  display: inline-block;
  margin-right: 4px;
  color: #dc2626;
  font-size: 0.95em;
}
.leave-request-urgent-tag {
  margin-top: 4px;
}

.leave-shift-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-2, #f8fafc);
}
.leave-shift-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92em;
  line-height: 1.4;
  cursor: pointer;
}
.leave-shift-option input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}
.leave-shift-option--blocked {
  opacity: 0.55;
  cursor: not-allowed;
  color: var(--muted, #64748b);
}
.leave-shift-option--blocked input[type="checkbox"] {
  cursor: not-allowed;
}
.leave-blocked-tag {
  font-size: 0.88em;
  color: var(--muted, #64748b);
}

.leave-form-blocked-note {
  margin: 0 0 10px;
}

.leave-date-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.leave-date-chip {
  appearance: none;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--card, #fff);
  padding: 8px 12px;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
  color: var(--text, #0f172a);
}
.leave-date-chip:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.06);
}
.leave-date-chip.is-selected:not(:disabled) {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.12);
  font-weight: 600;
}
.leave-date-chip.is-blocked,
.leave-date-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface-2, #f1f5f9);
  color: var(--muted, #64748b);
  text-decoration: line-through;
}

.leave-date-minical-wrap {
  margin: 4px 0 14px;
}
.leave-date-minical .rithma-minical-cell.is-disabled {
  opacity: 0.45;
  text-decoration: line-through;
}

.leave-form-section {
  margin-top: 4px;
}
.leave-form-section-title {
  margin: 0 0 6px;
  font-size: 0.95em;
  font-weight: 600;
}
.leave-form-section-divider {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.leave-mode-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border, #e2e8f0);
  max-width: 360px;
}
.leave-mode-label {
  margin: 0;
  padding: 4px 2px;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted, #64748b);
  cursor: pointer;
  transition: color 0.15s;
}
.leave-mode-label:hover {
  color: var(--text, #0f172a);
}
.leave-mode-label--active {
  color: var(--primary, #2563eb);
  font-weight: 600;
}
.leave-mode-switch {
  flex-shrink: 0;
}
.leave-mode-panel {
  margin-top: 4px;
}
.leave-date-hint {
  margin: -4px 0 12px;
  color: var(--warning, #b45309);
}
.leave-date-hint[hidden] {
  display: none;
}

.leave-request-mode {
  font-size: 0.85em;
  margin-top: 2px;
}

/* Caregiver “your requests” table */
.leave-requests-table:not(.leave-requests-table--agency) > tbody > tr > .leave-request-when {
  max-width: 280px;
  white-space: normal;
  line-height: 1.4;
}
.leave-requests-table:not(.leave-requests-table--agency) > tbody > tr > .leave-request-reason {
  max-width: 240px;
  white-space: normal;
  line-height: 1.45;
}
@media (min-width: 831px) {
  .leave-requests-table:not(.leave-requests-table--agency) > tbody > tr > .app-actions {
    white-space: nowrap;
    text-align: right;
    vertical-align: middle;
    width: 1%;
  }
  .leave-requests-table:not(.leave-requests-table--agency) > tbody > tr > .app-actions .leave-cancel-form {
    display: inline-flex;
    margin: 0;
  }
}

@media (min-width: 831px) {
  .leave-requests-table--agency > tbody > tr > .leave-request-actions {
    vertical-align: top;
    text-align: right;
  }
}

.leave-request-actions__shell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 168px;
  width: 100%;
  max-width: 220px;
  margin-left: auto;
}
.leave-approve-form,
.leave-reject-form {
  margin: 0;
}
.leave-approve-form .btn,
.leave-reject-details__summary {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}
.leave-reject-details {
  display: block;
  width: 100%;
}
.leave-reject-details__summary {
  list-style: none;
  cursor: pointer;
}
.leave-reject-details__summary::-webkit-details-marker {
  display: none;
}
.leave-reject-details__summary::marker {
  content: "";
}
.leave-reject-details__body {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.03);
  text-align: left;
}
.leave-reject-details:not([open]) .leave-reject-details__body {
  display: none;
}
.leave-reject-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.leave-reject-note-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.leave-reject-note-label {
  color: var(--muted);
  line-height: 1.3;
}
.leave-reject-note {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.leave-reject-note:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.leave-reject-confirm {
  align-self: flex-end;
}
.leave-request-resolver-note {
  padding-top: 0 !important;
  border-top: 0 !important;
}

.leave-unassigned-details {
  display: block;
  width: 100%;
}
.leave-show-unassigned-btn.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.leave-unassigned-cards-host {
  margin-top: 16px;
}
.leave-unassigned-cards-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.leave-unassigned-cards-panel__title {
  margin: 0;
  font-size: 1.05rem;
}
.leave-unassigned-shift-cards {
  margin: 0;
}
.leave-unassigned-shift-date {
  margin-top: 4px;
}
.scheduler-assign-recommendation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.scheduler-assign-recommendation__badge {
  font-size: 0.72em;
}
.scheduler-assign-recommendation-none {
  margin: 8px 0 0;
}
.scheduler-assign-recommended-form {
  margin-bottom: 8px;
}
.add-shift-recommendation-panel {
  margin-bottom: 12px;
}
.add-shift-recommendation-panel .scheduler-assign-recommendation {
  margin-top: 0;
}
.add-shift-recommendation-panel #add-shift-use-recommended {
  margin-top: 10px;
}
.add-shift-seg-rec {
  margin-bottom: 8px;
}
.add-shift-seg-rec .scheduler-assign-recommendation {
  margin-top: 0;
  margin-bottom: 6px;
}
.add-shift-seg-rec .add-shift-use-seg-rec {
  margin-bottom: 8px;
}
.scheduler-segment-row .add-shift-seg-rec + select {
  max-width: 360px;
}
.manual-segments-table .add-shift-seg-rec {
  min-width: 220px;
}
.scheduler-rec-score--caregiver {
  margin-left: 6px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}
.task-assistant-recs {
  --task-assistant-rec-visible-count: 3;
  --task-assistant-rec-row-min-height: 88px;
}
.task-assistant-rules {
  margin-bottom: 12px;
}
.task-assistant-rules--foldable {
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
}
.task-assistant-rules--foldable > .task-assistant-rules__summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  margin: 0;
}
.task-assistant-rules--foldable > .task-assistant-rules__summary::-webkit-details-marker {
  display: none;
}
.task-assistant-rules--foldable > .task-assistant-rules__summary::marker {
  content: "";
}
.task-assistant-rules__summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
}
.task-assistant-rules__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.task-assistant-rules__meta {
  font-size: 0.8rem;
}
.task-assistant-rules__toggle-hint::after {
  content: "Show";
}
.task-assistant-rules--foldable[open] .task-assistant-rules__toggle-hint::after {
  content: "Hide";
}
.task-assistant-rules__body {
  padding: 0 14px 12px;
  border-top: 1px solid rgba(37, 99, 235, 0.1);
}
.task-assistant-rules__lead {
  margin: 10px 0 8px;
}
.task-assistant-rules__summaries,
.task-assistant-rules__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.task-assistant-rules__list {
  padding-left: 0;
}
.task-assistant-rules__line {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text-primary, #0f172a);
}
.task-assistant-rules__line::before {
  content: "•";
  color: var(--text-muted, #64748b);
  margin-right: 8px;
}
.task-assistant-recs__tasks-section {
  margin-top: 4px;
}
.task-assistant-recs__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.task-assistant-recs__head h3 {
  margin: 0;
}
.task-assistant-recs__head .muted {
  margin: 4px 0 0;
}
.task-assistant-recs__add-all {
  flex: 0 0 auto;
  margin: 0;
}
.task-assistant-recs__viewport {
  position: relative;
  margin-top: 12px;
}
.task-assistant-recs__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.task-assistant-recs__list:not(:empty) {
  height: calc(var(--task-assistant-rec-row-min-height) * var(--task-assistant-rec-visible-count));
  max-height: calc(var(--task-assistant-rec-row-min-height) * var(--task-assistant-rec-visible-count));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.task-assistant-recs__scroll-indicator {
  display: none;
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 18px 12px 8px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.82) 42%,
    var(--card) 100%
  );
  color: var(--muted, #6b7280);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
}
.task-assistant-recs__viewport.is-scrollable:not(.at-bottom) .task-assistant-recs__scroll-indicator {
  display: flex;
}
.task-assistant-recs__viewport.is-scrollable:not(.at-bottom) .task-assistant-recs__list:not(:empty) {
  padding-bottom: 28px;
}
.task-assistant-recs__viewport.is-scrollable.is-scrolled:not(.at-bottom)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--card) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}
.task-assistant-recs__scroll-indicator-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 0.95rem;
  line-height: 1;
  animation: task-assistant-rec-bounce 1.6s ease-in-out infinite;
}
@keyframes task-assistant-rec-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}
.task-assistant-recs__item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--task-assistant-rec-row-min-height);
  box-sizing: border-box;
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.task-assistant-recs__item:last-child {
  border-bottom: 0;
}
.task-assistant-recs__body {
  flex: 1 1 220px;
  min-width: 0;
}
.task-assistant-recs__text {
  margin-top: 4px;
}
.task-detail-hover {
  position: relative;
  display: inline-block;
  max-width: 100%;
  cursor: help;
  border-bottom: 1px dotted rgba(100, 116, 139, 0.65);
}
.task-detail-hover__label {
  display: inline;
}
.task-detail-hover__tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 200px;
  max-width: min(320px, 92vw);
  padding: 10px 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text, #0f172a);
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  pointer-events: none;
}
.task-detail-hover:hover .task-detail-hover__tip,
.task-detail-hover:focus .task-detail-hover__tip,
.task-detail-hover:focus-within .task-detail-hover__tip {
  display: block;
}
.task-list .task-detail-hover {
  vertical-align: middle;
}
.task-assistant-recs__actions {
  flex: 0 0 auto;
  gap: 8px;
}
.task-assistant-recs__actions form {
  margin: 0;
}
.leave-list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.leave-list-pagination__nav {
  display: flex;
  gap: 8px;
}
.leave-unassigned-details__summary {
  list-style: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}
.leave-unassigned-details__summary::-webkit-details-marker {
  display: none;
}
.leave-unassigned-details__summary::marker {
  content: "";
}
.leave-unassigned-details__body {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.03);
  text-align: left;
}
.leave-unassigned-details:not([open]) .leave-unassigned-details__body {
  display: none;
}
.leave-unassigned-list {
  margin: 0;
  padding-left: 1.1em;
  line-height: 1.45;
}
.leave-unassigned-list li + li {
  margin-top: 4px;
}
.leave-unassigned-shift-link {
  color: var(--primary, #2563eb);
  text-decoration: none;
}
.leave-unassigned-shift-link:hover {
  text-decoration: underline;
}

@media (max-width: 830px) {
  .leave-requests-table > tbody > tr > .app-actions--empty {
    display: none;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .leave-requests-table:not(.leave-requests-table--agency) > tbody > tr > .app-actions {
    width: auto;
    max-width: none;
    white-space: normal;
  }
  .leave-requests-table:not(.leave-requests-table--agency) > tbody > tr > .app-actions .leave-cancel-form {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    margin: 0;
  }
  .leave-requests-table:not(.leave-requests-table--agency) > tbody > tr > .app-actions .leave-cancel-form .btn {
    white-space: nowrap;
    min-width: 5.5rem;
  }
  .leave-request-actions__shell {
    min-width: 0;
    max-width: none;
    margin-left: 0;
  }
  .leave-approve-form .btn,
  .leave-reject-details__summary,
  .leave-unassigned-details__summary {
    width: 100%;
  }
  .leave-reject-details__body {
    margin-top: 8px;
  }
  .leave-reject-confirm {
    align-self: stretch;
    width: 100%;
  }
  .leave-requests-table > tbody > tr.leave-request-note-row > td[colspan] {
    margin-top: -4px;
    padding-top: 0;
    border-top: 0;
  }
}

/* Button row at the bottom of a form. */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

/* Two-column responsive grid (used by family/senior cards). */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* Button variants used in some templates. */
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  margin-top: 12px;
}
.btn-sm.btn-primary,
[class*="-btn-row"] .btn-primary,
.period-window-mode-group .btn-primary,
.dashboard-actions .btn-primary,
.table-row-actions .btn-primary,
.doc-row-actions .btn-primary,
.notification-item__actions .btn-primary,
.pending-leave-item__actions .btn-primary {
  margin-top: 0;
}
.btn-link {
  background: transparent;
  color: var(--primary);
  border: 0;
  padding: 4px 6px;
  text-decoration: underline;
  box-shadow: none;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: inherit;
}
.btn-link:hover { background: transparent; color: var(--primary-dark); }
.btn-link.btn-danger { color: var(--danger); background: transparent; }
.btn-link.btn-danger:hover { color: #991b1b; background: transparent; }
.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
/* Start Shift uses aria-disabled so mobile taps still reach JS (native disabled
   blocks pointer-events and feels like a dead button). */
#cs-start-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Linked-seniors list on family/profile.html */
.senior-list { list-style: none; padding: 0; margin: 0; }
.senior-list li {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  background: var(--bg);
}

/* Message pages */
.messages-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Messenger layout */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.staff-page__messaging-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.messenger-client-staff-config {
  margin-bottom: 0;
}
.messenger-client-staff-config__summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.messenger-client-staff-config__summary::-webkit-details-marker {
  display: none;
}
.messenger-client-staff-config__hint {
  display: block;
  margin-top: 4px;
}
.messenger-client-staff-config__form {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.messenger-client-staff-config__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.messenger-client-staff-config__option {
  margin: 0;
}
.messenger-page .messages-header {
  margin-bottom: 0;
}
.messenger-toolbar {
  padding: 16px 18px;
}
.messenger-toolbar__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
}
.messenger-toolbar__field {
  margin-bottom: 0;
}
.messenger-new-group-wrap {
  margin-top: 0;
  margin-bottom: 4px;
}
.messenger-new-group-btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 0.9em;
  font-weight: 600;
  border-radius: 10px;
}
.messenger-new-group-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 1rem;
  line-height: 1;
}
.messenger-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  min-height: min(72vh, 720px);
  align-items: stretch;
}
.messenger-sidebar {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.messenger-sidebar__head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.messenger-search {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.92em;
  background: #f8fafc;
}
.messenger-thread-list-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: 480px;
  padding: 4px 0 8px;
}
.messenger-thread-section__label {
  margin: 10px 14px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.messenger-thread-section__divider {
  height: 1px;
  margin: 6px 12px 4px;
  background: var(--border);
}
.messenger-thread-list {
  list-style: none;
  margin: 0;
  padding: 4px 8px 8px;
}
.messenger-thread-list__empty,
.messenger-list-empty {
  padding: 16px 14px;
  font-size: 0.9em;
}
.messenger-list-empty {
  border-top: 1px solid var(--border);
  margin: 0;
}
.messenger-thread {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 0.12s ease;
}
.messenger-thread:hover,
.messenger-thread.is-active {
  background: var(--primary-light);
}
.messenger-thread.has-unread .messenger-thread__name {
  color: var(--primary-dark);
}
.messenger-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.messenger-avatar--lg {
  width: 48px;
  height: 48px;
  font-size: 0.9rem;
}
.messenger-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}
.messenger-thread__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.messenger-thread__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.messenger-thread__name {
  font-size: 0.95em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.messenger-thread__preview {
  font-size: 0.86em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.messenger-thread__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72em;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.messenger-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.messenger-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.messenger-panel__head-text {
  flex: 1 1 auto;
  min-width: 0;
}
.messenger-panel__title {
  margin: 0;
  font-size: 1.1rem;
}
.messenger-delete-group-form {
  flex-shrink: 0;
  margin: 0;
}
.messenger-delete-group-form .btn {
  white-space: nowrap;
}
.messenger-panel__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.messenger-bubbles {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 40%);
}
.messenger-bubbles__empty {
  margin: auto;
  text-align: center;
}
.messenger-bubble {
  max-width: min(85%, 520px);
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.messenger-bubble.is-out {
  align-self: flex-end;
  background: var(--primary-light);
  border-color: rgba(37, 99, 235, 0.2);
}
.messenger-bubble.is-in.is-unread {
  border-color: rgba(37, 99, 235, 0.45);
}
.messenger-bubble__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 4px;
  font-size: 0.82em;
}
.messenger-bubble__subject {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.92em;
}
.messenger-bubble__text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95em;
}
.messenger-compose {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  margin: 0;
  background: #f8fafc;
}
.messenger-compose__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.messenger-compose textarea {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 24px;
  max-height: 120px;
  resize: none;
  border: none;
  background: transparent;
  padding: 10px 0;
  margin: 0;
  font-size: 0.95em;
  line-height: 1.4;
  box-shadow: none;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: hidden;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.messenger-compose textarea:focus {
  outline: none;
  border: none;
  box-shadow: none;
}
.messenger-send-btn {
  flex-shrink: 0;
  align-self: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.messenger-send-btn:hover {
  background: var(--primary-dark);
}
.messenger-send-btn:active {
  transform: scale(0.96);
}
.messenger-member-search {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.92em;
  background: #f8fafc;
}
.messenger-member-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.messenger-member-search-empty {
  margin: 8px 0 0;
}
.messenger-member-picker {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.messenger-member-picker > li {
  margin: 0;
  padding: 0;
  transition: background 0.12s ease;
}
.messenger-member-picker > li + li {
  border-top: 1px solid var(--border);
}
.messenger-member-picker > li:hover {
  background: #fff;
}
.messenger-member-picker > li:has(input:checked) {
  background: var(--primary-light);
}
.messenger-member-picker > li:has(input:checked):hover {
  background: var(--primary-light);
}
.messenger-member-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin: 0;
  cursor: pointer;
  background: transparent;
}
.messenger-member-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.messenger-member-option__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.messenger-member-option__name {
  font-weight: 600;
  font-size: 0.92em;
}
.messenger-member-count.is-error {
  color: #b91c1c;
  font-weight: 600;
}
.messenger-member-hint {
  margin: 4px 0 0;
}
.messenger-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: 520px;
  max-width: calc(100vw - 32px);
  height: min(640px, calc(100vh - 32px));
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}
.messenger-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.messenger-group-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.messenger-modal .messenger-group-form {
  padding: 20px 22px 22px;
}
.messenger-group-form > .form-field:first-of-type {
  flex-shrink: 0;
}
.messenger-group-form > .form-field:nth-of-type(2) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  overflow: hidden;
}
.messenger-group-form .form-actions {
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 4px;
}
.messenger-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.messenger-modal__head h3 {
  margin: 0;
}
@media (max-width: 900px) {
  .messenger-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .messenger-sidebar {
    max-height: min(52vh, 480px);
  }
  .messenger-thread-list-wrap {
    max-height: min(46vh, 420px);
  }
  .messenger-panel {
    min-height: 360px;
  }
}
/* Capacitor app — give the conversation/recipient list more room on phone */
html[data-rithma-native-app="1"] .messenger-page .messenger-sidebar {
  max-height: min(58vh, 540px);
}
html[data-rithma-native-app="1"] .messenger-page .messenger-thread-list-wrap {
  max-height: min(52vh, 480px);
}
html[data-rithma-native-app="1"] .messenger-page .messenger-member-picker {
  min-height: 280px;
}
.messages-header {
  align-items: flex-start;
  margin-bottom: 0;
}
.messages-header h1 {
  margin-bottom: 4px;
}
.messages-header p {
  margin: 0;
  max-width: 680px;
}
.msg-filter-card {
  padding: 16px 18px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(20, 184, 166, 0.06)),
    var(--card);
}
.msg-filter-card select {
  max-width: 360px;
}
.messages-grid {
  align-items: start;
}
.msg-compose-card,
.msg-inbox-card,
.msg-sent-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}
.msg-compose-card {
  position: sticky;
  top: 18px;
}
.msg-sent-card {
  margin-top: 4px;
}
.msg-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.msg-card-head h3 {
  margin: 0 0 2px;
}
.msg-card-head p {
  margin: 0;
}
.msg-count-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.82em;
  font-weight: 700;
  white-space: nowrap;
}
.msg-compose-card select[multiple] {
  min-height: 190px;
  border-radius: 12px;
  background: #f8fafc;
}
.msg-compose-card textarea {
  min-height: 130px;
  border-radius: 12px;
}
.msg-compose-card input[type="text"] {
  border-radius: 12px;
}
.msg-list {
  list-style: none;
  padding: 2px;
  margin: 0;
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg-list > li {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.msg-list > li:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.msg-list > li.unread {
  border-color: rgba(37, 99, 235, 0.38);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.85), #ffffff);
}
.msg-list > li.unread .msg-meta strong { color: var(--primary-dark); }

/* The foldable element inside each <li> */
.msg-item { width: 100%; }
.msg-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  user-select: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  align-items: start;
  position: relative;
}
.msg-item > summary::-webkit-details-marker { display: none; }
.msg-item > summary::before {
  content: ">";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  margin-inline-start: var(--disclosure-marker-inset);
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  transition: transform 0.15s ease;
  font-size: 0.75em;
  font-weight: 800;
}
.msg-item[open] > summary::before { transform: rotate(90deg); }
.msg-item[data-unread="1"] > summary::after {
  content: '';
  position: absolute;
  top: 16px;
  right: 16px;
  display: block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
}
.msg-item .msg-snippet {
  grid-column: 2;
  display: block;
  margin: 2px 18px 0 0;
  color: var(--muted);
  font-size: 0.9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-item[data-unread="1"] .msg-snippet,
.msg-item[data-unread="1"] .msg-meta {
  font-weight: 500;
  color: var(--text);
}
.msg-item .msg-body {
  margin: 0 16px 16px 46px;
  padding: 12px 14px;
  border-left: 3px solid var(--primary-light);
  border-radius: 10px;
  background: #f8fafc;
  font-size: 0.95em;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.msg-meta {
  grid-column: 2;
  display: block;
  min-width: 0;
  padding-right: 18px;
  font-size: 0.92em;
  color: var(--text);
}
.msg-subject { font-weight: 600; }
.msg-empty {
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
@media (max-width: 800px) {
  .messages-page {
    gap: 14px;
  }
  .msg-compose-card {
    position: static;
  }
  .msg-card-head {
    align-items: flex-start;
  }
  .msg-list {
    max-height: none;
  }
}
@media (max-width: 520px) {
  .msg-card-head {
    flex-direction: column;
  }
  .msg-count-pill {
    align-self: flex-start;
  }
  .msg-item > summary {
    padding: 12px 14px;
  }
  .msg-item .msg-body {
    margin: 0 14px 14px;
  }
}

/* Inline-action mini forms (e.g. "Remove" inside a table row) should not
   add their own block spacing or stretch. */
table .form-group,
table form,
.row-flex form {
  margin: 0;
}

/* Address autocomplete suggestions */
.addr-suggest {
  position: fixed;
  z-index: 200;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.92em;
}
html[data-rithma-native-app="1"] .addr-suggest {
  /* Above bottom nav / chat chrome in the Capacitor shell. */
  z-index: 10060;
}
.addr-suggest-item {
  padding: 9px 12px;
  cursor: pointer;
  touch-action: manipulation;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  line-height: 1.35;
}
.addr-suggest-item:last-child { border-bottom: 0; }
.addr-suggest-item:hover,
.addr-suggest-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* Scroll-snap time picker */
.tp-wrap {
  position: relative;
  display: inline-block;
  margin-top: 4px;
}
.tp-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  cursor: pointer;
  min-width: 140px;
  justify-content: space-between;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.tp-display:hover {
  border-color: var(--primary);
}
.tp-display--empty {
  color: var(--muted);
  font-weight: 500;
}
.tp-wrap.tp-open .tp-display {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.tp-display-label {
  font-weight: 600;
}
.tp-display-caret {
  color: var(--muted);
  font-size: 0.8em;
  transition: transform 0.15s ease;
}
.tp-wrap.tp-open .tp-display-caret {
  transform: rotate(180deg);
}
.tp-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  padding: 10px;
}
.tp-panel--floating {
  position: fixed;
  top: auto;
  left: auto;
  bottom: auto;
  right: auto;
}
dialog[open] .tp-panel--floating {
  z-index: 10001;
}
.table-scroll:has(.tp-wrap.tp-open),
.manual-seg-panel:has(.tp-wrap.tp-open),
.schedule-change-split-dialog:has(.tp-wrap.tp-open),
.schedule-change-split-dialog:has(.tp-panel--floating) {
  overflow: visible;
}
.schedule-change-split-dialog__body:has(.tp-wrap.tp-open),
.schedule-change-split-dialog__surface:has(.tp-panel--floating) {
  overflow: visible;
}
.tp-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.tp-done {
  padding: 6px 14px;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.tp-done:hover { background: var(--primary-dark); }
.tp-picker {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px 10px;
  background: white;
  border-radius: 10px;
  width: max-content;
}
.tp-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 40px;
  transform: translateY(-50%);
  border-top: 1px solid var(--primary-light);
  border-bottom: 1px solid var(--primary-light);
  background: var(--primary-light);
  border-radius: 6px;
  pointer-events: none;
  opacity: 0.55;
}
.tp-col {
  position: relative;
  width: 56px;
  height: 200px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 1;
}
.tp-col::-webkit-scrollbar { display: none; }
.tp-col-inner {
  display: flex;
  flex-direction: column;
}
.tp-item {
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  color: var(--muted);
  scroll-snap-align: center;
  cursor: pointer;
  transition: color 0.15s ease, font-weight 0.15s ease, transform 0.15s ease;
  user-select: none;
}
.tp-item.tp-spacer {
  pointer-events: none;
  cursor: default;
}
.tp-item.tp-active {
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 1.2rem;
}
.tp-sep {
  align-self: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  padding: 0 2px;
  z-index: 2;
}

/* Agency: second-step removal confirmation modal */
.agency-removal-overlay[hidden],
.agency-removal-overlay[aria-hidden="true"] {
  display: none !important;
}
.agency-removal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
}
.agency-removal-overlay__dialog {
  width: min(100%, 420px);
  max-height: min(90vh, 520px);
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  border: 1px solid var(--border);
}
.agency-removal-overlay__head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.agency-removal-overlay__title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text);
}
.agency-removal-overlay__body {
  padding: 16px 20px;
}
.agency-removal-overlay__foot {
  padding: 12px 20px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}
.agency-removal-overlay__msg {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 0.95rem;
}
.agency-removal-overlay label.agency-removal-overlay__ack {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}
.agency-removal-overlay label.agency-removal-overlay__ack input {
  margin-top: 3px;
  flex-shrink: 0;
}

/* === Voice input ========================================================
   `static/js/voice-input.js` wraps qualifying text inputs / textareas in
   `.voice-input-wrap` and appends a mic button on the trailing edge.
   The button is only injected when an engine is verified available, so
   in environments without speech recognition this layer adds nothing
   to the page. */
.voice-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}
/* Reserve room on the right of the field for the mic button. The
   `!important` overrides the default 11px form-group padding. */
.voice-input-wrap > input,
.voice-input-wrap > textarea {
  padding-right: 42px !important;
}
.voice-input-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}
/* For single-line inputs, vertically centre the icon instead of pinning
   to the top — the input is short enough that centering looks better. */
.voice-input-wrap:not(.voice-input-wrap--textarea) .voice-input-btn {
  top: 50%;
  transform: translateY(-50%);
}
.voice-input-wrap:not(.voice-input-wrap--textarea) .voice-input-btn:active {
  transform: translateY(-50%) scale(0.92);
}
.voice-input-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.voice-input-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.voice-input-wrap--textarea .voice-input-btn:active {
  transform: scale(0.92);
}
/* Listening state — red mic with a soft ring pulse, mirroring the
   feedback iOS Dictation gives when the keyboard mic is active. */
.voice-input-btn--listening,
.voice-input-btn--listening:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  animation: voice-input-pulse 1.2s ease-in-out infinite;
}
.voice-input-btn--error {
  animation: voice-input-shake 0.4s linear 1;
  color: var(--danger);
}
@keyframes voice-input-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
@keyframes voice-input-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}
/* On single-line inputs the centering transform is needed during the
   shake / pulse, so override the keyframes to keep `translateY(-50%)`. */
.voice-input-wrap:not(.voice-input-wrap--textarea) .voice-input-btn--listening {
  animation: voice-input-pulse-centered 1.2s ease-in-out infinite;
}
.voice-input-wrap:not(.voice-input-wrap--textarea) .voice-input-btn--error {
  animation: voice-input-shake-centered 0.4s linear 1;
}
@keyframes voice-input-pulse-centered {
  0%, 100% {
    transform: translateY(-50%);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45);
  }
  50% {
    transform: translateY(-50%);
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }
}
@keyframes voice-input-shake-centered {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  25%      { transform: translateY(-50%) translateX(-3px); }
  75%      { transform: translateY(-50%) translateX(3px); }
}
/* Starting state — the mic was requested but native capture is not live yet
   (bringing up the iOS audio route takes a moment). Amber and a slow fade
   rather than the red "go ahead" pulse: anything said now is dropped, and it
   also starves Amazon Transcribe's language identification, which needs a full
   second of speech to tell which language it is hearing. Set alongside
   --listening, so these rules follow it to win on source order. */
.voice-input-btn--starting,
.voice-input-btn--starting:hover {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  animation: voice-input-starting 1.5s ease-in-out infinite;
}
.voice-input-wrap:not(.voice-input-wrap--textarea) .voice-input-btn--starting {
  animation: voice-input-starting-centered 1.5s ease-in-out infinite;
}
@keyframes voice-input-starting {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}
@keyframes voice-input-starting-centered {
  0%, 100% { transform: translateY(-50%); opacity: 0.5; }
  50%      { transform: translateY(-50%); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .voice-input-btn--starting,
  .voice-input-wrap:not(.voice-input-wrap--textarea) .voice-input-btn--starting {
    animation: none;
    opacity: 0.7;
    box-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .voice-input-btn--listening,
  .voice-input-wrap:not(.voice-input-wrap--textarea) .voice-input-btn--listening {
    animation: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35);
  }
  .voice-input-btn--error,
  .voice-input-wrap:not(.voice-input-wrap--textarea) .voice-input-btn--error {
    animation: none;
  }
}

/* === Shift schedule edit (agency shift_page.html) =========================
   The date/time pickers sit in the visit details card (first info card) and
   are bound to the schedule form further down via the ``form="…"`` attribute.
   They replace the read-only Date/Time text while editing. */
.shift-details-summary-row {
  align-items: flex-start;
}
[data-shift-schedule-cell].shift-schedule-cell--editing > .muted.text-sm {
  display: none;
}
.shift-schedule-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}
.shift-schedule-inline__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  flex: 0 0 auto;
}
.shift-schedule-inline__field label {
  font-size: 0.78em;
  line-height: 1.2;
  color: var(--muted);
}
/* Shared control height — native date + custom time-picker chip (.tp-display). */
.shift-schedule-inline input[type="date"],
.shift-schedule-inline--times .tp-display {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 140px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 14px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 42px;
  color: var(--text);
  background: white;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.shift-schedule-inline--times .tp-wrap {
  margin-top: 0;
  display: block;
  width: 100%;
}
.shift-schedule-inline--times .tp-display {
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.25;
}
.shift-schedule-inline input[type="date"]:hover,
.shift-schedule-inline--times .tp-display:hover {
  border-color: var(--primary);
}
.shift-schedule-inline input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
@media (max-width: 600px) {
  .shift-schedule-inline__field {
    min-width: 0;
    flex: 1 1 120px;
  }
}

/* === Shift Logs (per-shift Logs tab) ====================================
   Shared by every role's shift_page.html via templates/_shift_logs.html.
   The vital-signs sub-tab has 13 columns — too many for the default
   .table-app-list mobile reflow which would stack each row into a tall
   unreadable card. Instead we keep a real <table> with horizontal
   scroll, a sticky header, and a fixed visible-row cap that scrolls
   in place vertically when the list grows past ~10 rows. ====================== */

/* Log-type tab strip — wraps on desktop; single-row horizontal scroll on phones. */
.shift-logs-tabstrip-wrap {
  margin: 12px 0 16px;
  border-bottom: 1px solid var(--border);
}
.shift-logs-tabstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 2px;
}
.shift-logs-tab {
  gap: 6px;
}
.shift-logs-tab__label {
  min-width: 0;
}
.shift-logs-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--muted, #6b7280);
  background: color-mix(in srgb, var(--border, #e2e8f0) 55%, transparent);
}
.documents-tab--active .shift-logs-tab__count {
  color: var(--accent, #2563eb);
  background: color-mix(in srgb, var(--accent, #2563eb) 14%, var(--card));
}

.shift-logs-table-scroll {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  overflow-x: auto;
  overflow-y: auto;
  /* thead (~40px) + 10 typical rows (~44px) + 8px peek so the user
     sees there's more below the fold. Same heuristic as the global
     .table-scroll--max-rows utility, but kept local because that
     utility is desktop-only and we want phones to scroll vertically
     too. */
  max-height: calc(40px + 44px * 10 + 8px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.shift-logs-table {
  /* width: max-content forces columns to their natural width so they
     reach beyond the viewport and trigger horizontal scroll instead
     of squeezing into a too-narrow grid. */
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  margin: 0;
  background: transparent;
}
.shift-logs-table th,
.shift-logs-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  max-width: 280px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.shift-logs-table tbody td {
  white-space: normal;
}
.shift-logs-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted, #6b7280);
}
.shift-logs-table tbody tr:last-child td {
  border-bottom: 0;
}
.shift-logs-table tbody tr:hover td {
  background: var(--bg);
}

/* Add-entry form — clearly separates inputs, notes, and actions, and
   sizes each field by the column's declared `width` (set as the
   `--field-min` CSS variable from the spec) so wide fields like
   "Blood Sugar (mg/dL)" don't get the same width as a 2-character
   "Initials" cell. */
.shift-logs-add-form {
  margin-top: 4px;
  background: color-mix(in srgb, var(--card) 92%, var(--bg) 8%);
  padding: 14px 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shift-logs-add-form__header h4 {
  margin: 0 0 4px 0;
  font-size: 1rem;
}
.shift-logs-add-form__header p {
  margin: 0;
}
.shift-logs-add-form__grid-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.shift-logs-add-form__grid {
  display: grid;
  gap: 10px 12px;
  align-items: end;
  /* grid-template-columns + --shift-logs-col-count set inline from log spec */
  width: max-content;
  min-width: 100%;
}
.shift-logs-add-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  min-width: 0;
}
.shift-logs-add-form__field > span {
  font-weight: 600;
  color: var(--muted, #6b7280);
  line-height: 1.3;
  white-space: nowrap;
}
/* Shared field control — label-wrapped inputs in shift log forms (Add entry,
   Correct entry, Save log targets). Class-based so date/time/number always
   pick up chrome regardless of DOM structure or time-picker upgrades. */
.shift-logs-field-control {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.35;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}
.shift-logs-field-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.shift-logs-field-control[type="date"],
.shift-logs-field-control[type="time"] {
  color-scheme: light;
}
.shift-logs-field-control[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
.shift-logs-field-control[type="number"]::-webkit-outer-spin-button,
.shift-logs-field-control[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
textarea.shift-logs-field-control {
  resize: vertical;
  min-height: 4.5rem;
}
/* Legacy child selectors — keep for any field without the class. */
.shift-logs-add-form__field > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.shift-logs-add-form__notes > textarea,
.shift-logs-add-form__field > select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.35;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}
.shift-logs-add-form__field > input[type="date"],
.shift-logs-add-form__field > input[type="time"] {
  color-scheme: light;
}
.shift-logs-add-form__field > input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
.shift-logs-add-form__field > input[type="number"]::-webkit-outer-spin-button,
.shift-logs-add-form__field > input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.shift-logs-add-form__field > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.shift-logs-add-form__notes > textarea:focus,
.shift-logs-add-form__field > select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
/* Time picker fallback if ever enabled inside shift logs. */
.shift-logs-add-form__field > .tp-wrap {
  display: block;
  width: 100%;
  margin-top: 0;
}
.shift-logs-add-form__field > .tp-wrap > .tp-display {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--card, #fff);
  box-sizing: border-box;
  justify-content: space-between;
}
.shift-logs-add-form__field > .tp-wrap > .tp-display .tp-display-label {
  font-weight: 400;
}
.shift-logs-add-form__field > .tp-wrap.tp-open > .tp-display,
.shift-logs-add-form__field > .tp-wrap > .tp-display:hover {
  border-color: var(--primary);
}
.shift-logs-add-form__field > .tp-wrap.tp-open > .tp-display {
  box-shadow: 0 0 0 3px var(--primary-light);
}
.shift-logs-add-form__field > .tp-wrap > .tp-display--empty {
  color: var(--muted, #6b7280);
  font-weight: 500;
}
.shift-logs-add-form__notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  flex: 1 1 100%;
}
.shift-logs-add-form__notes > span {
  font-weight: 600;
  color: var(--muted, #6b7280);
  line-height: 1.3;
}
.shift-logs-add-form__notes > textarea:not(.shift-logs-field-control) {
  resize: vertical;
  min-height: 4.5rem;
}
.shift-logs-add-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  #shift-logs-card .shift-logs-intro {
    display: none;
  }
  .shift-logs-tabstrip-wrap {
    margin: 4px -16px 12px;
    padding: 0 16px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    border-bottom: 0;
    /* Fade hints that more log types sit off-screen. */
    mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 12px,
      #000 calc(100% - 20px),
      transparent 100%
    );
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 12px,
      #000 calc(100% - 20px),
      transparent 100%
    );
  }
  .shift-logs-tabstrip-wrap::-webkit-scrollbar {
    display: none;
  }
  .shift-logs-tabstrip {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    gap: 8px;
    padding-bottom: 0;
    border-bottom: 0;
  }
  .shift-logs-tabstrip .shift-logs-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.86rem;
    border-radius: 999px;
    border-bottom: none;
    margin-bottom: 0;
    background: color-mix(in srgb, var(--border, #e2e8f0) 42%, var(--card));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border, #e2e8f0) 80%, transparent);
  }
  .shift-logs-tabstrip .shift-logs-tab.documents-tab--active {
    color: var(--accent, #2563eb);
    background: color-mix(in srgb, var(--accent, #2563eb) 10%, var(--card));
    border-bottom-color: transparent;
    box-shadow: inset 0 0 0 1.5px var(--accent, #2563eb);
  }
  .shift-logs-add-form__actions {
    justify-content: stretch;
  }
  .shift-logs-add-form__actions > .btn {
    flex: 1 1 auto;
  }
  .shift-logs-table-scroll {
    /* Slightly shorter cap so the table doesn't dominate small screens. */
    max-height: calc(40px + 44px * 6 + 8px);
  }
  .shift-logs-table th,
  .shift-logs-table td {
    min-width: 72px;
    word-break: normal;
    overflow-wrap: normal;
  }
}

/* Inline “Correct entry” disclosure — hide default marker when summary is styled as a button. */
.shift-log-row-correct > summary {
  list-style: none;
}
.shift-log-row-correct > summary::-webkit-details-marker {
  display: none;
}

/* Log targets (header fields) — folded by default above the entry table */
.shift-log-targets {
  background: var(--bg);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.shift-log-targets__summary {
  font-weight: 600;
}
.shift-log-targets__title {
  display: inline;
}
.shift-log-targets__preview {
  display: inline;
  font-weight: 400;
  margin-left: 0.35em;
}
.shift-log-targets__body {
  margin-top: 12px;
}

/* Profile secondary nav (Profile / Billing tabs under account settings) */
.profile-secondary-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 20px;
  padding: 5px;
  background: color-mix(in srgb, var(--border, #e2e8f0) 45%, transparent);
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
}
.profile-secondary-nav__tab {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted, #64748b);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.profile-secondary-nav__tab:hover {
  color: var(--text, #0f172a);
  background: color-mix(in srgb, var(--surface, #fff) 70%, transparent);
}
.profile-secondary-nav__tab.is-active {
  color: var(--text, #0f172a);
  background: var(--surface, #fff);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Profile pages — one consistent column width for every card on the page */
.profile-page-content {
  max-width: 800px;
}
.profile-page-content .card {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.profile-settings-footer {
  margin-top: 8px;
  padding-bottom: max(16px, var(--rithma-safe-bottom));
}

.profile-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 20px 0 4px;
  border-top: 1px solid var(--border, #e2e8f0);
  font-size: 0.875rem;
  line-height: 1.4;
}

.profile-legal-links a {
  color: var(--muted, #64748b);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.profile-legal-links a:hover,
.profile-legal-links a:focus-visible {
  color: var(--text, #0f172a);
}

/* Profile → Notifications preference matrix */
.notification-prefs-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 920px;
}
.notification-prefs-category__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
}
.notification-prefs-table-wrap {
  overflow-x: auto;
}
.notification-prefs-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.notification-prefs-table th,
.notification-prefs-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  vertical-align: middle;
  text-align: left;
  max-width: 280px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.notification-prefs-table thead th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}
.notification-prefs-table th.notification-prefs-table__channel,
.notification-prefs-table td.notification-prefs-table__channel {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
  vertical-align: middle;
}
.notification-prefs-table__item {
  width: auto;
  max-width: 480px;
}
.notification-prefs-table__item strong {
  display: block;
  margin-bottom: 2px;
}
.notification-prefs-table__desc {
  margin: 0;
  max-width: 520px;
}
.notification-prefs-table td.notification-prefs-table__channel .scheduler-switch {
  display: inline-block;
  vertical-align: middle;
}
.notification-prefs-table td.notification-prefs-table__channel .muted {
  display: inline-block;
  line-height: 24px;
}
.notification-prefs-actions {
  padding: 16px 20px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Agency profile — configuration section jump nav + cards */
.config-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 5px;
  max-width: 960px;
  background: color-mix(in srgb, var(--border, #e2e8f0) 45%, transparent);
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
}
.config-section-nav__link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  transition: background 0.15s ease, color 0.15s ease;
}
.config-section-nav__link:hover {
  color: var(--text, #0f172a);
  background: color-mix(in srgb, var(--surface, #fff) 70%, transparent);
}
.config-section-nav__link.is-active {
  color: var(--text, #0f172a);
  background: var(--surface, #fff);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Compliance — header, action center, ready strip */
.compliance-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.compliance-subhead__text {
  min-width: 0;
}
.compliance-subhead__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}
.compliance-subhead__desc {
  margin: 4px 0 0;
  max-width: 760px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-muted, #64748b);
}
.compliance-subhead__count {
  flex: 0 0 auto;
}
.compliance-page-header {
  align-items: flex-start;
}
.compliance-page-header__badge {
  flex: 0 0 auto;
  align-self: center;
}
.compliance-layout {
  max-width: none;
}

/* Compliance tables: cap height and scroll vertically inside the card while
   keeping the column headers (and any sticky id/name columns) pinned. The
   wrapper already scrolls horizontally; we add a max-height + vertical scroll
   and make <thead> sticky so headers stay visible during long lists. */
.compliance-layout .table-scroll {
  max-height: 60vh;
  overflow-y: auto;
}
.compliance-layout .table-scroll > .table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--bg);
}
/* Corner cells that are both a sticky header and a sticky column must sit
   above the sticky header row and sticky body columns. */
.compliance-layout .table-scroll > .table.table-sticky-1 > thead > tr > th:first-child,
.compliance-layout .table-scroll > .table.table-sticky-2 > thead > tr > th:nth-child(1),
.compliance-layout .table-scroll > .table.table-sticky-2 > thead > tr > th:nth-child(2) {
  z-index: 5;
}

.compliance-actioncenter {
  margin-bottom: 14px;
}
.compliance-actioncenter__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.compliance-actioncenter__title {
  margin: 0;
  font-size: 1.15rem;
}
.compliance-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  text-align: center;
  line-height: 1.1;
}
.compliance-score.is-warn {
  border-color: color-mix(in srgb, var(--warning, #d97706) 45%, transparent);
  background: color-mix(in srgb, var(--warning, #d97706) 10%, transparent);
}
.compliance-score.is-ok {
  border-color: color-mix(in srgb, var(--success, #16a34a) 45%, transparent);
  background: color-mix(in srgb, var(--success, #16a34a) 10%, transparent);
}
.compliance-score__num {
  font-size: 1.6rem;
  font-weight: 700;
}
.compliance-score.is-warn .compliance-score__num {
  color: var(--warning, #b45309);
}
.compliance-score.is-ok .compliance-score__num {
  color: var(--success, #15803d);
}
.compliance-score__label {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
}
.compliance-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compliance-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warning, #d97706) 35%, transparent);
  background: color-mix(in srgb, var(--warning, #d97706) 7%, transparent);
  text-decoration: none;
  color: var(--text, #0f172a);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.compliance-action-row:hover {
  background: color-mix(in srgb, var(--warning, #d97706) 14%, transparent);
  border-color: color-mix(in srgb, var(--warning, #d97706) 55%, transparent);
}
.compliance-action-row:active {
  transform: translateY(1px);
}
.compliance-action-row__mark {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: var(--warning, #d97706);
}
.compliance-action-row__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.compliance-action-row__title {
  font-weight: 600;
}
.compliance-action-row__count {
  flex: 0 0 auto;
}
.compliance-action-row__go {
  flex: 0 0 auto;
  color: var(--text-muted, #64748b);
  font-size: 1.1rem;
}
.compliance-actioncenter__allclear {
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--success, #16a34a) 40%, transparent);
  background: color-mix(in srgb, var(--success, #16a34a) 8%, transparent);
  color: var(--success, #15803d);
  font-weight: 500;
}
.compliance-ready-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.compliance-ready-strip__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.compliance-ready-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--success, #16a34a) 30%, transparent);
  background: color-mix(in srgb, var(--success, #16a34a) 7%, transparent);
  color: var(--text, #0f172a);
  font-size: 0.82rem;
  text-decoration: none;
}
.compliance-ready-chip:hover {
  border-color: color-mix(in srgb, var(--success, #16a34a) 55%, transparent);
}
.compliance-ready-chip__check {
  color: var(--success, #15803d);
  font-weight: 700;
}

/* Preferences / Connections — two-column layout with a sticky right-side jump rail. */
.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
  max-width: 1280px;
}
.config-layout__main {
  grid-column: 1;
  min-width: 0;
  max-width: none;
  width: 100%;
}
.config-layout > .config-layout__main.config-form-stack {
  max-width: none;
}
.config-layout__main.config-form-stack {
  gap: 12px;
}
.config-layout .config-section-card {
  padding: 16px 18px;
}
.config-layout .config-section-card__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.config-layout .config-section-card__intro {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.config-layout .config-section-card__subtitle {
  margin: 16px 0 8px;
  font-size: 0.95rem;
}
.config-layout .config-section-ui__header {
  gap: 10px 12px;
  margin-bottom: 2px;
}
.config-layout .config-section-ui__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.config-layout .config-section-ui__icon svg {
  width: 20px;
  height: 20px;
}
.config-layout__aside {
  grid-column: 2;
  position: sticky;
  top: 8px;
  align-self: start;
  min-width: 0;
  max-width: 100%;
}
.config-rail-toggle,
.config-rail-scrim {
  display: none;
}
.config-rail-panel {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
/* Double-class selector beats base .config-section-nav pill bar (flex-wrap, max-width). */
.config-section-nav.config-section-nav--rail {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2px;
  margin: 0;
  padding: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: min(calc(100dvh - 24px), 680px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.config-section-nav--rail .config-section-nav__heading {
  margin: 2px 0 8px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.config-section-nav--rail .config-section-nav__link {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  font-size: 0.875rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.config-section-nav--rail .config-section-nav__link:hover {
  background: color-mix(in srgb, var(--border, #e2e8f0) 40%, transparent);
}
.config-section-nav--rail .config-section-nav__link.is-active {
  color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 9%, transparent);
  border-left-color: var(--primary, #2563eb);
  box-shadow: none;
  font-weight: 600;
}

/* Grouped rail (Connections) — section categories with labels in the rail. */
.config-section-nav--rail .config-section-nav__group {
  display: block;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
}
.config-section-nav--rail-grouped .config-section-nav__group {
  display: block;
  margin: 0;
  padding: 0;
}
.config-section-nav--rail-grouped .config-section-nav__group + .config-section-nav__group {
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-left: 0;
  border-top: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 70%, transparent);
}
.config-section-nav--rail-grouped .config-section-nav__group-label {
  display: block;
  padding: 0 12px 6px;
}
.config-section-nav--rail-grouped .config-section-nav__links {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 2px;
  min-width: 0;
}
/* The link display rules above override the UA [hidden] {display:none}, which
   would leave service-line-gated links (e.g. Medicaid & EVV) visible when the
   JS hides them. Force-hide so the rail reflows cleanly with no empty slot. */
.config-section-nav__link[hidden],
.config-section-nav__group[hidden] {
  display: none !important;
}

/* Narrow viewports: keep the vertical rail but hide it behind a right-edge toggle. */
@media (max-width: 1024px) {
  .config-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 960px;
  }
  .config-layout__main,
  .config-layout__aside {
    grid-column: 1;
  }
  .config-layout__aside {
    position: static;
    order: 0;
  }
  .config-rail-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 52;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 72px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border, #e2e8f0);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    background: var(--surface, #fff);
    color: var(--text-muted, #64748b);
    box-shadow: -2px 0 12px rgba(15, 23, 42, 0.1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  }
  .config-rail-toggle:hover {
    color: var(--primary, #2563eb);
    background: color-mix(in srgb, var(--primary, #2563eb) 6%, var(--surface, #fff));
  }
  .config-rail-toggle__chevron {
    transition: transform 200ms ease;
  }
  .config-layout__aside.is-rail-open .config-rail-toggle__chevron {
    transform: rotate(180deg);
  }
  .config-rail-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }
  .config-rail-scrim:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }
  .config-rail-panel {
    display: none;
    position: fixed;
    z-index: 51;
    top: max(12px, calc(var(--rithma-safe-top) + 8px));
    right: 0;
    bottom: max(12px, calc(var(--rithma-safe-bottom) + 8px));
    width: min(288px, calc(100vw - 48px));
    max-width: 100%;
  }
  .config-layout__aside.is-rail-open .config-rail-panel {
    display: block;
  }
  .config-layout__aside.is-rail-open .config-rail-panel .config-section-nav--rail {
    height: 100%;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.14);
    border-radius: 14px 0 0 14px;
  }
}

.config-section-nav__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.config-section-nav__group + .config-section-nav__group {
  padding-left: 10px;
  margin-left: 4px;
  border-left: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 80%, transparent);
}
.config-section-nav--grouped {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--border, #e2e8f0) 28%, var(--surface, #fff));
}
.config-section-nav--grouped .config-section-nav__group {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 12px 10px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.config-section-nav--grouped .config-section-nav__group + .config-section-nav__group {
  padding-left: 12px;
  margin-left: 0;
  border-left: none;
}
.config-section-nav--grouped .config-section-nav__group-label {
  display: block;
  width: 100%;
  padding: 0 0 8px;
  margin: 0 0 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 70%, transparent);
  font-size: 0.7rem;
}
.config-section-nav--grouped .config-section-nav__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.config-section-nav--grouped .config-section-nav__link {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  text-align: left;
}
.config-section-nav__group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  padding: 0 4px 0 2px;
}
.connections-type-section {
  scroll-margin-top: 88px;
}
.connections-type-section__header {
  margin-bottom: 12px;
}
.connections-type-section__title {
  margin: 0 0 4px;
  font-size: 1.2rem;
}
.connections-type-section__intro {
  margin: 0;
  max-width: 720px;
}
.connections-type-section__stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.config-form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 960px;
}
.config-section-card {
  padding: 20px 22px;
  scroll-margin-top: 88px;
}
.config-section-card__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.config-section-card__intro {
  max-width: 720px;
  margin: 0 0 16px;
}
.config-section-card__subtitle {
  margin: 20px 0 10px;
  font-size: 1rem;
}
.config-section-card__row {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}
.config-section-card__row:first-of-type {
  margin-top: 0;
}
.config-section-card__note {
  margin: 0 0 16px;
}
.config-subsection-card {
  padding: 14px 16px;
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.config-subsection-card legend {
  font-weight: 700;
  padding: 0 6px;
}

.task-assignment-mode-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  /* Fieldsets default to min-width: min-content, which prevents the mode
     grid from shrinking inside the preferences main column + rail layout. */
  min-width: 0;
  width: 100%;
}
#config-task-assignment {
  container-type: inline-size;
  container-name: config-task-assignment;
}
.task-assignment-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 920px;
  width: 100%;
}
.task-assignment-mode-card {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.task-assignment-mode-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.task-assignment-mode-card__surface {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--bg, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.task-assignment-mode-card:hover .task-assignment-mode-card__surface {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.03);
}
.task-assignment-mode-card input:focus-visible + .task-assignment-mode-card__surface {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.task-assignment-mode-card input:checked + .task-assignment-mode-card__surface {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.07);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}
.task-assignment-mode-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.task-assignment-mode-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.task-assignment-mode-card input:checked + .task-assignment-mode-card__surface .task-assignment-mode-card__title {
  color: var(--primary);
}
.task-assignment-mode-card__badge {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.task-assignment-mode-card__badge--auto {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}
.task-assignment-mode-card input:checked + .task-assignment-mode-card__surface .task-assignment-mode-card__badge--auto {
  background: rgba(37, 99, 235, 0.16);
}
.task-assignment-mode-card__desc {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
.task-assignment-mode-card input:checked + .task-assignment-mode-card__surface .task-assignment-mode-card__desc {
  color: var(--text);
}
.task-assignment-mode-card__points {
  margin: 0;
  padding: 0 0 0 1.1em;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}
.task-assignment-mode-card__points li + li {
  margin-top: 6px;
}
.config-layout .task-assignment-mode-card,
.config-layout .task-assignment-mode-card__surface,
.config-layout .task-assignment-mode-card__title,
.config-layout .task-assignment-mode-card__desc,
.config-layout .task-assignment-mode-card__points {
  overflow-wrap: normal;
  word-break: normal;
}
@container config-task-assignment (max-width: 560px) {
  .task-assignment-mode-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .task-assignment-mode-grid {
    grid-template-columns: 1fr;
  }
}

/* Profile -> Preferences — shared section UI (summary panels + settings) */
.config-section-ui__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 14px;
  margin-bottom: 4px;
}
/* The text block (title + intro) is the only direct <div> child; let it grow so
   the optional status badge is pushed to the right and wraps below on narrow. */
.config-section-ui__header > div {
  flex: 1 1 260px;
  min-width: 0;
}
.config-section-ui__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--primary, #2563eb) 11%, var(--surface, #fff));
  color: var(--primary, #2563eb);
}
.config-section-ui__icon svg {
  width: 22px;
  height: 22px;
}
.config-section-ui__intro {
  margin-bottom: 0;
}
.config-section-ui__status-badge {
  flex-shrink: 0;
  margin-top: 4px;
}
.config-section-ui__alert {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(234, 179, 8, 0.35);
  background: rgba(254, 243, 199, 0.45);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}
.config-section-ui__alert--warn {
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(255, 237, 213, 0.55);
}
.config-section-ui__panels {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.2fr);
  gap: 14px;
  margin-top: 16px;
}
.config-section-ui__panels--single {
  grid-template-columns: 1fr;
}
.config-section-ui__panel {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg, #fafafa);
  min-width: 0;
}
.config-section-ui__panel-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
}
.config-section-ui__panel-intro {
  margin: -4px 0 12px;
}
.config-section-ui__facts {
  display: grid;
  gap: 12px;
  margin: 0;
}
.config-section-ui__fact {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  gap: 8px 12px;
  align-items: baseline;
}
.scheduling-limits-grid {
  display: grid;
  gap: 16px;
  max-width: 420px;
}
.scheduling-limits-row {
  display: grid;
  gap: 6px;
}
.scheduling-limits-hours-input {
  max-width: 8rem;
}
.config-section-ui__fact dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.config-section-ui__fact dd {
  margin: 0;
  font-size: 0.95rem;
}
.config-section-ui__fact-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}
.config-section-ui__source {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}
.config-section-ui__stats {
  margin-bottom: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.config-section-ui__stats .stat-card {
  padding: 12px 14px;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--card);
}
.config-section-ui__stats .stat-card .value {
  font-size: 1.55rem;
}
.config-section-ui__stats .stat-card .value.stat-value--ok { color: var(--success); }
.config-section-ui__stats .stat-card .value.stat-value--warn { color: var(--warning); }
.config-section-ui__stats .stat-card .value.stat-value--danger { color: var(--danger); }
.config-section-ui__footnote {
  margin: 14px 0 0;
}
.config-section-ui__empty {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
}
.config-section-ui__empty-title {
  margin: 0 0 8px;
  font-weight: 700;
}
.config-section-ui__empty-body {
  margin: 0 0 12px;
  max-width: 640px;
}
.config-section-ui__empty-list {
  margin: 0;
  padding-left: 1.2rem;
  max-width: 640px;
}
.config-section-ui__empty-list li + li {
  margin-top: 4px;
}
.config-section-ui__settings {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.config-section-ui__packages-table {
  margin-bottom: 12px;
}
.config-section-ui__add-package {
  margin-bottom: 8px;
}
.config-section-ui__field-input {
  min-width: 280px;
  max-width: 100%;
}
.config-section-ui__field-input--narrow {
  min-width: 120px;
  max-width: 100%;
}
.config-section-ui__checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  line-height: 1.35;
}
.config-section-ui__checkbox-list input[type="checkbox"] {
  flex: 0 0 auto;
}
.config-section-ui__checkbox-help {
  margin: 4px 0 0 26px;
  max-width: 640px;
  line-height: 1.45;
}
.agency-shift-chat-panel-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.agency-shift-chat-panel__thread {
  --shift-chat-thread-height: auto;
  flex: 1 1 auto;
  min-height: 200px;
  max-height: min(70vh, calc(100vh - 12rem));
  overflow-y: auto;
  margin-top: 8px;
  padding: 4px 0;
}
.config-section-ui__checkbox-list--vaccinations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 14px;
}
.config-section-ui__checkbox-list--vaccinations label {
  margin-bottom: 0;
}
.config-section-ui__inline-add {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
}
.config-section-ui__inline-add .input {
  flex: 1 1 auto;
  min-width: 0;
}
.config-role-types {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.config-role-types__item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted, rgba(0, 0, 0, 0.02));
}
.config-role-types__label {
  font-weight: 600;
}
.config-role-types__slug {
  font-size: 12px;
  color: var(--muted);
}
.config-role-types__remove {
  margin-left: auto;
}
.config-role-types__add {
  margin-top: 4px;
  flex-wrap: nowrap;
  max-width: 100%;
  width: 100%;
}
.config-role-types__add input {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}
.config-role-types__add .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.config-role-types__suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.config-section-ui__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Profile → Connections — Stripe / QuickBooks / Xero integration cards */
.integration-connect-card {
  padding: 0;
  overflow: hidden;
}
.integration-connect-card__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, #fff 100%);
}
.integration-connect-card--stripe .integration-connect-card__hero {
  background: linear-gradient(135deg, rgba(99, 91, 255, 0.07) 0%, rgba(248, 250, 252, 0.4) 55%, #fff 100%);
}
.integration-connect-card--quickbooks .integration-connect-card__hero {
  background: linear-gradient(135deg, rgba(44, 160, 28, 0.08) 0%, rgba(248, 250, 252, 0.4) 55%, #fff 100%);
}
.integration-connect-card--xero .integration-connect-card__hero {
  background: linear-gradient(135deg, rgba(19, 181, 234, 0.1) 0%, rgba(248, 250, 252, 0.4) 55%, #fff 100%);
}
.integration-connect-card--checkr .integration-connect-card__hero {
  background: linear-gradient(135deg, rgba(0, 163, 224, 0.1) 0%, rgba(248, 250, 252, 0.4) 55%, #fff 100%);
}
.integration-connect-card--gusto .integration-connect-card__hero {
  background: linear-gradient(135deg, rgba(244, 93, 72, 0.1) 0%, rgba(248, 250, 252, 0.4) 55%, #fff 100%);
}
.integration-connect-card--adp .integration-connect-card__hero {
  background: linear-gradient(135deg, rgba(208, 39, 29, 0.08) 0%, rgba(248, 250, 252, 0.4) 55%, #fff 100%);
}
.integration-connect-card--quickbooks-payroll .integration-connect-card__hero {
  background: linear-gradient(135deg, rgba(44, 160, 28, 0.06) 0%, rgba(8, 131, 216, 0.08) 55%, #fff 100%);
}
.integration-connect-card__brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  flex: 1 1 280px;
}
.integration-connect-card__logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.integration-connect-card__logo-img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.integration-connect-card__logo svg {
  display: block;
  width: 28px;
  height: 28px;
}
.integration-connect-card--stripe .integration-connect-card__logo,
.integration-connect-card--quickbooks .integration-connect-card__logo,
.integration-connect-card--xero .integration-connect-card__logo,
.integration-connect-card--checkr .integration-connect-card__logo,
.integration-connect-card--gusto .integration-connect-card__logo,
.integration-connect-card--adp .integration-connect-card__logo,
.integration-connect-card--quickbooks-payroll .integration-connect-card__logo,
.integration-connect-card--docusign .integration-connect-card__logo {
  background: #fff;
  color: inherit;
}
.integration-connect-card--checkr .integration-connect-card__logo-img {
  width: auto;
  max-width: 34px;
  height: 30px;
}
.integration-connect-card--docusign .integration-connect-card__logo {
  padding: 6px;
}
.integration-connect-card--docusign .integration-connect-card__logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.docusign-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.docusign-page__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.14) 0%, rgba(255, 255, 255, 0.96) 48%, rgba(37, 99, 235, 0.06) 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.docusign-page__hero-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
  flex: 1 1 320px;
}
.docusign-page__brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}
.docusign-page__logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
}
.docusign-page__title {
  margin: 0 0 4px;
  font-size: 1.6rem;
  line-height: 1.15;
}
.docusign-page__tagline {
  margin: 0;
  max-width: 42rem;
}
.docusign-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 0 1 auto;
}
.docusign-stat {
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.docusign-stat__value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}
.docusign-stat__label {
  display: block;
  margin-top: 4px;
  color: var(--muted, #64748b);
  font-size: 0.82rem;
}
.docusign-connection-bar {
  padding: 14px 18px;
}
.docusign-connection-bar__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.docusign-connection-bar__text {
  margin: 0;
  font-size: 0.92rem;
}
.docusign-tabs {
  margin-bottom: 0;
}
.docusign-tab-panel {
  padding: 24px;
}
.docusign-panel + .docusign-panel {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.docusign-panel__head {
  margin-bottom: 18px;
}
.docusign-panel__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
}
.docusign-panel__intro {
  margin: 0;
}
.docusign-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}
.docusign-form__grid--envelope {
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .docusign-form__grid--envelope {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    align-items: start;
  }
  .docusign-form__message-field {
    grid-row: span 1;
  }
}
.docusign-form .form-field {
  margin-bottom: 0;
}
.docusign-field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9em;
  color: var(--text);
}
.docusign-form-section {
  padding: 18px 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg, #f8fafc) 55%, var(--card, #fff));
}
.docusign-form-section__head {
  margin-bottom: 14px;
}
.docusign-form-section__title {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}
.docusign-form-section__hint {
  margin: 0;
  line-height: 1.45;
}
.docusign-doc-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.docusign-doc-picker__label {
  display: block;
  margin-bottom: 2px;
  font-weight: 500;
  font-size: 0.9em;
  color: var(--text);
}
.docusign-doc-picker__scroll {
  max-height: min(40vh, 280px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--card, #fff);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.docusign-doc-picker__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.docusign-doc-picker__item:hover {
  background: rgba(37, 99, 235, 0.04);
}
.docusign-doc-picker__item:has(input:checked) {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
}
.docusign-doc-picker__item input {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin: 2px 0 0;
  accent-color: var(--primary, #2563eb);
}
.docusign-doc-picker__item-text {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}
.docusign-doc-picker__meta {
  margin: 0;
}
.docusign-send-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-top: 4px;
  margin-top: 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.docusign-send-footer__note {
  margin: 0;
  flex: 1 1 220px;
  line-height: 1.45;
}
.docusign-send-footer__submit {
  flex: 0 0 auto;
  margin-left: auto;
}
.docusign-add-recipient-btn {
  margin-top: 12px;
}
.docusign-empty-state {
  padding: 28px 24px;
  text-align: center;
  background: color-mix(in srgb, var(--bg, #f8fafc) 70%, var(--card, #fff));
}
.docusign-empty-state__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
}
.docusign-empty-state__text {
  margin: 0 0 16px;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}
.docusign-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.docusign-subheading {
  margin: 0 0 12px;
  font-size: 0.95rem;
}
.docusign-recipients {
  margin-top: 8px;
}
.docusign-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.docusign-row-header__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.docusign-row-header .btn-link {
  flex-shrink: 0;
  padding: 0;
  min-height: 0;
  font-size: 0.8125rem;
}
.docusign-recipient-row {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card, #fff);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.docusign-recipient-row:last-child {
  margin-bottom: 0;
}
.docusign-recipient-row__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.docusign-recipient-row__fields .form-field {
  flex: 1 1 180px;
  margin: 0;
}
.docusign-recipient-row--placer-active {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 45%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #2563eb) 12%, transparent);
}
.docusign-signature-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.docusign-sig-tab-row {
  padding: 16px;
  background: var(--card, #fff);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.docusign-sig-tab-row__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.docusign-sig-tab-row__fields .form-field {
  flex: 1 1 180px;
  margin: 0;
}
.docusign-sig-tab-row--placer-active {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 45%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #2563eb) 12%, transparent);
}
.docusign-send-placer {
  margin-top: 12px;
}
.docusign-recipient-prefill-field {
  flex: 1 1 100%;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.1);
}
.docusign-template-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.docusign-template-mode {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: var(--card, #fff);
  color: var(--text);
  padding: 8px 16px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.docusign-template-mode:hover {
  border-color: rgba(37, 99, 235, 0.35);
}
.docusign-template-mode.is-active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary, #2563eb);
}
.docusign-template-role-row__title {
  margin: 0 0 12px;
}
.docusign-template-shared-roles,
.docusign-template-bulk-recipients {
  margin-top: 16px;
}
.docusign-template-bulk-recipients .docusign-subheading {
  margin-top: 0;
}
.docusign-template-roles .docusign-template-role-row {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card, #fff);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.docusign-template-bulk-roles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--card, #fff);
}
.docusign-template-bulk-role-item {
  margin: 0;
}
.docusign-bulk-table-scroll {
  overflow-x: auto;
  margin-bottom: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: var(--card, #fff);
}
.docusign-bulk-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.docusign-bulk-table th,
.docusign-bulk-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  vertical-align: middle;
}
.docusign-bulk-table th {
  background: color-mix(in srgb, var(--bg, #f8fafc) 70%, var(--card, #fff));
  font-weight: 600;
  white-space: nowrap;
}
.docusign-bulk-table tr:last-child td {
  border-bottom: none;
}
.docusign-bulk-table-input {
  width: 100%;
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font: inherit;
  font-size: 0.92rem;
}
.docusign-bulk-table-input:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.docusign-bulk-table-prefill-col {
  min-width: 168px;
}
.docusign-bulk-table-prefill-cell {
  min-width: 168px;
  vertical-align: middle;
}
.docusign-bulk-table-prefill-wrap {
  min-width: 156px;
}
.docusign-bulk-table-prefill {
  width: 100%;
  min-width: 156px;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font: inherit;
  font-size: 0.92rem;
  background: var(--card, #fff);
}
.docusign-bulk-table-prefill:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.docusign-template-shared-role-row {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card, #fff);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

/* DocuSign envelope list + detail */
.docusign-envelope-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.docusign-envelope-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 10px);
  background: var(--card, #fff);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow, 0 1px 2px rgba(15, 23, 42, 0.06));
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}
.docusign-envelope-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
  text-decoration: none;
  color: inherit;
  transform: translateY(-1px);
}
.docusign-envelope-card:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}
.docusign-envelope-card--pending {
  border-left: 4px solid var(--warning, #f59e0b);
}
.docusign-envelope-card--completed {
  border-left: 4px solid var(--success, #16a34a);
}
.docusign-envelope-card--declined {
  border-left: 4px solid var(--danger, #dc2626);
}
.docusign-envelope-card--voided,
.docusign-envelope-card--default {
  border-left: 4px solid var(--border, #e2e8f0);
}
.docusign-envelope-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.docusign-envelope-card__ready {
  margin-left: auto;
  font-weight: 600;
  color: var(--success, #16a34a);
}
.docusign-envelope-card__title {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text, #0f172a);
}
.docusign-envelope-card__subject {
  margin: 0 0 8px;
  line-height: 1.4;
}
.docusign-envelope-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.84rem;
  color: var(--muted, #64748b);
}
.docusign-envelope-card__meta span + span::before {
  content: "·";
  margin-right: 14px;
  color: var(--border, #cbd5e1);
}
.docusign-envelope-card__cta {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
}
.docusign-envelope-status {
  font-weight: 600;
}

.docusign-envelope-page {
  max-width: 980px;
}
.docusign-envelope-page__back {
  margin: 0 0 12px;
}
.docusign-envelope-page__back a {
  text-decoration: none;
}
.docusign-envelope-page__back a:hover {
  text-decoration: underline;
}
.docusign-envelope-page__hero {
  padding: 20px 22px;
  margin-bottom: 18px;
}
.docusign-envelope-page__hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.docusign-envelope-page__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.docusign-envelope-page__title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  line-height: 1.25;
}
.docusign-envelope-page__subject {
  margin: 0 0 16px;
  line-height: 1.45;
}
.docusign-envelope-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0;
}
.docusign-envelope-timeline__step {
  flex: 1;
  position: relative;
  padding-top: 18px;
  text-align: center;
  color: var(--muted, #64748b);
  font-size: 0.82rem;
  font-weight: 600;
}
.docusign-envelope-timeline__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border, #e2e8f0);
  z-index: 0;
}
.docusign-envelope-timeline__step.is-done:not(:last-child)::after {
  background: var(--primary, #2563eb);
}
.docusign-envelope-timeline__dot {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border, #e2e8f0);
  background: var(--card, #fff);
  z-index: 1;
}
.docusign-envelope-timeline__step.is-done .docusign-envelope-timeline__dot,
.docusign-envelope-timeline__step.is-current .docusign-envelope-timeline__dot {
  border-color: var(--primary, #2563eb);
  background: var(--primary, #2563eb);
}
.docusign-envelope-timeline__step.is-current .docusign-envelope-timeline__label {
  color: var(--primary-dark, #1d4ed8);
}
.docusign-envelope-timeline__step.is-done .docusign-envelope-timeline__label {
  color: var(--text, #0f172a);
}
.docusign-envelope-alert {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.docusign-envelope-alert--declined {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.docusign-envelope-alert--voided {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border, #e2e8f0);
}
.docusign-envelope-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 16px;
  align-items: start;
}
.docusign-envelope-section {
  padding: 18px 20px;
  margin-bottom: 16px;
}
.docusign-envelope-section__title {
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}
.docusign-envelope-activities__hint {
  margin: -6px 0 14px;
  line-height: 1.45;
}
.docusign-activity-feed-scroll {
  height: 20rem;
  max-height: min(40vh, 20rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg, #f8fafc);
  padding: 4px 12px;
}
.docusign-activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.docusign-activity-feed__item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.docusign-activity-feed__item:last-child {
  border-bottom: none;
  padding-bottom: 12px;
}
.docusign-activity-feed__dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.docusign-activity-feed__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.docusign-activity-feed__action {
  font-size: 0.92rem;
}
.docusign-activity-feed__message {
  margin: 6px 0 0;
  line-height: 1.45;
  color: var(--text, #0f172a);
}
.docusign-activity-feed__actor {
  margin: 4px 0 0;
}
.docusign-envelope-ready-doc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.docusign-envelope-ready-doc .btn {
  width: 100%;
  justify-content: center;
}
.docusign-recipient-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.docusign-recipient-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg, #f8fafc);
}
.docusign-recipient-list__avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary-dark, #1d4ed8);
  background: var(--primary-light, #dbeafe);
}
.docusign-recipient-list__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.docusign-recipient-list__name {
  font-weight: 600;
  line-height: 1.3;
}
.docusign-recipient-list__email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docusign-recipient-list__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.docusign-recipient-status {
  font-weight: 600;
  white-space: nowrap;
}
.docusign-envelope-card__recipients {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.docusign-envelope-card__recipient {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
}
.docusign-envelope-card__recipient-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text, #0f172a);
}
.docusign-envelope-details {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.docusign-envelope-details__row {
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: 8px 16px;
  align-items: start;
}
.docusign-envelope-details__row dt {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted, #64748b);
}
.docusign-envelope-details__row dd {
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}
.docusign-envelope-details__code {
  font-size: 0.84em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg, #f1f5f9);
}
.docusign-envelope-details__message {
  white-space: pre-wrap;
}
.docusign-envelope-actions,
.docusign-envelope-void {
  padding: 18px 20px;
  margin-bottom: 16px;
}
.docusign-envelope-actions__buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.docusign-envelope-actions__buttons .btn {
  width: 100%;
  justify-content: center;
}
.docusign-envelope-actions__pending {
  margin: 0;
  line-height: 1.45;
}
.docusign-envelope-void__form {
  margin-top: 12px;
}
.docusign-envelope-void__submit {
  margin-top: 10px;
  width: 100%;
}
@media (max-width: 820px) {
  .docusign-envelope-page__grid {
    grid-template-columns: 1fr;
  }
  .docusign-envelope-card:hover {
    transform: none;
  }
  .docusign-envelope-details__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .docusign-envelope-timeline__label {
    font-size: 0.74rem;
  }
}

.integration-connect-card__title {
  margin: 0 0 4px;
  font-size: 1.12rem;
  line-height: 1.25;
}
.integration-connect-card__tagline {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 560px;
}
.integration-connect-card__status {
  flex-shrink: 0;
  margin-top: 2px;
}
.integration-connect-card__capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 12px 22px 0;
  list-style: none;
}
.integration-connect-card__cap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.integration-connect-card__cap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted, #94a3b8);
}
.integration-connect-card--stripe .integration-connect-card__cap-dot { background: #635bff; }
.integration-connect-card--quickbooks .integration-connect-card__cap-dot { background: #2ca01c; }
.integration-connect-card--xero .integration-connect-card__cap-dot { background: #13b5ea; }
.integration-connect-card--checkr .integration-connect-card__cap-dot { background: #00a3e0; }
.integration-connect-card--gusto .integration-connect-card__cap-dot { background: #f45d48; }
.integration-connect-card--adp .integration-connect-card__cap-dot { background: #d0271d; }
.integration-connect-card--quickbooks-payroll .integration-connect-card__cap-dot { background: #0583d8; }
.integration-connect-card__content {
  padding: 16px 22px 20px;
}
.integration-connect-card__alert {
  margin: 0 0 14px;
}
.integration-connect-card__content > .integration-connect-card__alert:first-child {
  margin-top: 0;
}
.integration-connect-card__panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.integration-connect-card__panel {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg, #fafafa);
  min-width: 0;
}
.integration-connect-card__panel-title {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}
.integration-connect-card__sync-options {
  display: grid;
  gap: 10px;
  margin: 0;
}
.integration-connect-card__sync-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.integration-connect-card__sync-option:hover {
  border-color: rgba(99, 102, 241, 0.35);
}
.integration-connect-card__sync-option input {
  margin-top: 3px;
  flex-shrink: 0;
}
.integration-connect-card__sync-option-text strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 2px;
}
.integration-connect-card__sync-option-text span {
  display: block;
  color: var(--muted, #64748b);
  font-size: 0.82rem;
  line-height: 1.4;
}
.integration-connect-card__empty {
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.65);
}
.integration-connect-card__empty-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
}
.integration-connect-card__empty-body {
  margin: 0 0 14px;
  color: var(--muted, #64748b);
  font-size: 0.88rem;
  line-height: 1.45;
}
.integration-connect-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.45);
}
.integration-connect-card__footer-note {
  margin: 0;
  flex: 1 1 220px;
  color: var(--muted, #64748b);
  font-size: 0.82rem;
  line-height: 1.4;
}
.integration-connect-card__footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.integration-connect-card__server-note {
  margin: 14px 22px 18px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.8);
  color: var(--muted, #64748b);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* OAuth connect popup overlay (integration-oauth-popup.js). */
.oauth-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.oauth-popup-overlay[hidden] {
  display: none !important;
}
.oauth-popup-overlay__panel {
  width: min(100%, 420px);
  padding: 28px 24px;
  border-radius: 16px;
  background: var(--card, #fff);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  text-align: center;
}
.oauth-popup-overlay__spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: rithma-spin 0.75s linear infinite;
}
.oauth-popup-overlay__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.oauth-popup-overlay__message {
  margin: 0 0 18px;
  color: var(--muted, #64748b);
  font-size: 0.92rem;
  line-height: 1.45;
}
body.has-oauth-popup-overlay {
  overflow: hidden;
}

@media (max-width: 640px) {
  .integration-connect-card__hero,
  .integration-connect-card__content,
  .integration-connect-card__footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .integration-connect-card__capabilities {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Document branding — logo upload panel (Profile -> Preferences) */
.doc-branding-logo-panel__thumb,
.jobs-agency-brand__logo,
.jobs-about-employer__logo,
.doc-branding-preview__logo-img {
  border: none;
  outline: none;
  box-shadow: none;
}
.doc-branding-logo-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.doc-branding-logo-panel__label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.doc-branding-logo-panel__empty {
  padding: 20px 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fff;
}
.doc-branding-logo-panel__empty-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.doc-branding-logo-preview {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.doc-branding-logo-preview__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 12px;
  background: var(--primary, #2563eb);
  color: #fff;
}
.doc-branding-logo-preview__logo {
  display: block;
  max-height: 24px;
  max-width: 56px;
  object-fit: contain;
}
.doc-branding-logo-preview__bar-name {
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-branding-logo-preview__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 14px;
}
.doc-branding-logo-preview__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-dark, #1d4ed8);
}
.doc-branding-logo-preview__meta {
  font-size: 0.78rem;
  color: var(--muted, #64748b);
}
.doc-branding-logo-panel__current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.doc-branding-logo-panel__thumb {
  flex: 0 0 auto;
  max-height: 52px;
  max-width: 120px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}
.doc-branding-logo-panel__current-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 140px;
  min-width: 0;
}
.doc-branding-logo-panel__remove {
  margin-left: auto;
}
.doc-branding-logo-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.doc-branding-logo-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 168px;
  padding: 20px 16px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.doc-branding-logo-dropzone:hover,
.doc-branding-logo-dropzone:focus-within {
  border-color: var(--primary, #2563eb);
  background: #eff6ff;
}
.doc-branding-logo-dropzone.is-dragover {
  border-color: var(--primary, #2563eb);
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}
.doc-branding-logo-dropzone__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary, #2563eb);
}
.doc-branding-logo-dropzone__title {
  font-weight: 600;
  color: var(--text, #0f172a);
}
.doc-branding-logo-dropzone__hint {
  font-size: 0.82rem;
  color: var(--muted, #64748b);
  max-width: 220px;
}
.doc-branding-logo-dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.doc-branding-logo-dropzone__filename {
  margin: 0;
  word-break: break-word;
}
.doc-branding-logo-upload__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-branding-logo-upload__note {
  margin: 0;
  line-height: 1.45;
}
/* Brand color pickers */
.doc-branding-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 8px;
}
.doc-branding-color {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.doc-branding-color > label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.doc-branding-color__row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-branding-color__row input[type="color"] {
  width: 44px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.doc-branding-color__hex {
  width: 92px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: lowercase;
}
.doc-branding-colors__reset {
  margin-bottom: 1px;
}

/* Live PDF branding preview */
.doc-branding-preview {
  margin: 4px 0 22px;
}
.doc-branding-preview[hidden] {
  display: none;
}
.doc-branding-preview__label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.doc-branding-preview__doc {
  max-width: 460px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}
.doc-branding-preview__masthead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(90deg, #2563eb 0%, #14b8a6 100%);
  color: #fff;
}
.doc-branding-preview__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  overflow: hidden;
}
.doc-branding-preview__logo-img {
  display: block;
  max-width: 38px;
  max-height: 38px;
  object-fit: contain;
}
.doc-branding-preview__initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary, #2563eb);
}
.doc-branding-preview__head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.doc-branding-preview__name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-branding-preview__note {
  font-size: 0.72rem;
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-branding-preview__license {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.92;
  white-space: nowrap;
}
.doc-branding-preview__body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px 18px 16px;
}
.doc-branding-preview__doc-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin-bottom: 2px;
}
.doc-branding-preview__line {
  height: 7px;
  border-radius: 4px;
  background: #eef2f7;
}
.doc-branding-preview__field {
  height: 22px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfe;
}
.doc-branding-preview__footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--border);
}
.doc-branding-preview__accent {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}
.doc-branding-preview__accent span {
  display: block;
  height: 3px;
  border-radius: 2px;
}
.doc-branding-preview__accent span:first-child {
  width: 48px;
  background: #2563eb;
}
.doc-branding-preview__accent span:last-child {
  width: 16px;
  background: #14b8a6;
}
.doc-branding-preview__contact {
  font-size: 0.72rem;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-branding-preview__foot-note {
  font-size: 0.68rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Document branding logo crop dialog */
.doc-branding-logo-crop-dialog {
  max-width: min(420px, calc(100vw - 24px));
  width: 420px;
}
.doc-branding-logo-crop-dialog__panel {
  padding: 20px 22px 18px;
}
.doc-branding-logo-crop-dialog__head {
  margin-bottom: 14px;
}
.doc-branding-logo-crop-dialog__title {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.doc-branding-logo-crop-dialog__lead {
  margin: 0;
  line-height: 1.45;
}
.doc-branding-logo-crop__stage {
  width: 280px;
  height: 280px;
  margin: 0 auto 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    repeating-conic-gradient(#e2e8f0 0% 25%, #f8fafc 0% 50%) 50% / 16px 16px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.doc-branding-logo-crop__canvas {
  display: block;
  width: 280px;
  height: 280px;
  touch-action: none;
  cursor: grab;
}
.doc-branding-logo-crop__canvas.is-dragging {
  cursor: grabbing;
}
.doc-branding-logo-crop__zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--muted, #64748b);
}
.doc-branding-logo-crop__zoom input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
}
.doc-branding-logo-crop__filename {
  margin: 0 0 4px;
  text-align: center;
}
.doc-branding-logo-dropzone.is-busy {
  opacity: 0.65;
  pointer-events: none;
}
.doc-branding-logo-upload__note {
  margin: 10px 0 0;
}

@media (max-width: 900px) {
  .doc-branding-logo-panel {
    grid-template-columns: 1fr;
  }
  .doc-branding-logo-panel__remove {
    margin-left: 0;
  }
}

/* Custom form templates (override uploads) */
.form-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.form-template-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.form-template-card.is-active {
  border-color: #bfdbfe;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}
.form-template-card.is-busy {
  opacity: 0.75;
}
.form-template-card__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-template-card__title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-template-card__title {
  font-weight: 700;
  color: var(--text, #0f172a);
}
.form-template-card__meta {
  margin: 0;
  word-break: break-word;
}
.form-template-card__notice {
  padding: 9px 11px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.78rem;
  line-height: 1.4;
}
.form-template-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.form-template-card__upload-btn {
  cursor: pointer;
  margin: 0;
}
.form-template-card__spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--primary, #2563eb);
  animation: ft-spin 0.7s linear infinite;
}
@keyframes ft-spin {
  to { transform: rotate(360deg); }
}
.form-template-card__flash {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}
.form-template-card__flash.is-info { color: var(--muted, #64748b); }
.form-template-card__flash.is-success { color: #15803d; }
.form-template-card__flash.is-warning { color: #92400e; }
.form-template-card__flash.is-error { color: #b91c1c; }

@media (max-width: 760px) {
  .config-section-ui__panels {
    grid-template-columns: 1fr;
  }
  .config-section-ui__fact {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Agency compliance — licenses panel (recorded list vs add form) */
.compliance-licenses-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.compliance-licenses-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.compliance-licenses-recorded {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.025);
}
.compliance-licenses-recorded__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.compliance-licenses-recorded__table {
  margin: 0;
}
.compliance-licenses-recorded__actions {
  white-space: nowrap;
}
.compliance-licenses-add--renew {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 35%, var(--border));
}
.compliance-licenses-recorded__empty {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg, #fff);
  border: 1px dashed var(--border);
}
.compliance-licenses-add {
  padding: 18px 18px 16px;
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 22%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary, #2563eb) 4%, var(--bg, #fff));
}
.compliance-licenses-add__intro {
  margin: 6px 0 14px;
  max-width: 720px;
}
.compliance-licenses-add__form .form-row {
  margin-bottom: 0;
}
.compliance-licenses-add__actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.compliance-gaps-filter.scheduler-switch-row {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 12px;
}
.compliance-gaps-filter .scheduler-switch-caption {
  flex: 0 1 auto;
  white-space: nowrap;
}

/* Sticky save bar pinned to the bottom of the scroll viewport. */
.config-form-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin-top: 12px;
}
/* No extra page padding below the save bar — it would read as empty grey when
   you reach (or jump via the rail nav to) the last preference. */
.main:has(.config-form-actions-sticky) {
  padding-bottom: var(--rithma-safe-bottom);
}
.config-form-actions {
  position: relative;
  z-index: 8;
  padding: 16px 22px;
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
  border-color: color-mix(in srgb, var(--border, #e2e8f0) 85%, transparent);
  box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.08);
  background: color-mix(in srgb, var(--card, #fff) 94%, transparent);
  backdrop-filter: blur(10px);
}

/* Consumer household tier picker (primary user billing) */
.consumer-tier-switch {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.consumer-tier-switch__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.consumer-tier-switch__lead {
  margin: 0 0 16px;
}
.consumer-tier-switch__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.consumer-tier-option {
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid var(--border, #e2e8f0);
  background: var(--surface-alt, #f8fafc);
}
.consumer-tier-option--current {
  border-color: color-mix(in srgb, var(--success, #16a34a) 55%, var(--border));
  background: color-mix(in srgb, var(--success, #16a34a) 8%, var(--surface-alt, #f8fafc));
}
.consumer-tier-option__badge {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text, #0f172a);
}
.consumer-tier-option__badge--advanced {
  color: var(--accent-strong, #0369a1);
}
.consumer-tier-option__text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}
.consumer-tier-switch__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.consumer-tier-switch__portal {
  margin: 0;
  padding-top: 6px;
}
.btn-text-like {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--link, #0369a1);
  text-decoration: underline;
}
.btn-text-like:hover {
  color: var(--text, #0f172a);
}

.rithma-dialog {
  border: none;
  padding: 0;
  border-radius: 10px;
  max-width: 440px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
}
.rithma-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.rithma-dialog__panel {
  padding: 22px 24px;
}
.rithma-dialog__actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}

.caregiver-pending-schedules-dialog {
  max-width: min(560px, calc(100vw - 24px));
  width: 560px;
}
.caregiver-pending-schedules-dialog__panel {
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
}
.caregiver-pending-schedules-dialog__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.caregiver-pending-schedules-dialog__lead {
  margin: 0 0 14px;
}
.caregiver-pending-schedules-dialog__list {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -4px;
  padding: 0 4px;
}
.caregiver-pending-schedules-dialog__section + .caregiver-pending-schedules-dialog__section {
  margin-top: 16px;
}
.caregiver-pending-schedules-dialog__section-title {
  margin: 0 0 8px;
  font-size: 0.92rem;
}
.caregiver-pending-schedules-dialog__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.caregiver-pending-schedules-dialog__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.caregiver-pending-schedules-dialog__item-main {
  display: flex;
  gap: 10px;
  min-width: 0;
}
.caregiver-pending-schedules-dialog__item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.caregiver-pending-schedules-dialog__kind {
  flex-shrink: 0;
  align-self: flex-start;
}
.caregiver-pending-schedules-dialog__item-actions form {
  margin: 0;
}
.caregiver-pending-schedules-dialog__actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.checkr-order-dialog {
  max-width: min(620px, calc(100vw - 24px));
  width: 620px;
}
.checkr-order-dialog__head {
  margin-bottom: 14px;
}
.checkr-order-dialog__title {
  margin: 0;
  font-size: 1.1rem;
}
.checkr-order-dialog__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
@media (max-width: 520px) {
  .checkr-order-dialog__grid {
    grid-template-columns: 1fr;
  }
}
.checkr-order-dialog__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}
.checkr-order-dialog__field .form-control {
  font-weight: 400;
}
.checkr-order-dialog__field--full {
  grid-column: 1 / -1;
}
.checkr-order-dialog__field [data-checkr-node-packages] {
  font-weight: 400;
}
.checkr-order-dialog__field .req {
  color: var(--danger, #b91c1c);
}
.checkr-order-dialog__check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  align-self: end;
  padding-bottom: 8px;
}
.checkr-order-dialog__package {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.shift-end-dialog {
  width: min(calc(100vw - 24px), 26rem);
  max-width: 100%;
  margin: auto;
  overflow: hidden;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
}
.shift-end-dialog__surface {
  display: flex;
  flex-direction: column;
}
.shift-end-dialog__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: color-mix(in srgb, var(--danger, #dc2626) 10%, var(--card, #fff));
}
.shift-end-dialog__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger, #dc2626) 18%, transparent);
  color: var(--danger, #b91c1c);
  font-size: 1.1rem;
  line-height: 1;
}
.shift-end-dialog__head-text {
  min-width: 0;
}
.shift-end-dialog__title {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.25;
}
.shift-end-dialog__subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted, #64748b);
}
.shift-end-dialog__body {
  padding: 16px 20px 4px;
}
.shift-end-dialog__lead {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.45;
}
.shift-end-dialog__steps {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted, #64748b);
}
.shift-end-dialog__steps li + li {
  margin-top: 4px;
}
.shift-end-dialog__notice {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  background: color-mix(in srgb, var(--warning, #d97706) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning, #d97706) 28%, var(--border, #e2e8f0));
  color: var(--text, #0f172a);
}
.shift-end-dialog__actions {
  margin-top: 0;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--bg, #f8fafc);
}
.shift-end-dialog__actions .btn-danger {
  min-width: 9.5rem;
}

.rithma-app-dialog {
  width: min(calc(100vw - 24px), 26rem);
  max-width: 100%;
  margin: auto;
  overflow: hidden;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
}
.rithma-app-dialog__surface {
  display: flex;
  flex-direction: column;
}
.rithma-app-dialog__head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--card, #fff));
}
.rithma-app-dialog--danger .rithma-app-dialog__head {
  background: color-mix(in srgb, var(--danger, #dc2626) 10%, var(--card, #fff));
}
.rithma-app-dialog--warning .rithma-app-dialog__head {
  background: color-mix(in srgb, var(--warning, #d97706) 10%, var(--card, #fff));
}
.rithma-app-dialog--info .rithma-app-dialog__head {
  background: color-mix(in srgb, var(--info, #2563eb) 10%, var(--card, #fff));
}
.rithma-app-dialog__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary, #2563eb) 16%, transparent);
  color: var(--primary, #1d4ed8);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}
.rithma-app-dialog--danger .rithma-app-dialog__icon {
  background: color-mix(in srgb, var(--danger, #dc2626) 18%, transparent);
  color: var(--danger, #b91c1c);
}
.rithma-app-dialog--warning .rithma-app-dialog__icon {
  background: color-mix(in srgb, var(--warning, #d97706) 18%, transparent);
  color: var(--warning, #b45309);
}
.rithma-app-dialog--info .rithma-app-dialog__icon {
  background: color-mix(in srgb, var(--info, #2563eb) 18%, transparent);
  color: var(--info, #1d4ed8);
}
.rithma-app-dialog__head-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.rithma-app-dialog__title {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.25;
}
.rithma-app-dialog__subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted, #64748b);
}
.rithma-app-dialog__body {
  padding: 16px 20px 4px;
}
.rithma-app-dialog__message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-line;
}
.rithma-app-dialog__prompt {
  margin-top: 12px;
}
.rithma-app-dialog__prompt .input {
  width: 100%;
  margin-top: 6px;
}
.rithma-app-dialog__actions {
  margin-top: 0;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--bg, #f8fafc);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}
/* Long-shift approve split: native time pickers must not clip inside dialog */
.rithma-dialog.rithma-app-dialog.schedule-change-split-dialog {
  overflow: visible;
  width: min(calc(100vw - 24px), 760px);
  max-width: min(calc(100vw - 24px), 760px);
}
.rithma-dialog.rithma-app-dialog.schedule-change-split-dialog.schedule-change-split-dialog--manual {
  width: min(calc(100vw - 24px), 820px);
  max-width: min(calc(100vw - 24px), 820px);
}
.schedule-change-split-manual .manual-seg-panel {
  overflow: visible;
}

/* Billing / subscription gate modal (native <dialog>) */
.billing-gate-modal {
  width: min(calc(100vw - 24px), 28rem);
  max-width: 100%;
  max-height: min(90vh, 32rem);
  margin: auto;
  overflow: hidden;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
}
.billing-gate-modal::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}
.billing-gate-modal--warning .billing-gate-modal__head {
  background: color-mix(in srgb, var(--info, #2563eb) 10%, var(--card, #fff));
  border-bottom-color: color-mix(in srgb, var(--info, #2563eb) 28%, var(--border, #e2e8f0));
}
.billing-gate-modal--warning .billing-gate-modal__icon {
  background: color-mix(in srgb, var(--info, #2563eb) 18%, transparent);
  color: var(--info, #1d4ed8);
}
.billing-gate-modal--warning .billing-gate-modal__subtitle {
  color: var(--info, #1d4ed8);
}
.billing-gate-modal__surface {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 32rem);
}
.billing-gate-modal__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: color-mix(in srgb, var(--warning, #d97706) 12%, var(--card, #fff));
}
.billing-gate-modal__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--warning, #d97706) 22%, transparent);
  color: var(--warning, #b45309);
}
.billing-gate-modal__icon svg {
  display: block;
}
.billing-gate-modal__head-text {
  min-width: 0;
}
.billing-gate-modal__title {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text, #0f172a);
}
.billing-gate-modal__subtitle {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}
.billing-gate-modal__body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.billing-gate-modal__lead {
  margin: 0 0 12px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text, #0f172a);
}
.billing-gate-modal__hint {
  margin: 0;
  line-height: 1.45;
}
.billing-gate-modal__foot {
  flex-shrink: 0;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--surface-alt, #f8fafc);
}
.billing-gate-modal__actions-primary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.billing-gate-modal__actions-primary .billing-gate-modal__btn {
  text-align: center;
}
.billing-gate-modal__form {
  margin: 0;
}
@media (min-width: 420px) {
  .billing-gate-modal__actions-primary {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .billing-gate-modal__actions-primary .billing-gate-modal__btn {
    flex: 1 1 12rem;
    min-width: 0;
    width: auto !important;
  }
  .billing-gate-modal__actions-primary .billing-gate-modal__form {
    flex: 1 1 12rem;
    min-width: 0;
    display: flex;
  }
  .billing-gate-modal__actions-primary .billing-gate-modal__form .btn {
    width: 100%;
  }
}
.billing-gate-modal__actions-dismiss {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
  text-align: center;
}
.billing-gate-modal__dismiss {
  font-size: 0.92rem;
}

/* Post-agency Advanced retention (consumer household prompt) */
.advanced-retention-banner {
  margin: 0 0 20px;
  padding: 0;
}
.advanced-retention-banner__inner {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary, #0369a1) 35%, var(--border, #e2e8f0));
  background: color-mix(in srgb, var(--primary-light, #e0f2fe) 55%, var(--surface-alt, #f8fafc));
}
.advanced-retention-banner__household {
  margin: 0 0 8px;
}
.advanced-retention-banner__title {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text, #0f172a);
}
.advanced-retention-banner__inner > p {
  margin: 0 0 10px;
  line-height: 1.45;
  color: var(--text, #0f172a);
}
.advanced-retention-banner__inner > p:last-of-type {
  margin-bottom: 0;
}
.advanced-retention-banner__actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* AI Form Converter (agency + independent caregiver) */
.form-converter-section-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
}
.form-converter-upload-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}
.form-converter-upload-hint {
  margin: 0;
}
.form-converter-download-hint {
  margin: 10px 0 0;
  max-width: 420px;
}
.form-converter-fill-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
  gap: 16px;
  align-items: start;
}
.form-converter-fill-preview {
  position: sticky;
  top: 16px;
  align-self: start;
  z-index: 2;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.form-converter-fill-preview .form-converter-section-title {
  flex-shrink: 0;
}
.form-converter-letterhead-preview {
  grid-column: 1 / -1;
  padding: 14px 16px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border: 1px solid #bfdbfe;
}
.form-converter-letterhead-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-dark, #1d4ed8);
}
.form-converter-letterhead-name {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.form-converter-letterhead-meta {
  margin: 0;
  color: var(--text-muted, #64748b);
  font-size: 0.92rem;
  line-height: 1.5;
}
@media (max-width: 960px) {
  .form-converter-fill-shell {
    grid-template-columns: 1fr;
  }
  .form-converter-fill-preview {
    position: static;
    max-height: none;
  }
}
.form-converter-preview-frame {
  width: 100%;
  min-height: 360px;
  height: calc(100dvh - 120px);
  max-height: calc(100dvh - 120px);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #f8fafc;
}
.main .form-converter-preview-frame {
  /* Override .main iframe { height: auto } so the PDF preview keeps a viewport height. */
  height: calc(100dvh - 120px);
  max-height: calc(100dvh - 120px);
  min-height: 360px;
}
@media (max-width: 960px) {
  .form-converter-preview-frame,
  .main .form-converter-preview-frame {
    min-height: 320px;
    height: 52vh;
    max-height: 52vh;
  }
}
.form-converter-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 4px;
}
.form-converter-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}
.form-converter-checkbox input {
  margin-top: 3px;
}
.form-converter-save-ready {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg, #f8fafc);
}
.form-converter-save-ready__title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}
.form-converter-save-ready__desc {
  margin: 0 0 14px;
}
.form-converter-save-ready__fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-converter-save-ready__assignment {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.form-converter-save-ready__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.form-converter-save-ready__field--name {
  flex: 1 1 100%;
}
.form-converter-save-ready__field--category {
  flex: 0 1 148px;
}
.form-converter-save-ready__field--link {
  flex: 1 1 200px;
  max-width: 100%;
}
.form-converter-save-ready__field > span {
  font-size: 0.875rem;
  font-weight: 600;
}
.form-converter-save-ready__field input,
.form-converter-save-ready__field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.form-converter-save-ready__field input:focus,
.form-converter-save-ready__field select:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.form-converter-save-ready__actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.form-converter-fill-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Send for signing (form fill handoff) */
.form-converter-outcomes {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}
.form-converter-send-panel {
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: linear-gradient(180deg, #f5f7ff 0%, #fff 48px);
  overflow: hidden;
  margin-top: 16px;
}
.form-converter-send-panel__header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px 0;
}
.form-converter-send-panel__icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 1.1rem;
  line-height: 1;
}
.form-converter-send-panel__headings {
  min-width: 0;
}
.form-converter-send-panel__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.form-converter-send-panel__desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
}
.form-converter-send-panel__body {
  padding: 16px 18px 18px;
}
.form-converter-send-task-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .form-converter-send-task-cards {
    grid-template-columns: 1fr;
  }
}
.form-converter-send-task-card {
  display: block;
  position: relative;
  padding: 12px 14px 12px 38px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-converter-send-task-card input {
  position: absolute;
  left: 14px;
  top: 15px;
  margin: 0;
}
.form-converter-send-task-card--active {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
  background: #fafaff;
}
.form-converter-send-task-card__title {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
  color: var(--text, #0f172a);
}
.form-converter-send-task-card__desc {
  display: block;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted, #64748b);
}
.form-converter-send-panel__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 720px) {
  .form-converter-send-panel__grid {
    grid-template-columns: 1fr;
  }
}
.form-converter-send-panel__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-converter-send-panel__field > span {
  font-size: 0.875rem;
  font-weight: 600;
}
.form-converter-send-panel__field select,
.form-converter-send-panel__field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.form-converter-send-panel__field select:focus,
.form-converter-send-panel__field textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.form-converter-send-panel__field--full {
  grid-column: 1 / -1;
}
.form-converter-send-summary {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.84rem;
  line-height: 1.45;
}
.form-converter-send-summary__label {
  flex-shrink: 0;
  font-weight: 600;
}
.form-converter-send-panel__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}

.signing-inbox-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.signing-inbox-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.signing-inbox-item:hover {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}
.signing-inbox-item--sent {
  background: var(--bg, #f8fafc);
}
.signing-inbox-item__title {
  font-weight: 600;
}

.form-converter-analyzing-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.92rem;
  line-height: 1.45;
}
.form-converter-analyzing-banner__spinner,
.form-converter-status-badge__spinner {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: form-converter-spin 0.75s linear infinite;
}
.form-converter-row--processing {
  opacity: 0.78;
}
.form-converter-row--processing .form-converter-row__title,
.form-converter-row--error .form-converter-row__title {
  color: var(--text-muted, #64748b);
  font-weight: 600;
}
.form-converter-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.form-converter-status-badge--processing {
  color: #1d4ed8;
}
.form-converter-status-badge--ready {
  color: #047857;
}
.form-converter-status-badge--error {
  color: #b91c1c;
}
.btn.btn--disabled,
.btn.btn--disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.15);
}
@keyframes form-converter-spin {
  to { transform: rotate(360deg); }
}

/* Document signatures (form fill + Ready Documents) */
.form-converter-signatures {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.intake-ack-signatures__intro {
  margin-top: 0;
}
.intake-ack-signatures__subtitle {
  font-size: 1rem;
  margin: 0 0 6px;
}
.intake-ack-signatures--error {
  outline: 2px solid var(--danger, #dc2626);
  outline-offset: 2px;
  border-radius: 8px;
}
.doc-signature--edit-locked .doc-signature__canvas {
  cursor: default;
  opacity: 0.92;
}
.doc-signature--edit-locked .doc-signature__mode:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.doc-signature__saved-lock-notice {
  margin: 0 0 10px;
}
.doc-signature {
  margin: 14px 0 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.doc-signature__header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.doc-signature__label {
  font-weight: 600;
  font-size: 0.95rem;
}
.doc-signature__modes {
  display: flex;
  gap: 6px;
}
.doc-signature__mode {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.doc-signature__mode--active {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  font-weight: 600;
}
.doc-signature__canvas {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  aspect-ratio: 520 / 140;
  min-height: 96px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
  image-rendering: auto;
  -webkit-user-select: none;
  user-select: none;
}
.doc-signature__draw-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.doc-signature__adopt-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  align-items: flex-start;
}
.doc-signature__adopt-label .voice-input-wrap {
  width: 100%;
  max-width: 360px;
}
.doc-signature__adopt-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
  background: #fff;
}
.doc-signature__adopt-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.doc-signature__adopt-preview {
  min-height: 3rem;
  margin: 8px 0;
  padding: 4px 2px;
  color: #111;
  font-size: 2.25rem;
  line-height: 1.25;
  font-style: italic;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.doc-signature__saved-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.doc-signature__saved-dropdown {
  position: relative;
  max-width: 320px;
}
.doc-signature__saved-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.doc-signature__saved-dropdown-toggle:hover {
  border-color: var(--primary, #2563eb);
}
.doc-signature__saved-dropdown-preview {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 48px;
}
.doc-signature__saved-dropdown-preview .doc-signature__saved-thumb {
  max-height: 32px;
}
.doc-signature__saved-dropdown-label {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
}
.doc-signature__saved-dropdown-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-muted, #64748b);
  flex-shrink: 0;
}
.doc-signature__saved-dropdown-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.doc-signature__saved-dropdown-menu[hidden] {
  display: none;
}
.doc-signature__saved-thumb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 6px 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.doc-signature__saved-thumb-btn:hover,
.doc-signature__saved-thumb-btn.is-selected {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 35%, transparent);
}
.doc-signature__saved-thumb {
  display: block;
  max-width: 100%;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.doc-signature__save {
  margin-top: 10px;
}
.doc-signature__attest {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary, #2563eb) 5%, transparent);
}
.doc-signature__attest-label {
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}
.doc-signature__attest-error {
  margin: 6px 0 0;
  color: var(--danger, #dc2626);
}
.doc-signature--attest-missing .doc-signature__attest {
  border-color: var(--danger, #dc2626);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger, #dc2626) 35%, transparent);
}
.esign-consent-disclosure {
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg, #f8fafc);
}
.esign-consent-disclosure__section:last-child p {
  margin-bottom: 0;
}
.esign-consent-profile-card__intro {
  margin: 0 0 12px;
}
.esign-consent-profile-card__status {
  margin: 0 0 12px;
}
.esign-consent-profile-card__withdraw-form {
  margin: 0;
}
.document-sign-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.document-sign-modal[open] {
  display: flex;
}
.document-sign-modal__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(15, 23, 42, 0.55);
}
.document-sign-modal__content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--card, #fff);
  border-radius: 10px;
  padding: 16px 18px 18px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
}
.document-sign-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.document-sign-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.document-sign-modal__align {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}
.document-sign-modal__align legend {
  padding: 0;
  margin-bottom: 8px;
  font-weight: 600;
}
.document-sign-modal__align-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.document-sign-modal__align-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}
.document-sign-modal__align-option:has(input:checked) {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  font-weight: 600;
}
.document-sign-modal__align-option input {
  margin: 0;
}
.document-sign-modal__placer {
  margin-top: 12px;
}
.sig-placer__document-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 16px 0 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 18%, transparent);
  border-radius: 6px;
}
.sig-placer__document-heading:first-child {
  margin-top: 0;
}
.sig-placer-panel {
  margin: 12px 0;
}
.sig-placer__hint {
  margin: 0 0 8px;
}
.sig-placer__scroll {
  max-height: min(70vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  background: #64748b;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.sig-placer__pages {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sig-placer__page {
  background: #fff;
  border-radius: 4px;
  overflow: visible;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}
.sig-placer__page--active {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}
.sig-placer__page-num {
  display: block;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  line-height: 1.3;
}
.sig-placer__page-viewport {
  position: relative;
  line-height: 0;
  background: #fff;
  overflow: hidden;
  border-radius: 0 0 4px 4px;
}
.sig-placer__page-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}
.sig-placer__page-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  pointer-events: none;
}
.sig-placer__page-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
}
.sig-placer__box {
  position: absolute;
  box-sizing: border-box;
  border: 2px dashed var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  cursor: move;
  z-index: 1;
}
.sig-placer__box--multi {
  border-width: 2px;
}
.sig-placer__box--focused {
  z-index: 3;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sig-slot-color, var(--primary, #2563eb)) 35%, transparent);
}
.sig-placer__nametag {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: min(260px, 90vw);
  padding: 5px 9px;
  border-radius: 6px 6px 6px 0;
  background: var(--sig-slot-color, var(--primary, #2563eb));
  color: #fff;
  line-height: 1.25;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}
.sig-placer__nametag-slot {
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sig-placer__nametag-signer {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sig-placer__box-label {
  position: absolute;
  top: -1.4em;
  left: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sig-placer__handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--primary, #2563eb);
  border: 1px solid #fff;
  border-radius: 2px;
  box-sizing: border-box;
}
.sig-placer__handle--nw { top: -5px; left: -5px; cursor: nwse-resize; }
.sig-placer__handle--n { top: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.sig-placer__handle--ne { top: -5px; right: -5px; cursor: nesw-resize; }
.sig-placer__handle--e { top: 50%; right: -5px; margin-top: -5px; cursor: ew-resize; }
.sig-placer__handle--se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.sig-placer__handle--s { bottom: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.sig-placer__handle--sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.sig-placer__handle--w { top: 50%; left: -5px; margin-top: -5px; cursor: ew-resize; }

.signing-slot-row--placer-active {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}

html.document-sign-modal-open,
html.document-sign-modal-open body {
  overflow: hidden;
}

/* Current shift — visit picker shared across Visit / Travel subtabs */
.current-shift-picker.visit-picker {
  margin-bottom: 12px;
}
.current-shift-subtabs {
  margin-top: 0;
}
.current-shift-visit-header {
  margin-bottom: 12px;
}
.current-shift-tab-panel {
  position: relative;
}
.current-shift-chat-overlay[hidden] {
  display: none !important;
}
.current-shift-chat-overlay:not([hidden]) {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
/* Current shift — chat tab (fixed-height thread + fixed composer) */
.current-shift-tab-panel--loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.current-shift-chat-layout {
  margin-bottom: 8px;
}
.shift-chat {
  --shift-chat-thread-height: 80vh;
  --shift-chat-thread-height: 80dvh;
  --shift-chat-mobile-bar-height: 0px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
.shift-chat__mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.05), #fff 80%);
  flex-shrink: 0;
}
.shift-chat__mobile-bar-title {
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 0;
}
html[data-rithma-native-app="1"] .shift-chat__mobile-bar,
body:has(.bottom-nav.bottom-nav--ready) .shift-chat__mobile-bar {
  display: flex;
  --shift-chat-mobile-bar-height: 2.75rem;
}
@media (max-width: 830px) {
  .shift-chat__mobile-bar {
    display: flex;
    --shift-chat-mobile-bar-height: 2.75rem;
  }
}
.main-chat-panel .shift-chat__mobile-bar {
  display: none !important;
}
.shift-chat.is-chat-fullscreen {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  border: none;
  border-radius: 0;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
}
html[data-rithma-native-app="1"] .shift-chat.is-chat-fullscreen,
body.rithma-native-app .shift-chat.is-chat-fullscreen {
  top: var(--layout-mobile-topbar-height);
}
.shift-chat.is-chat-fullscreen .shift-chat__thread,
.shift-chat.is-chat-fullscreen .shift-chat__thread.messenger-bubbles {
  flex: 1 1 0;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Never justify-content:flex-end on this scroller — Android/WebKit won't pan. */
  justify-content: flex-start;
  touch-action: pan-y;
}
/* Short threads: grow a spacer above the list (not margin-top:auto on the list). */
.shift-chat__thread.messenger-bubbles::before {
  content: "";
  flex: 1 0 0;
  min-height: 0;
  pointer-events: none;
}
.shift-chat.is-chat-fullscreen .shift-chat__composer {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  margin: 0;
  margin-top: auto;
  box-shadow: none;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 2;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-bottom: max(10px, var(--rithma-safe-bottom));
}
.shift-chat.is-chat-fullscreen .ai-chat-disclaimer {
  flex-shrink: 0;
  margin: 8px 12px 0;
}
body.has-chat-fullscreen--shift .visit-picker,
body.has-chat-fullscreen--shift .current-shift-visit-header,
body.has-chat-fullscreen--shift .current-shift-subtabs,
body.has-chat-fullscreen--shift .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}
body.has-chat-fullscreen--agency .page-header,
body.has-chat-fullscreen--shift .current-shift-visit-header,
body.has-chat-fullscreen--shift .current-shift-subtabs,
body.has-chat-fullscreen--shift .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}
body.has-chat-fullscreen--agency .page-header,
body.has-chat-fullscreen--agency .main-chat-personalization-bar,
body.has-chat-fullscreen--agency .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}
.shift-chat__thread {
  flex: none;
  height: var(--shift-chat-thread-height);
  min-height: var(--shift-chat-thread-height);
  max-height: var(--shift-chat-thread-height);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 0;
  background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 28%, #ffffff 100%);
}
/* Agency chat: fill the main column so the thread scrolls inside the panel,
   not the whole page (avoids empty grey scroll past the composer). */
.main:has([data-agency-chat]) {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.main:has([data-agency-chat]) .page-header {
  flex-shrink: 0;
}
.main:has([data-agency-chat]) .agency-chat {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.main:has([data-agency-chat]) .agency-chat .shift-chat__thread {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}
.main:has([data-agency-chat]) .agency-chat .shift-chat__thread.messenger-bubbles {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}
.main:has([data-agency-chat]) .agency-chat .shift-chat__composer {
  margin-top: auto;
  flex-shrink: 0;
}
.shift-chat__thread.messenger-bubbles {
  flex: none;
}
/* Main Chat mini panel — override global fixed 80vh thread height */
.main-chat-panel [data-main-chat-root] .shift-chat__thread.messenger-bubbles {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.main-chat-panel [data-main-chat-root].shift-chat.agency-chat {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
[data-shift-chat-messages-list],
[data-agency-chat-messages-list] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.shift-chat__thread .messenger-bubble.is-in,
.shift-chat__thread .shift-chat-bubble--agent {
  align-self: flex-start;
  margin-right: auto;
}
.shift-chat__thread .messenger-bubble.is-out,
.shift-chat__thread .shift-chat-bubble[data-shift-chat-msg="out"] {
  align-self: flex-end;
  margin-left: auto;
}
.shift-chat__thread .messenger-bubble.is-in .messenger-bubble__meta {
  justify-content: flex-start;
}
.shift-chat__thread .messenger-bubble.is-out .messenger-bubble__meta {
  justify-content: flex-end;
}
.shift-chat-action-card--incident {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
}
.shift-chat-day {
  display: flex;
  justify-content: center;
  margin: 4px 0 8px;
}
.shift-chat-day__pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
}
.shift-chat-bubble--system {
  align-self: center;
  max-width: min(92%, 420px);
  text-align: center;
  background: #fff;
  border-style: dashed;
}
.shift-chat-bubble--system .messenger-bubble__meta {
  justify-content: center;
}
.shift-chat-bubble--agent .messenger-bubble__text {
  font-size: 0.92em;
}
.shift-chat-bubble__status {
  font-size: 0.82em;
  color: var(--primary);
  font-weight: 600;
}

/* Agency chat — worklog checklist + reply */
.agency-chat-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.agency-chat-worklog {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.85);
}
.agency-chat-worklog__summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88em;
  padding: 8px 10px;
  list-style: none;
  color: var(--text, #0f172a);
}
.agency-chat-worklog__summary::-webkit-details-marker {
  display: none;
}
.agency-chat-worklog__panel {
  padding: 0 10px 10px;
}
.agency-chat-body .agency-chat-reply--pending:not([hidden]) {
  padding-top: 4px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.agency-chat-pending {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.agency-chat-progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agency-chat-progress__step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88em;
  line-height: 1.35;
}
.agency-chat-progress__icon {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.agency-chat-progress__step.is-done .agency-chat-progress__icon {
  color: var(--success, #047857);
}
.agency-chat-progress__step.is-active .agency-chat-progress__icon {
  color: var(--primary);
}
.agency-chat-progress__step.is-error .agency-chat-progress__icon,
.agency-chat-progress__step.is-error .agency-chat-progress__title {
  color: var(--danger, #b91c1c);
}
.agency-chat-progress__error-mark {
  font-weight: 700;
  font-size: 0.95em;
  line-height: 1;
}
.agency-chat-reply--failed {
  color: var(--danger, #b91c1c);
}
.agency-chat-progress__check {
  display: block;
}
.agency-chat-progress__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: agency-chat-spin 0.75s linear infinite;
}
@keyframes agency-chat-spin {
  to { transform: rotate(360deg); }
}
.agency-chat-progress__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.agency-chat-progress__title {
  font-weight: 600;
  color: var(--text, #0f172a);
}
.agency-chat-progress__step.is-active .agency-chat-progress__title {
  color: var(--primary);
}
.agency-chat-progress__detail {
  font-size: 0.92em;
  color: var(--muted);
  line-height: 1.4;
}
.agency-chat-reply {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  font-size: 0.95em;
  color: var(--text, #0f172a);
}
.agency-chat-reply--pending {
  font-size: 0.95em;
}
.agency-chat-reply--pending:not([hidden]) {
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.shift-chat-bubble--agency .agency-chat-reply {
  margin-top: 2px;
}
.agency-chat-deep-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.agency-chat-deep-links__btn {
  text-decoration: none;
}
.agency-chat-workflow {
  margin: 4px 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.04);
}
.agency-chat-workflow__title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.agency-chat-workflow__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.agency-chat-workflow__step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.agency-chat-workflow__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.agency-chat-workflow__step--done {
  color: var(--success, #16a34a);
}
.agency-chat-workflow__step--done .agency-chat-workflow__dot {
  background: var(--success, #16a34a);
  border-color: var(--success, #16a34a);
  color: #fff;
}
.agency-chat-workflow__step--current {
  color: var(--primary, #2563eb);
  font-weight: 600;
}
.agency-chat-workflow__step--current .agency-chat-workflow__dot {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}
.agency-chat-evidence {
  margin-top: 8px;
  font-size: 13px;
}
.agency-chat-evidence__summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}
.agency-chat-evidence__summary:hover {
  color: var(--primary, #2563eb);
}
.agency-chat-evidence__list {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-left: 2px solid var(--border, rgba(148, 163, 184, 0.4));
  background: rgba(148, 163, 184, 0.06);
  border-radius: 0 8px 8px 0;
}
.agency-chat-evidence__row {
  display: flex;
  gap: 8px;
  padding: 2px 0;
}
.agency-chat-evidence__label {
  flex: 0 0 130px;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}
.agency-chat-evidence__detail {
  margin: 0;
  color: var(--text, inherit);
  word-break: break-word;
}
.shift-chat-action-card__batch {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary, #2563eb);
}
.shift-chat-action-card__undo {
  margin: 2px 0 0;
  font-style: italic;
}
@media (max-width: 520px) {
  .agency-chat-evidence__row {
    flex-direction: column;
    gap: 0;
  }
  .agency-chat-evidence__label {
    flex-basis: auto;
  }
}
.shift-chat-bubble--agent .messenger-bubble__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.shift-chat-bubble__listen-btn {
  margin: 0;
  padding: 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
}
.shift-chat-bubble__listen-btn:hover,
.shift-chat-bubble__listen-btn:focus-visible {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}
.shift-chat-bubble__listen-btn--active {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
}
.shift-chat-bubble__listen-btn[hidden] {
  display: none;
}
.shift-chat-action-card {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.2);
}
.shift-chat-action-card__label {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 0.9em;
}
.shift-chat-action-card__summary {
  margin: 0 0 8px;
}
.shift-chat-action-card__hint {
  margin: 0 0 8px;
  font-size: 0.85em;
}
.shift-chat-action-card__preview {
  margin: 0 0 10px;
  font-size: 0.9em;
}
.shift-chat-action-card__preview-row {
  margin: 0 0 8px;
}
.shift-chat-action-card__preview-row:last-child {
  margin-bottom: 0;
}
.shift-chat-action-card__preview-label {
  margin: 0 0 2px;
  font-weight: 600;
  font-size: 0.85em;
  color: var(--text-muted, #64748b);
}
.shift-chat-action-card__preview-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.shift-chat-action-card__preview-text--body {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(37, 99, 235, 0.15);
}
.shift-chat-action-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.shift-chat-action-card__form {
  margin: 0;
  display: inline;
}
.shift-chat-action-card__done {
  margin: 8px 0 0;
}
.shift-chat-action-card--blocked {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
}
.shift-chat-action-card__error {
  margin: 0 0 8px;
  font-size: 0.85em;
  color: #b91c1c;
  font-weight: 500;
}
.shift-chat-action-card__done-link {
  margin: 4px 0 0;
}
.agency-chat-retry {
  margin-top: 8px;
}
.main-chat-personalization-bar {
  margin: 0 0 16px;
}
.main-chat-personalization-bar .scheduler-switch-row {
  margin-bottom: 0;
}
.main-chat-personalization-bar__hint {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  line-height: 1.45;
}
.shift-chat__quota {
  margin: 6px 4px 0;
  text-align: right;
  font-size: 0.78em;
}
.shift-chat__quota--empty {
  color: #b91c1c;
  font-weight: 500;
}
.shift-chat-empty__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.shift-chat-suggestion {
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.06);
  color: var(--text, #1e293b);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.85em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.shift-chat-suggestion:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.45);
}
.shift-chat-suggestion:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 2px;
}
.agency-chat-info-request {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.22);
}
.agency-chat-info-request__title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 0.95em;
}
.agency-chat-info-request__intro {
  margin: 0 0 10px;
}
.agency-chat-info-request__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.agency-chat-info-request__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9em;
}
.agency-chat-info-request__label {
  font-weight: 600;
  color: var(--text-muted, #64748b);
}
.agency-chat-info-request__req {
  color: var(--danger, #dc2626);
  margin-left: 2px;
}
.agency-chat-info-request__input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #cbd5e1);
  font: inherit;
  background: var(--surface, #fff);
}
.agency-chat-info-request__input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 1px;
}
.agency-chat-info-request__hint {
  margin: 0;
}
.agency-chat-info-request[data-submitted="1"] {
  opacity: 0.65;
  pointer-events: none;
}
.shift-chat-empty {
  margin: auto;
  text-align: center;
  padding: 24px 16px;
}
.shift-chat-empty__title {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.shift-chat__composer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 10px 12px max(10px, var(--rithma-safe-bottom));
  border-top: 1px solid var(--border);
  background: #f8fafc;
}
.shift-chat__bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding-left: 4px;
  box-sizing: border-box;
}
.shift-chat__speech-mode-btn.is-on {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}
.shift-chat__speech-mode-btn.is-listening {
  color: #059669;
  background: rgba(16, 185, 129, 0.16);
  animation: chat-speech-btn-pulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
}
.shift-chat__speech-mode-btn.is-paused {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.25);
}
.shift-chat__speech-mode-btn.is-speaking,
.shift-chat__speech-mode-btn.is-waiting {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
}
.shift-chat--speech-mode .shift-chat__input::placeholder {
  color: var(--primary);
}
/* Intake assistant — speech mode is voice-only; dock shows transcript + mic status */
.intake-interview-chat.shift-chat--speech-mode .shift-chat__bar {
  display: none !important;
}

/* Speech-mode status banner (listening vs paused) */
.shift-chat__speech-status {
  display: none;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 6px 0;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.shift-chat--speech-mode .shift-chat__speech-status {
  display: flex;
}
.shift-chat__speech-status-visual {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

/* Rithma voice field — aurora nucleus + orbital capture rings + living spectrum */
.rithma-voice-field {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.rithma-voice-field__aurora {
  position: absolute;
  inset: -18%;
  border-radius: 43% 57% 58% 42% / 48% 44% 56% 52%;
  background: conic-gradient(
    from 200deg,
    rgba(16, 185, 129, 0.55),
    rgba(45, 212, 191, 0.25),
    rgba(56, 189, 248, 0.35),
    rgba(110, 231, 183, 0.5),
    rgba(16, 185, 129, 0.55)
  );
  filter: blur(10px) saturate(1.2);
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.35s ease, transform 0.35s ease;
  animation: rithma-vf-aurora-morph 5.5s ease-in-out infinite;
  z-index: 0;
}
.rithma-voice-field__orbit {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}
.rithma-voice-field__orbit--a {
  inset: 0;
  border-top-color: rgba(52, 211, 153, 0.85);
  border-right-color: rgba(16, 185, 129, 0.15);
  animation: rithma-vf-orbit 2.8s linear infinite;
}
.rithma-voice-field__orbit--b {
  inset: 11%;
  border-bottom-color: rgba(110, 231, 183, 0.75);
  border-left-color: rgba(16, 185, 129, 0.12);
  animation: rithma-vf-orbit 2.1s linear infinite reverse;
}
.rithma-voice-field__orbit--c {
  inset: 22%;
  border-top-color: rgba(45, 212, 191, 0.55);
  border-bottom-color: rgba(56, 189, 248, 0.2);
  animation: rithma-vf-orbit-tilt 3.6s linear infinite;
}
.rithma-voice-field__spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.9);
  opacity: 0;
  z-index: 2;
}
.rithma-voice-field__spark--1 { top: 8%; left: 50%; margin-left: -2px; animation: rithma-vf-spark 2.4s ease-in-out infinite; }
.rithma-voice-field__spark--2 { top: 22%; right: 12%; animation: rithma-vf-spark 2.4s ease-in-out 0.35s infinite; }
.rithma-voice-field__spark--3 { bottom: 28%; right: 6%; animation: rithma-vf-spark 2.4s ease-in-out 0.7s infinite; }
.rithma-voice-field__spark--4 { bottom: 8%; left: 50%; margin-left: -2px; animation: rithma-vf-spark 2.4s ease-in-out 1.05s infinite; }
.rithma-voice-field__spark--5 { bottom: 28%; left: 6%; animation: rithma-vf-spark 2.4s ease-in-out 1.4s infinite; }
.rithma-voice-field__spark--6 { top: 22%; left: 12%; animation: rithma-vf-spark 2.4s ease-in-out 1.75s infinite; }
.rithma-voice-field__core {
  position: relative;
  z-index: 4;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #64748b 0%, #475569 100%);
  box-shadow:
    0 4px 14px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: background 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}
.rithma-voice-field__icon {
  display: block;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.2));
}
.rithma-voice-field__spectrum {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 88%;
  height: 42%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}
.rithma-voice-field__bar {
  flex: 1;
  max-width: 4px;
  height: 100%;
  border-radius: 99px;
  transform-origin: bottom center;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.15), #94a3b8);
  transform: scaleY(0.22);
  opacity: 0.45;
  transition: background 0.35s ease, opacity 0.35s ease;
}
.rithma-voice-field__bar:nth-child(1) { animation-delay: 0s; }
.rithma-voice-field__bar:nth-child(2) { animation-delay: 0.08s; }
.rithma-voice-field__bar:nth-child(3) { animation-delay: 0.16s; }
.rithma-voice-field__bar:nth-child(4) { animation-delay: 0.24s; }
.rithma-voice-field__bar:nth-child(5) { animation-delay: 0.32s; }
.rithma-voice-field__bar:nth-child(6) { animation-delay: 0.24s; }
.rithma-voice-field__bar:nth-child(7) { animation-delay: 0.16s; }
.rithma-voice-field__bar:nth-child(8) { animation-delay: 0.08s; }
.rithma-voice-field__bar:nth-child(9) { animation-delay: 0s; }

.shift-chat__speech-status-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.shift-chat__speech-status-label {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
}
.shift-chat__speech-status-hint {
  font-size: 0.875rem;
  line-height: 1.35;
  color: #64748b;
}

/* Listening — aurora voice field alive */
.shift-chat--speech-listening .shift-chat__speech-status {
  background: transparent;
  border: none;
  box-shadow: none;
}
.shift-chat--speech-listening .rithma-voice-field__aurora {
  opacity: 0.95;
  transform: scale(1);
}
.shift-chat--speech-listening .rithma-voice-field__orbit {
  opacity: 1;
}
.shift-chat--speech-listening .rithma-voice-field__spark {
  opacity: 1;
}
.shift-chat--speech-listening .rithma-voice-field__core {
  background: linear-gradient(145deg, #34d399 0%, #059669 55%, #047857 100%);
  animation: rithma-vf-core-glow 1.6s ease-in-out infinite;
  transform: translateY(-1px);
}
.shift-chat--speech-listening .rithma-voice-field__bar {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.15), #34d399 45%, #6ee7b7);
  animation: rithma-vf-bar-dance 1.15s cubic-bezier(0.45, 0.05, 0.25, 1) infinite;
  opacity: 1;
}
.shift-chat--speech-listening .shift-chat__speech-status-label {
  color: #047857;
}
.shift-chat--speech-listening .shift-chat__speech-status-hint {
  color: #059669;
}

/* Not listening (idle) — field at rest */
.shift-chat--speech-idle .shift-chat__speech-status {
  background: transparent;
  border: none;
}
.shift-chat--speech-idle .rithma-voice-field__core {
  background: linear-gradient(145deg, #94a3b8 0%, #64748b 100%);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.shift-chat--speech-idle .rithma-voice-field__bar {
  transform: scaleY(0.18);
  opacity: 0.35;
  animation: none;
}
.shift-chat--speech-idle .shift-chat__speech-status-label {
  color: #475569;
}

/* Speaking — blue outbound wave */
.shift-chat--speech-speaking .shift-chat__speech-status {
  background: transparent;
  border: none;
}
.shift-chat--speech-speaking .rithma-voice-field__aurora {
  opacity: 0.7;
  background: conic-gradient(
    from 160deg,
    rgba(37, 99, 235, 0.5),
    rgba(96, 165, 250, 0.25),
    rgba(14, 165, 233, 0.35),
    rgba(59, 130, 246, 0.45),
    rgba(37, 99, 235, 0.5)
  );
}
.shift-chat--speech-speaking .rithma-voice-field__orbit--a {
  opacity: 0.85;
  border-top-color: rgba(96, 165, 250, 0.8);
  animation-duration: 3.4s;
}
.shift-chat--speech-speaking .rithma-voice-field__core {
  background: linear-gradient(145deg, #60a5fa 0%, #2563eb 55%, #1d4ed8 100%);
  animation: rithma-vf-core-breathe 1.5s ease-in-out infinite;
}
.shift-chat--speech-speaking .rithma-voice-field__bar {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), #60a5fa);
  animation: rithma-vf-bar-wave 1.35s ease-in-out infinite;
  opacity: 0.9;
}
.shift-chat--speech-speaking .shift-chat__speech-status-label {
  color: #1d4ed8;
}

/* Waiting / thinking — amber chase */
.shift-chat--speech-waiting .shift-chat__speech-status {
  background: transparent;
  border: none;
}
.shift-chat--speech-waiting .rithma-voice-field__aurora {
  opacity: 0.55;
  background: conic-gradient(
    from 90deg,
    rgba(245, 158, 11, 0.45),
    rgba(251, 191, 36, 0.2),
    rgba(249, 115, 22, 0.3),
    rgba(245, 158, 11, 0.45)
  );
  animation-duration: 3s;
}
.shift-chat--speech-waiting .rithma-voice-field__orbit--b {
  opacity: 0.75;
  border-bottom-color: rgba(251, 191, 36, 0.75);
  animation-duration: 1.6s;
}
.shift-chat--speech-waiting .rithma-voice-field__core {
  background: linear-gradient(145deg, #fbbf24 0%, #f59e0b 55%, #d97706 100%);
  animation: rithma-vf-core-breathe 0.95s ease-in-out infinite;
}
.shift-chat--speech-waiting .rithma-voice-field__bar {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.15), #fbbf24);
  animation: rithma-vf-bar-chase 1.1s ease-in-out infinite;
  opacity: 0.85;
}
.shift-chat--speech-waiting .shift-chat__speech-status-label {
  color: #b45309;
}

/* Sending */
.shift-chat--speech-sending .shift-chat__speech-status {
  background: transparent;
  border: none;
}
.shift-chat--speech-sending .rithma-voice-field__core {
  background: linear-gradient(145deg, #94a3b8 0%, #64748b 100%);
  animation: rithma-vf-core-burst 0.85s ease-out infinite;
}
.shift-chat--speech-sending .rithma-voice-field__bar {
  animation: rithma-vf-bar-burst 0.85s ease-out infinite;
  opacity: 0.75;
}

@keyframes rithma-vf-aurora-morph {
  0%, 100% {
    border-radius: 43% 57% 58% 42% / 48% 44% 56% 52%;
    transform: rotate(0deg) scale(1);
  }
  33% {
    border-radius: 58% 42% 48% 52% / 42% 58% 43% 57%;
    transform: rotate(120deg) scale(1.06);
  }
  66% {
    border-radius: 52% 48% 42% 58% / 57% 43% 58% 42%;
    transform: rotate(240deg) scale(0.96);
  }
}
@keyframes rithma-vf-orbit {
  to { transform: rotate(360deg); }
}
@keyframes rithma-vf-orbit-tilt {
  from { transform: rotate(38deg); }
  to { transform: rotate(398deg); }
}
@keyframes rithma-vf-spark {
  0%, 100% { transform: scale(0.6); opacity: 0.2; }
  50% { transform: scale(1.15); opacity: 1; }
}
@keyframes rithma-vf-core-glow {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(52, 211, 153, 0.45),
      0 6px 22px rgba(16, 185, 129, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transform: translateY(-1px) scale(1);
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(52, 211, 153, 0),
      0 10px 32px rgba(16, 185, 129, 0.45),
      inset 0 2px 0 rgba(255, 255, 255, 0.55);
    transform: translateY(-2px) scale(1.04);
  }
}
@keyframes rithma-vf-core-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.94); }
}
@keyframes rithma-vf-core-burst {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes rithma-vf-bar-dance {
  0%, 100% { transform: scaleY(0.28); }
  18% { transform: scaleY(0.92); }
  36% { transform: scaleY(0.42); }
  54% { transform: scaleY(1); }
  72% { transform: scaleY(0.58); }
  86% { transform: scaleY(0.78); }
}
@keyframes rithma-vf-bar-wave {
  0%, 100% { transform: scaleY(0.3); opacity: 0.55; }
  50% { transform: scaleY(0.95); opacity: 1; }
}
@keyframes rithma-vf-bar-chase {
  0%, 100% { transform: scaleY(0.25); opacity: 0.5; }
  25% { transform: scaleY(0.7); opacity: 0.85; }
  50% { transform: scaleY(0.4); opacity: 0.65; }
  75% { transform: scaleY(0.88); opacity: 0.95; }
}
@keyframes rithma-vf-bar-burst {
  0% { transform: scaleY(0.2); }
  35% { transform: scaleY(0.75); }
  100% { transform: scaleY(0.25); }
}
@keyframes chat-speech-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .shift-chat__speech-mode-btn.is-listening,
  .rithma-voice-field__aurora,
  .rithma-voice-field__orbit,
  .rithma-voice-field__spark,
  .rithma-voice-field__core,
  .rithma-voice-field__bar {
    animation: none !important;
  }
}

/* Speech dock — web: compact strip above composer; native: bottom overlay stage */
.shift-chat__speech-dock {
  display: none;
  position: relative;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 8px;
  background: transparent;
}
.shift-chat--speech-mode .shift-chat__speech-dock {
  display: flex;
}
.shift-chat__speech-dock-transcript {
  min-height: 0;
  max-height: 6rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  border: none;
  box-shadow: none;
  /* Clears the mute + exit buttons pinned to the dock's top-right corner. */
  padding: 0 78px 0 0;
}
.shift-chat__speech-transcript {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
  color: #0f172a;
  word-break: break-word;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}
.shift-chat__speech-transcript.is-placeholder {
  color: #64748b;
  font-style: italic;
}
.shift-chat__speech-exit-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.shift-chat__speech-exit-btn:hover {
  background: rgba(15, 23, 42, 0.12);
  color: #334155;
}
.shift-chat__speech-exit-btn:active {
  transform: scale(0.94);
}
.shift-chat__speech-exit-icon {
  display: block;
  flex-shrink: 0;
}
/* Mute sits left of the exit button; speech mode keeps running, just silent. */
.shift-chat__speech-mute-btn {
  position: absolute;
  top: 0;
  right: 40px;
  z-index: 3;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.shift-chat__speech-mute-btn:hover {
  background: rgba(15, 23, 42, 0.12);
  color: #334155;
}
.shift-chat__speech-mute-btn:active {
  transform: scale(0.94);
}
.shift-chat__speech-mute-btn.is-muted {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}
.shift-chat__speech-mute-btn.is-muted:hover {
  background: rgba(220, 38, 38, 0.18);
  color: #991b1b;
}
.shift-chat__speech-mute-icon {
  display: block;
  flex-shrink: 0;
}
.shift-chat__speech-mute-icon--off,
.shift-chat__speech-mute-btn.is-muted .shift-chat__speech-mute-icon--on {
  display: none;
}
.shift-chat__speech-mute-btn.is-muted .shift-chat__speech-mute-icon--off {
  display: block;
}

/* Native app — speech focus: hide text field, fullscreen thread, bottom mic stage */
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__bar,
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__quota,
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__pending-photos,
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__share-family,
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .ai-chat-disclaimer {
  display: none !important;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__composer {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 4px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-bottom: max(8px, var(--rithma-safe-bottom));
  border-top: none;
  background: transparent;
  box-shadow: none;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-dock {
  margin: 0;
  gap: 6px;
  min-height: 0;
  padding-top: 2px;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-dock-transcript {
  max-height: 18vh;
  min-height: 0;
  padding: 0 76px 2px 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-transcript {
  font-size: 1.0625rem;
  line-height: 1.45;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-status {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-status-visual {
  width: 96px;
  height: 96px;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .rithma-voice-field__core {
  width: 48px;
  height: 48px;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .rithma-voice-field__icon {
  width: 26px;
  height: 26px;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .rithma-voice-field__spectrum {
  width: 92%;
  height: 46%;
  gap: 4px;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .rithma-voice-field__bar {
  max-width: 5px;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .rithma-voice-field__spark {
  width: 6px;
  height: 6px;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus.shift-chat--speech-listening .rithma-voice-field__aurora {
  filter: blur(14px) saturate(1.35);
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-status-label {
  font-size: 1.125rem;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-status-hint {
  font-size: 0.875rem;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-exit-btn {
  top: -2px;
  right: 0;
  width: 32px;
  height: 32px;
  background: rgba(15, 23, 42, 0.1);
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-mute-btn {
  top: -2px;
  right: 38px;
  width: 32px;
  height: 32px;
  background: rgba(15, 23, 42, 0.1);
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__speech-mute-btn.is-muted {
  background: rgba(220, 38, 38, 0.16);
}
/* Speech focus: scroll the latest message to the very top; the gap beneath it
   (between the message and the mic dock) may be empty by design. */
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__thread,
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__thread.messenger-bubbles {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  justify-content: flex-start !important;
  padding-top: 8px;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus .shift-chat__thread.messenger-bubbles::before {
  display: none;
}
html[data-rithma-native-app="1"] .current-shift-root--chat .shift-chat--speech-mobile-focus .shift-chat__thread,
html[data-rithma-native-app="1"] .current-shift-root--chat .shift-chat--speech-mobile-focus .shift-chat__thread.messenger-bubbles {
  justify-content: flex-start !important;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus [data-agency-chat-messages-list],
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus [data-shift-chat-messages-list] {
  justify-content: flex-start;
}
html[data-rithma-native-app="1"] .shift-chat--speech-mobile-focus.shift-chat--speech-listening .shift-chat__speech-status-visual {
  filter: drop-shadow(0 12px 32px rgba(16, 185, 129, 0.22));
}
.shift-chat__bar .voice-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  overflow: visible;
}
.shift-chat__bar .voice-input-btn {
  z-index: 2;
}
.shift-chat__bar .voice-input-wrap > textarea.shift-chat__input {
  width: 100%;
  box-sizing: border-box;
}
.shift-chat__icon-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin-top: 6px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.shift-chat__icon-btn:hover {
  background: #e2e8f0;
  color: var(--primary);
}
.shift-chat__icon-btn:active {
  transform: scale(0.96);
}
.shift-chat__icon-btn .shift-chat__icon-svg {
  display: block;
  flex-shrink: 0;
}
.shift-chat__input {
  flex: 1;
  min-height: 24px;
  max-height: 120px;
  resize: none;
  border: none;
  background: transparent;
  padding: 10px 0;
  margin: 0;
  font-size: 0.95em;
  line-height: 1.4;
  box-shadow: none;
}
.shift-chat__input:focus {
  outline: none;
  border: none;
  box-shadow: none;
}
.shift-chat__send-btn {
  align-self: center;
}
.shift-chat__pending-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.shift-chat__pending-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82em;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.25);
}
.shift-chat-bubble__photos {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.88em;
}
.shift-chat-bubble__photos a {
  color: inherit;
  text-decoration: underline;
}
.shift-media-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.shift-media-list li {
  margin: 0 0 8px;
}
.shift-media-list a {
  font-weight: 500;
}
@media (max-width: 830px) {
  .main:has(.current-shift-root--chat) {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--layout-mobile-topbar-height));
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .main:has(.current-shift-root--chat) .page-header,
  .main:has(.current-shift-root--chat) .current-shift-picker,
  .main:has(.current-shift-root--chat) .current-shift-visit-header {
    flex-shrink: 0;
  }
  #current-shift-root.current-shift-root--chat {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .current-shift-root--chat .current-shift-subtabs {
    flex-shrink: 0;
  }
  .current-shift-root--chat .current-shift-tab-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .current-shift-root--chat .current-shift-chat-overlay:not([hidden]) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .current-shift-root--chat .current-shift-chat-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    padding-bottom: 0;
    margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  }
  .current-shift-root--chat .shift-chat {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    --shift-chat-thread-height: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .current-shift-root--chat .shift-chat__thread,
  .current-shift-root--chat .shift-chat__thread.messenger-bubbles {
    flex: 1 1 0;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    justify-content: flex-start;
    touch-action: pan-y;
  }
  .current-shift-root--chat .ai-chat-disclaimer {
    flex-shrink: 0;
    margin: 0;
    border-radius: 0;
  }
  .current-shift-root--chat .shift-chat__composer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 2;
    margin: 0;
    flex-shrink: 0;
    box-shadow: none;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: max(10px, var(--rithma-safe-bottom));
  }
  body:has(.bottom-nav.bottom-nav--ready) .current-shift-root--chat .shift-chat__composer {
    padding-bottom: max(
      10px,
      calc(
        var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
          var(--rithma-safe-bottom)
      )
    );
  }
  /* Full-screen chat keeps the composer in the panel flex column (not viewport-fixed). */
  .current-shift-root--chat .shift-chat.is-chat-fullscreen .shift-chat__composer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 2;
    box-shadow: none;
  }
  .current-shift-root--chat:has(.shift-chat.is-chat-fullscreen) .current-shift-chat-layout {
    padding-bottom: 0;
    margin-bottom: 0;
  }
}
html[data-rithma-native-app="1"] .main:has(.current-shift-root--chat) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}
html[data-rithma-native-app="1"] #current-shift-root.current-shift-root--chat {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
html[data-rithma-native-app="1"] .current-shift-root--chat .shift-chat {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
html[data-rithma-native-app="1"] .current-shift-root--chat .shift-chat__thread,
html[data-rithma-native-app="1"] .current-shift-root--chat .shift-chat__thread.messenger-bubbles {
  flex: 1 1 0;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  justify-content: flex-start;
  touch-action: pan-y;
}
html[data-rithma-native-app="1"] .current-shift-root--chat .shift-chat__composer {
  margin-top: 0;
  flex-shrink: 0;
  padding-bottom: max(
    10px,
    calc(
      var(--bottom-nav-track-height) + var(--bottom-nav-bottom-padding) +
        var(--rithma-safe-bottom)
    )
  );
}
html[data-rithma-native-app="1"] .current-shift-root--chat .shift-chat.is-chat-fullscreen .shift-chat__composer {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 2;
  box-shadow: none;
}
html[data-rithma-native-app="1"] .current-shift-root--chat:has(.shift-chat.is-chat-fullscreen) .current-shift-chat-layout {
  padding-bottom: 0;
  margin-bottom: 0;
}
.main-chat-panel.is-chat-fullscreen .shift-chat__composer {
  flex-shrink: 0;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  margin-top: auto;
  box-shadow: none;
  z-index: 2;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-bottom: max(10px, var(--rithma-safe-bottom));
}
.main-chat-panel.is-chat-fullscreen .ai-chat-disclaimer {
  flex-shrink: 0;
  margin: 8px 12px 0;
}

/* Current shift — visit picker (card list) */
.visit-picker {
  margin-bottom: 16px;
  padding: 14px 16px 12px;
  border-left: 4px solid var(--primary, #2563eb);
}
.visit-picker__header {
  margin-bottom: 12px;
}
.visit-picker__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.visit-picker__intro {
  margin: 0;
  line-height: 1.45;
}
.visit-picker__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.visit-picker__option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--surface, #fff);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.visit-picker__option:hover {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 35%, var(--border, #e2e8f0));
  background: var(--surface-2, #f8fafc);
}
.visit-picker__option--active {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 7%, var(--surface, #fff));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 28%, transparent);
}
.visit-picker__chevron {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--primary, #2563eb);
  line-height: 1;
}
.visit-picker__option--active .visit-picker__chevron {
  font-weight: 700;
}
.visit-picker__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.visit-picker__client {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--text, #0f172a);
  overflow-wrap: break-word;
}
.visit-picker__when {
  display: block;
  line-height: 1.35;
}
.visit-picker__badges {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
@media (max-width: 480px) {
  .visit-picker__option {
    flex-wrap: wrap;
  }
  .visit-picker__badges {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
    padding-left: calc(1.25rem + 12px);
  }
}
.visit-picker__badge {
  font-size: 0.72rem;
  white-space: nowrap;
}
.visit-picker__footer {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border, #e2e8f0);
}
.visit-picker__footer a {
  font-weight: 600;
  text-decoration: none;
}

.visit-picker--foldable {
  padding: 0;
}
.visit-picker--foldable > .visit-picker__summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 6px 12px;
  padding: 14px 16px;
  padding-inline-start: calc(16px + var(--disclosure-marker-inset));
  margin: 0;
}
.visit-picker--foldable > .visit-picker__summary::-webkit-details-marker {
  display: none;
}
.visit-picker--foldable > .visit-picker__summary::marker {
  content: "";
}
.visit-picker__summary-label {
  grid-column: 1 / -1;
  width: auto;
  margin: 0;
}
.visit-picker__summary-body {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.visit-picker__summary-badges {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.visit-picker__toggle-hint {
  grid-column: 2;
  justify-self: end;
  align-self: start;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--primary, #2563eb);
}
.visit-picker--foldable[open] .visit-picker__toggle-hint::after {
  content: " ▴";
}
.visit-picker--foldable:not([open]) .visit-picker__toggle-hint::after {
  content: " ▾";
}
.visit-picker__panel {
  padding: 0 16px 14px;
  border-top: 1px dashed var(--border, #e2e8f0);
}
.visit-picker--locked .visit-picker__summary--static {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 6px 12px;
  padding: 12px 14px;
  cursor: default;
}
.visit-picker__locked-note {
  margin: 0;
  padding: 0 14px 12px;
}
.visit-picker--foldable[open] .visit-picker__panel {
  padding-top: 12px;
}

/* Travel drive panel (caregiver current shift — mobile-first) */
.travel-drive-panel {
  border-left: 4px solid var(--border, #e2e8f0);
}
.travel-drive-panel--active {
  border-color: var(--primary, #2563eb);
  border-left-width: 4px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 35%, transparent);
}
.travel-drive-panel__header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 4px;
}
.travel-drive-panel__context strong {
  color: var(--text, #0f172a);
}
.travel-drive-panel__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.travel-drive-panel__elapsed {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.travel-drive-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Visit drives — leg cards */
.travel-visit-drives--disabled .travel-drive-btn--start:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.travel-visit-drives--disabled .travel-drive-leg--idle {
  opacity: 0.85;
}
.travel-visit-drives {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.travel-visit-drives__head {
  margin-bottom: 14px;
}
.travel-visit-drives__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.travel-visit-drives__intro {
  margin: 0;
  line-height: 1.45;
}
.travel-visit-drives__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.travel-drive-leg {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--surface-2, #f8fafc);
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
}
.travel-drive-leg:last-child {
  margin-bottom: 0;
}
.travel-drive-leg--inbound {
  border-left: 4px solid var(--primary, #2563eb);
}
.travel-drive-leg--outbound {
  border-left: 4px solid var(--success, #16a34a);
}
.travel-drive-leg--home {
  border-left: 4px solid var(--warning, #d97706);
}
.travel-drive-leg--idle {
  opacity: 0.72;
}
.travel-drive-leg__idle {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface, #fff);
}
.travel-drive-leg__icon--home {
  color: var(--warning, #d97706);
  background: color-mix(in srgb, var(--warning, #d97706) 14%, white);
}
.travel-drive-leg--active {
  background: color-mix(in srgb, var(--primary, #2563eb) 6%, var(--surface-2, #f8fafc));
  border-color: color-mix(in srgb, var(--primary, #2563eb) 40%, var(--border, #e2e8f0));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 22%, transparent);
}
.travel-drive-leg--outbound.travel-drive-leg--active {
  background: color-mix(in srgb, var(--success, #16a34a) 8%, var(--surface-2, #f8fafc));
  border-color: color-mix(in srgb, var(--success, #16a34a) 45%, var(--border, #e2e8f0));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success, #16a34a) 22%, transparent);
}
.travel-drive-leg__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.travel-drive-leg__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}
.travel-drive-leg__icon--inbound {
  color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 14%, white);
}
.travel-drive-leg__icon--outbound {
  color: var(--success, #16a34a);
  background: color-mix(in srgb, var(--success, #16a34a) 14%, white);
}
.travel-drive-leg__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.travel-drive-leg__phase {
  font-size: 1rem;
  line-height: 1.25;
}
.travel-drive-leg__detail {
  display: block;
  line-height: 1.35;
}
.travel-drive-leg__badge {
  flex-shrink: 0;
  align-self: flex-start;
}
.travel-drive-leg__dest {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface, #fff);
  border: 1px dashed var(--border, #e2e8f0);
}
.travel-drive-leg__geofence {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
}
.travel-drive-leg__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.travel-drive-leg__actions .travel-drive-form {
  width: 100%;
  margin: 0;
}
.travel-drive-btn {
  width: 100%;
  min-height: 3rem;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  justify-content: center;
}
.travel-drive-btn--start {
  box-shadow: 0 1px 2px rgb(15 23 42 / 10%);
}
.travel-drive-btn--arrive {
  min-width: 0;
  box-shadow: 0 1px 2px rgb(22 163 74 / 20%);
}

.travel-errand-section {
  margin-top: 4px;
}
.travel-errand-section--after-visit {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border, #e2e8f0);
}

/* Errand charge picker (off-shift) */
.travel-errand-actions {
  flex-direction: column;
  align-items: stretch;
}
.travel-errand-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}
.travel-errand-form__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.travel-errand-form__start {
  min-width: 0;
}
.errand-charge-note {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-2, #f8fafc);
  font-size: 0.92rem;
}
.errand-charge-note--active {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 35%, var(--border, #e2e8f0));
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--surface-2, #f8fafc));
}
.errand-charge-note__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.errand-charge-note__hint {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
}
.errand-charge-panel {
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
  --errand-client-block-height: 5.75rem;
  --errand-client-block-gap: 8px;
}
.errand-charge-panel__legend {
  padding: 0;
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.errand-charge-panel__intro {
  margin: 0 0 12px;
}
.errand-charge-panel__choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.errand-charge-panel__group-label {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.errand-charge-panel__client-list {
  display: flex;
  flex-direction: column;
  gap: var(--errand-client-block-gap);
  max-height: calc(
    16px + var(--errand-client-block-height) * 3 + var(--errand-client-block-gap) * 2
  );
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-2, #f8fafc);
}
.errand-charge-option--client {
  flex-shrink: 0;
  height: var(--errand-client-block-height);
  box-sizing: border-box;
  align-items: center;
}
.errand-charge-option--client .errand-charge-option__body {
  overflow: hidden;
}
.errand-charge-option--client .errand-charge-option__hint {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.errand-charge-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--card, #fff);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.errand-charge-option:hover {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 35%, var(--border, #e2e8f0));
  background: color-mix(in srgb, var(--primary, #2563eb) 4%, var(--card, #fff));
}
.errand-charge-option:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 10%, var(--card, #fff));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 20%, transparent);
}
.errand-charge-option:has(input:focus-visible) {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}
.errand-charge-option input[type="radio"] {
  flex-shrink: 0;
  margin-top: 3px;
}
.errand-charge-option__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.errand-charge-option__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text, #0f172a);
}
.errand-charge-option:has(input:checked) .errand-charge-option__title {
  color: var(--primary-dark, #1d4ed8);
}
.errand-charge-option__hint {
  font-size: 0.84rem;
  line-height: 1.4;
  font-weight: 400;
  color: var(--muted, #64748b);
}
@media (max-width: 480px) {
  .travel-errand-form__start {
    width: 100%;
  }
}

.travel-map-dialog {
  border: none;
  padding: 0;
  margin: auto;
  width: min(96vw, 880px);
  min-width: min(96vw, 520px);
  max-width: min(96vw, 880px);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.28);
}
.travel-map-dialog__panel {
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.travel-map-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.travel-map-dialog__head-text {
  min-width: 0;
  flex: 1;
}
.travel-map-dialog__title {
  margin: 0 0 4px;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}
.travel-map-dialog__route {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text, #0f172a);
  line-height: 1.4;
}
.travel-map-dialog__meta {
  margin: 6px 0 0;
}
.travel-map-dialog__close {
  flex-shrink: 0;
  min-width: 2.25rem;
  padding-inline: 0.65rem;
}
.travel-map-dialog__canvas-wrap {
  position: relative;
  min-height: 320px;
  background: var(--surface-muted, #f1f5f9);
}
.travel-map-dialog__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--text-muted, #64748b);
  font-size: 0.875rem;
}
.travel-map-dialog__loading[hidden] {
  display: none;
}
.travel-map-dialog__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border, #cbd5e1);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: travel-map-spin 0.75s linear infinite;
}
@keyframes travel-map-spin {
  to { transform: rotate(360deg); }
}
.travel-map-canvas {
  width: 100%;
  min-height: 320px;
  height: clamp(320px, 58vh, 520px);
  border: none;
  border-radius: 0;
  margin: 0;
  z-index: 1;
}
.travel-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  font-size: 0.8125rem;
  color: var(--text-muted, #64748b);
}
.travel-map-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.travel-map-legend__item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.travel-map-legend__item--start::before {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}
.travel-map-legend__item--end::before {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}
.travel-map-legend__item--route::before {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: #2563eb;
}
.travel-map-legend__item--route.travel-map-legend__item--estimated::before {
  background: repeating-linear-gradient(
    90deg,
    #64748b 0 4px,
    transparent 4px 8px
  );
}
.travel-map-dialog__actions {
  padding: 12px 20px 16px;
  margin-top: 0;
  border-top: 1px solid var(--border, #e2e8f0);
}
.travel-map-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.travel-map-open-btn__icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.85;
}
.period-window-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.period-window-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.period-window-mode-group {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-muted, #f8fafc);
}
.period-window-mode-group .btn {
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}
.period-window-mode-group .btn + .btn {
  border-left: 1px solid var(--border, #d1d5db);
}
.period-window-month-controls {
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.period-window-month-label {
  min-width: 160px;
  text-align: center;
}
.period-window-custom-form {
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}
.period-window-date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.period-window-date-field__label {
  font-weight: 600;
}
.period-window-body--overlay-host {
  position: relative;
}
.period-window-body--loading {
  pointer-events: none;
}
.period-window-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(2px);
  border-radius: inherit;
  box-sizing: border-box;
}
.period-window-loading-overlay[hidden] {
  display: none !important;
}
.period-window-loading-overlay__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: agency-chat-spin 0.75s linear infinite;
}
.period-window-loading-overlay__text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.period-window-body--loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(90deg, var(--primary, #2563eb), var(--accent, #0ea5e9));
  transform-origin: left center;
  animation: rithma-swap-loading-bar 1s ease-in-out infinite;
  border-radius: inherit inherit 0 0;
}
.period-window-filter-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-weight: 600;
  color: var(--primary, #2563eb);
}
.period-window-filter-status[hidden] {
  display: none !important;
}
.period-window-filter-status__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(37, 99, 235, 0.25);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: agency-chat-spin 0.75s linear infinite;
  flex-shrink: 0;
}
.period-window-card.period-window-loading [data-period-window-body] {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.public-page {
  background: #f8fafc;
  color: var(--text, #0f172a);
  min-height: 100vh;
  min-height: 100dvh;
}
.public-page__shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
}
.public-page__header {
  display: block;
  margin-bottom: 18px;
}
.public-page__header h1 {
  margin: 0 0 8px;
  color: var(--primary, #2563eb);
}
.public-page__stats {
  margin-bottom: 14px;
}
.public-page__card {
  margin-bottom: 14px;
}
.public-page__footer {
  margin-top: 18px;
}

/* Public post-visit satisfaction survey */
.visit-satisfaction-survey {
  max-width: 36rem;
  margin: 2rem auto;
  padding: 22px 24px;
}
.visit-satisfaction-survey__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.25;
}
.visit-satisfaction-survey__intro {
  margin: 0 0 20px;
  line-height: 1.5;
}
.visit-satisfaction-survey__form .form-group > label {
  display: block;
  font-weight: 600;
}
.visit-satisfaction-survey__hint {
  margin: 0 0 10px;
}
.visit-satisfaction-survey__ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.visit-satisfaction-survey__form .form-group .visit-satisfaction-survey__rating {
  display: inline-flex;
  margin-bottom: 0;
  font-weight: 600;
  font-size: 1rem;
}
.visit-satisfaction-survey__rating {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.85rem;
  min-height: 2.85rem;
  padding: 0 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface, #fff);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.visit-satisfaction-survey__rating:hover {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 45%, var(--border, #e2e8f0));
}
.visit-satisfaction-survey__rating:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 12%, #fff);
  box-shadow: 0 0 0 3px var(--primary-light, rgba(37, 99, 235, 0.15));
}
.visit-satisfaction-survey__rating input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.visit-satisfaction-survey__rating span {
  pointer-events: none;
}
.visit-satisfaction-survey__actions {
  margin-top: 4px;
}
.visit-satisfaction-survey .flash {
  margin-bottom: 14px;
}

/* Complaint conversation thread */
.complaint-conversation {
  margin-top: 14px;
}

.complaint-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.complaint-thread__item {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface, #fff);
}

.complaint-thread__item--agency {
  border-left: 4px solid var(--primary, #2563eb);
  background: var(--surface-muted, #f8fafc);
}

.complaint-thread__item--consumer {
  border-left: 4px solid var(--accent, #0d9488);
}

.complaint-thread__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.complaint-thread__author {
  font-size: 0.95rem;
}

.complaint-thread__role {
  font-size: 0.75rem;
}

.complaint-thread__time {
  margin-left: auto;
}

.complaint-thread__body {
  white-space: pre-wrap;
  line-height: 1.5;
}

.complaint-summary {
  margin-bottom: 14px;
}

.complaint-summary__description {
  white-space: pre-wrap;
  line-height: 1.5;
  margin-top: 4px;
}

/* Client billing — Ready to bill */
.billing-ready-filters {
  margin-bottom: 16px;
}
.billing-ready-filters--embedded {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.client-billing-unbilled-window .billing-ready-panel {
  padding-top: 0;
}
.client-billing-unbilled-window [data-period-window-body] {
  padding-top: 16px;
}
.client-billing-unbilled-form__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.client-billing-unbilled-form__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.client-billing-unbilled-form__hint {
  flex: 1 1 100%;
  margin: 0;
}
.billing-ready-table input[type="checkbox"],
.client-billing-unbilled-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
@media (max-width: 830px) {
  .billing-ready-table input[type="checkbox"],
  .client-billing-unbilled-table input[type="checkbox"] {
    width: 1.35rem;
    height: 1.35rem;
    min-width: 1.35rem;
    min-height: 1.35rem;
  }
}
.billing-ready-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  align-items: end;
}
.billing-ready-filters__grid .form-group {
  margin-bottom: 0;
  min-width: 0;
}
.billing-ready-filters__grid .form-group input,
.billing-ready-filters__grid .form-group select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  box-sizing: border-box;
}
.billing-ready-filters__hint {
  margin: 10px 0 0;
}
.billing-service-types-table-wrap {
  margin-bottom: 10px;
}
.billing-service-types-table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 4px;
}
.billing-service-types-table-actions__hint {
  margin: 0;
}
.billing-service-types-add__btn {
  flex-shrink: 0;
}
.billing-service-types-row-remove {
  white-space: nowrap;
}
.billing-benefit-usage {
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-muted, #f8fafc);
}
.billing-benefit-usage--warn {
  border-color: #f59e0b;
  background: #fffbeb;
}
.billing-benefit-usage__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.billing-benefit-usage__month-nav {
  margin-left: auto;
  align-items: center;
}
.auth-usage-loading {
  opacity: 0.72;
}
.billing-benefit-usage__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border, #e2e8f0);
  overflow: hidden;
  margin-bottom: 8px;
}
.billing-benefit-usage__bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary, #2563eb);
}
.billing-benefit-usage--warn .billing-benefit-usage__bar-fill {
  background: #f59e0b;
}
.billing-benefit-usage__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.92rem;
}
.billing-benefit-usage__warn {
  margin: 8px 0 0;
  color: #b45309;
}
.billing-invoice-payer-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin: 0;
}
.billing-invoice-payer-details dt {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  margin: 0 0 2px;
}
.billing-invoice-payer-details dd {
  margin: 0;
}
.billing-ready-window.period-window-loading .billing-ready-panel {
  opacity: 1;
  pointer-events: none;
}
.billing-ready-panel--loading {
  transition: opacity 0.15s ease;
}
.billing-ready-panel--loading:not(.period-window-body--loading) {
  opacity: 0.72;
}
.billing-ready-filters--loading .input {
  border-color: rgba(37, 99, 235, 0.35);
}
.filter-table-loading {
  pointer-events: none;
}
.card.filter-table-loading,
.card .filter-table-loading {
  min-height: 120px;
}
.billing-ready-panel__head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.billing-ready-panel__period {
  margin: 4px 0 0;
}
.billing-ready-panel__meta {
  margin: 0 0 12px;
}
.billing-ready-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.billing-ready-summary__item {
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
}
.billing-ready-summary__value {
  display: block;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.2;
  color: var(--text, #0f172a);
}
.billing-ready-summary__label {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.billing-ready-summary__item--ok .billing-ready-summary__value {
  color: var(--success, #16a34a);
}
.billing-ready-summary__item--warn .billing-ready-summary__value {
  color: var(--warning, #d97706);
}
.billing-ready-summary__item--money .billing-ready-summary__value {
  font-variant-numeric: tabular-nums;
}
.billing-ready-table__row--blocked {
  background: color-mix(in srgb, var(--warning, #d97706) 6%, transparent);
}
.billing-ready-issues {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--warning, #b45309);
  line-height: 1.45;
}
.billing-ready-issues li + li {
  margin-top: 2px;
}
.billing-ready-empty {
  padding: 28px 12px;
  text-align: center;
}
.billing-ready-empty__title {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.billing-ready-empty__hint {
  max-width: 36rem;
  margin: 0 auto;
}

/* Shared billing list tables (invoices, rates, line items) */
.billing-table-panel .config-section-card__title {
  margin-bottom: 12px;
}
.billing-table-panel .table-scroll {
  margin: 0 -4px;
}
.billing-table.billing-table--compact {
  font-size: 0.875rem;
}
.billing-table.billing-table--compact th,
.billing-table.billing-table--compact td {
  padding-top: 8px;
  padding-bottom: 8px;
}
.billing-rates-table-wrap {
  margin-top: 8px;
}
.billing-rates-table .billing-rates-table__input {
  width: 100%;
  min-width: 5.5rem;
  max-width: 7.5rem;
  text-align: right;
}
.billing-rates-table td.tbl-col--money {
  vertical-align: middle;
}
.billing-table .tbl-col--wrap {
  max-width: 280px;
  line-height: 1.35;
}
.billing-ready-table,
.billing-table {
  margin-bottom: 0;
}

/* ---- Custom (agency-uploaded) form data entry ---- */
.custom-form-shell.is-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}
.custom-form-shell.is-split > .intake-form-layout > .card {
  max-width: none !important;
  margin: 0;
}
.custom-form-oldpdf {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.custom-form-oldpdf__head h3 {
  margin: 0 0 4px;
}
.custom-form-oldpdf iframe {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
}
@media (max-width: 960px) {
  .custom-form-shell.is-split {
    grid-template-columns: 1fr;
  }
  .custom-form-shell.is-split > .card,
  .custom-form-shell.is-split > .intake-form-layout > .card {
    width: 100%;
    max-width: 100% !important;
  }
  .custom-form-oldpdf {
    position: static;
    order: -1;
  }
  .custom-form-oldpdf iframe {
    height: 50vh;
  }
}
.custom-form-fields .custom-form-added-note {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.86rem;
  margin: 0 0 14px;
}
.custom-form-field .custom-form-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Customized form — additional fields on intake / assessment / care plan */
.added-form-fields__intro {
  margin-top: 0;
}
.added-form-field__label {
  font-weight: 600;
  margin-bottom: 6px;
}
.added-form-field__hint {
  margin: 0 0 8px;
}
.added-form-field[data-field-type="checkbox_group"] .added-choice-row {
  margin-top: 2px;
}
.added-form-field[data-field-type="checkbox_group"] .added-choice-grid {
  margin-top: 2px;
}
.added-choice-grid__item {
  padding: 8px 10px;
  border: 1px solid var(--border, #d6e3ec);
  border-radius: 8px;
  background: var(--bg, #fff);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.added-choice-grid__item:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--bg, #fff));
}
.added-choice-pill {
  min-height: 36px;
}
.added-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, #d6e3ec);
  border-radius: 10px;
  background: var(--bg, #fff);
  cursor: pointer;
  max-width: 420px;
}
.added-choice-card:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--bg, #fff));
}
.added-choice-card input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}
.added-choice-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.added-choice-card__title {
  font-weight: 600;
  font-size: 0.95rem;
}
.added-choice-card__hint {
  margin: 0;
}
.added-form-section-inline {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border, #d6e3ec);
}
.care-plan-section__body .added-form-section-inline {
  margin-top: 12px;
}

/* ---- Recruiting (agency ATS) ---- */
.recruiting-stats {
  margin-bottom: 16px;
}

/* Recruiting forms use label-wrapped fields (not .form-group) — mirror global input UI. */
.recruiting-form-section > label:not(.recruiting-visibility-option),
.recruiting-form-section .form-row > label,
.recruiting-settings-grid .config-section-card > label:not(.config-section-ui__checkbox-list),
.recruiting-board-card .form-stack > label,
.recruiting-filter-bar > label,
.recruiting-applicant-aside .form-stack > label,
.recruiting-applicant-main .form-stack > label {
  display: block;
  font-weight: 500;
  margin-bottom: 14px;
  font-size: 0.92em;
  color: var(--text, #0f172a);
}

.recruiting-form-section > label:not(.recruiting-visibility-option) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.recruiting-form-section .form-row > label input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.recruiting-form-section .form-row > label select,
.recruiting-form-section > label:not(.recruiting-visibility-option) select,
.recruiting-form-section > label:not(.recruiting-visibility-option) textarea,
.recruiting-settings-grid .config-section-card > label:not(.config-section-ui__checkbox-list) input,
.recruiting-settings-grid .config-section-card > label:not(.config-section-ui__checkbox-list) textarea,
.recruiting-board-card .form-stack > label textarea,
.recruiting-filter-bar > label select,
.recruiting-applicant-aside .form-stack > label select,
.recruiting-applicant-aside .form-stack > label textarea,
.recruiting-applicant-main .form-stack > label textarea,
.recruiting-form-section .form-inline input:not([type="hidden"]) {
  display: block;
  margin-top: 5px;
  width: 100%;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border, #d6e3ec);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
  background: #fff;
  color: var(--text, #0f172a);
  box-sizing: border-box;
}

.recruiting-form-section .form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.recruiting-form-section .form-inline input:not([type="hidden"]) {
  flex: 1 1 220px;
  margin-top: 0;
}

.recruiting-form-section input:focus,
.recruiting-form-section select:focus,
.recruiting-form-section textarea:focus,
.recruiting-settings-grid input:focus,
.recruiting-settings-grid textarea:focus,
.recruiting-board-card input:focus,
.recruiting-board-card textarea:focus,
.recruiting-filter-bar select:focus,
.recruiting-applicant-aside input:focus,
.recruiting-applicant-aside select:focus,
.recruiting-applicant-aside textarea:focus,
.recruiting-applicant-main textarea:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px var(--primary-light, #eff6ff);
}

.recruiting-form-section textarea,
.recruiting-settings-grid textarea,
.recruiting-board-card textarea,
.recruiting-applicant-aside textarea,
.recruiting-applicant-main textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.45;
}

.recruiting-form-section textarea[readonly],
.recruiting-form-section textarea.full-width {
  background: #f8fafc;
  color: var(--text, #0f172a);
}

.recruiting-board-checklist label,
.recruiting-board-card .form-stack > label:has(> input[type="checkbox"]),
.recruiting-applicant-aside .form-stack > label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  margin-bottom: 10px;
  cursor: pointer;
}

.recruiting-board-checklist label input[type="checkbox"],
.recruiting-board-card label input[type="checkbox"],
.recruiting-applicant-aside label input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--primary, #2563eb);
}

.recruiting-form-section .form-actions,
.recruiting-settings-grid > .form-actions,
.recruiting-applicant-aside .form-stack > button {
  margin-top: 4px;
}

.recruiting-form-section .form-row {
  margin-bottom: 0;
}

.recruiting-form-section .form-row > label:last-child {
  margin-bottom: 14px;
}

label.config-section-ui__checkbox-list {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 500;
  cursor: pointer;
}

label.config-section-ui__checkbox-list input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary, #2563eb);
}

.recruiting-jobs-panel {
  padding: 0;
  overflow: visible;
}

.recruiting-jobs-panel .config-section-card__title {
  padding: 16px 18px 0;
  margin: 0;
}

.recruiting-jobs-empty {
  padding: 12px 18px 12px;
}

.recruiting-jobs-empty .empty-state--compact {
  margin: 0;
}

.recruiting-jobs-panel .table-scroll {
  margin: 0;
}

@media (min-width: 831px) {
  .recruiting-jobs-panel .table-scroll--max-rows {
    max-height: calc(40px + 48px * 10 + 8px);
    overflow: auto;
    contain: paint;
  }
}

/* Job column: wider than default sticky-2 id slot; scroll when title/meta overflow. */
.recruiting-jobs-panel .recruiting-jobs-table.table-sticky-1 > thead > tr > th:first-child,
.recruiting-jobs-panel .recruiting-jobs-table.table-sticky-1 > tbody > tr > td:first-child {
  min-width: 200px;
  max-width: 280px;
  width: 240px;
  vertical-align: top;
}

.recruiting-jobs-panel .recruiting-job-cell {
  max-width: 100%;
  max-height: 3.75rem;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.recruiting-jobs-panel .recruiting-jobs-table .tbl-col--actions-lg {
  min-width: 240px;
  width: 240px;
  max-width: 280px;
}

.recruiting-jobs-panel .table-app-list th:first-child,
.recruiting-jobs-panel .table-app-list td:first-child {
  padding-left: 18px;
}

.recruiting-jobs-panel .table-app-list th:last-child,
.recruiting-jobs-panel .table-app-list td:last-child {
  padding-right: 18px;
}

.recruiting-job-title {
  font-weight: 600;
  color: var(--text, #0f172a);
}

.recruiting-job-title:hover {
  color: var(--primary);
}

.recruiting-job-meta {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  color: var(--muted);
}

.recruiting-pay {
  font-weight: 600;
  white-space: nowrap;
}

.recruiting-footer-link {
  margin-top: 14px;
}

.recruiting-footer-link a {
  font-weight: 600;
}

.recruiting-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 18px;
  align-items: start;
}

.recruiting-ai-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 18px;
  align-items: start;
}

.recruiting-ai-create-card {
  padding: 20px 22px;
}

.recruiting-ai-create-usage {
  margin: 0 0 18px;
}

.recruiting-ai-char-count {
  margin: -6px 0 12px;
}

.recruiting-about-employer-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.recruiting-about-employer-refine-usage {
  margin: -4px 0 8px;
}

.recruiting-ai-create-note {
  margin: 10px 0 0;
}

.recruiting-ai-create-tips {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.recruiting-form-section {
  margin-bottom: 16px;
}

.recruiting-form-section__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.recruiting-form-section__intro {
  margin: 0 0 14px;
  font-size: 0.9rem;
}

.recruiting-visibility-options {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.recruiting-visibility-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 10px);
  background: #f8fafc;
  cursor: pointer;
}

.recruiting-visibility-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light, #eff6ff);
}

.recruiting-visibility-option input {
  margin-top: 8px;
  flex-shrink: 0;
}

.recruiting-visibility-option__body {
  flex: 1;
  min-width: 0;
}

.recruiting-visibility-option__body strong {
  display: block;
  margin-bottom: 2px;
}

.recruiting-visibility-option__body span {
  font-size: 0.88rem;
  color: var(--muted);
}

.recruiting-role-type-panel {
  margin: 4px 0 14px;
  padding: 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.recruiting-role-type-panel label.recruiting-hire-target-card,
.recruiting-role-type-panel label.recruiting-role-type-chip,
.recruiting-role-type-panel label.recruiting-staff-role-card {
  margin-bottom: 0;
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
}

.recruiting-role-type-panel__head {
  margin-bottom: 14px;
}

.recruiting-role-type-panel__title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.recruiting-role-type-panel__intro {
  margin: 0;
  line-height: 1.45;
}

.recruiting-hire-target-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.recruiting-hire-target-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.recruiting-hire-target-card:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 7%, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 18%, transparent);
}

.recruiting-hire-target-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.recruiting-hire-target-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary, #2563eb) 10%, #fff);
  color: var(--primary, #2563eb);
}

.recruiting-hire-target-card__body {
  flex: 1;
  min-width: 0;
}

.recruiting-hire-target-card__body strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.94rem;
}

.recruiting-hire-target-card__body span {
  display: block;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--muted, #64748b);
}

.recruiting-role-type-detail {
  padding-top: 14px;
  border-top: 1px dashed var(--border, #e2e8f0);
}

.recruiting-role-type-detail[hidden] {
  display: none !important;
}

.recruiting-role-type-detail__label {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.recruiting-role-type-detail__hint {
  margin: 10px 0 0;
  line-height: 1.45;
}

.recruiting-interview-calendar {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.recruiting-interview-calendar__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .recruiting-interview-calendar__grid {
    grid-template-columns: 1fr;
  }
}

.recruiting-interview-calendar__card {
  display: flex;
  align-items: flex-start;
  min-height: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.recruiting-interview-calendar__card:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 7%, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 18%, transparent);
}

.recruiting-interview-calendar__card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.recruiting-interview-calendar__card-body strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
  color: var(--text, #0f172a);
}

.recruiting-interview-calendar__card-body span {
  display: block;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted, #64748b);
}

.recruiting-interview-calendar__url-panel,
.recruiting-interview-calendar__custom-panel {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 24%, var(--border, #e2e8f0));
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary, #2563eb) 5%, #fff) 0%, #fff 100%);
}

.recruiting-interview-calendar__custom-field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.recruiting-interview-calendar__custom-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.recruiting-interview-calendar__custom-field input[type="url"] {
  width: 100%;
  font-size: 0.95rem;
}

.recruiting-interview-calendar__custom-help {
  margin: 0;
  line-height: 1.45;
}

.recruiting-interview-calendar__hint {
  margin: 10px 0 0;
  line-height: 1.45;
}

.recruiting-role-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recruiting-role-type-chip {
  display: inline-flex;
  margin: 0;
  cursor: pointer;
}

.recruiting-role-type-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.recruiting-role-type-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text, #0f172a);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.recruiting-role-type-chip:has(input:checked) span {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 10%, #fff);
  color: var(--primary, #2563eb);
}

.recruiting-role-type-chip:has(input:focus-visible) span {
  outline: 2px solid color-mix(in srgb, var(--primary, #2563eb) 45%, transparent);
  outline-offset: 2px;
}

.recruiting-staff-role-grid {
  display: grid;
  gap: 8px;
}

.recruiting-staff-role-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.recruiting-staff-role-card:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 7%, #fff);
}

.recruiting-staff-role-card input {
  margin-top: 3px;
  flex-shrink: 0;
}

.recruiting-staff-role-card__body {
  flex: 1;
  min-width: 0;
}

.recruiting-staff-role-card__body strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.92rem;
}

.recruiting-staff-role-card__body span {
  display: block;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--muted, #64748b);
}

@media (max-width: 720px) {
  .recruiting-hire-target-grid {
    grid-template-columns: 1fr;
  }
}

.recruiting-board-checklist {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.recruiting-board-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.recruiting-screener-list {
  display: grid;
  gap: 14px;
}

.recruiting-screener-row {
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-muted, #f8fafc);
}

.recruiting-screener-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.recruiting-screener-row__title {
  font-size: 0.95rem;
}

.recruiting-screener-type select {
  display: block;
  width: 100%;
  max-width: 240px;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid var(--border, #d6e3ec);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
  background: #fff;
  color: var(--text, #0f172a);
  box-sizing: border-box;
}

.recruiting-screener-yesno-only {
  margin-top: 4px;
}

[data-recruiting-screener-add] {
  margin-top: 12px;
}

.recruiting-screener-question {
  display: block;
  width: 100%;
  margin-bottom: 10px !important;
  font-weight: 500;
}

.recruiting-screener-question input {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid var(--border, #d6e3ec);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
  background: #fff;
  color: var(--text, #0f172a);
  box-sizing: border-box;
}

.recruiting-screener-row label {
  display: block;
  margin-bottom: 8px;
}

.recruiting-screener-required {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  font-weight: 500;
}

.recruiting-screener-knockout,
.recruiting-screener-knockout-answer {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 0 0 !important;
  font-weight: 500;
  font-size: 0.88rem;
}

.recruiting-screener-knockout-answer select {
  min-width: 72px;
}

.recruiting-add-applicant-modal {
  width: min(calc(100vw - 32px), 560px);
  max-width: 100%;
  margin: auto;
  overflow: hidden;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
}

.recruiting-add-applicant-modal__surface {
  display: flex;
  flex-direction: column;
  max-height: min(calc(100vh - 48px), 720px);
}

.recruiting-add-applicant-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--card, #fff));
}

.recruiting-add-applicant-modal__head-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.recruiting-add-applicant-modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary, #2563eb) 14%, transparent);
  color: var(--primary, #2563eb);
  flex-shrink: 0;
}

.recruiting-add-applicant-modal__title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.recruiting-add-applicant-modal__subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.recruiting-add-applicant-modal__close {
  flex-shrink: 0;
  min-width: 36px;
  padding-inline: 10px;
}

.recruiting-add-applicant-modal__body {
  padding: 16px 20px 8px;
  overflow: auto;
}

.recruiting-add-applicant-modal__section + .recruiting-add-applicant-modal__section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.recruiting-add-applicant-modal__section-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.recruiting-add-applicant-modal__field {
  display: block;
  margin: 0;
}

.recruiting-add-applicant-modal__field--span2 {
  grid-column: 1 / -1;
}

.recruiting-add-applicant-modal__field input:not([type="checkbox"]):not([type="radio"]),
.recruiting-add-applicant-modal__field select,
.recruiting-add-applicant-modal__field textarea {
  width: 100%;
  margin-top: 6px;
}

.recruiting-add-applicant-modal__hint {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}

.recruiting-add-applicant-modal__grid {
  gap: 14px;
}

.recruiting-add-applicant-modal__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 12px 8px 4px;
}

.recruiting-add-applicant-modal__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-muted, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--muted, #64748b);
}

.recruiting-add-applicant-modal__empty-title {
  margin: 0;
  font-weight: 700;
}

.recruiting-add-applicant-modal__actions {
  padding: 14px 20px 18px;
  margin-top: 0;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--bg-muted, #f8fafc);
}

.recruiting-source-analytics {
  margin-bottom: 16px;
}

.recruiting-jobs-panel .inline-form {
  display: inline;
}

.recruiting-jobs-panel .inline-form button {
  margin-left: 4px;
}

.recruiting-filter-bar input[type="search"] {
  width: 100%;
  min-width: 180px;
}

.recruiting-answers-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.recruiting-answers-list dt {
  font-weight: 600;
  font-size: 0.88rem;
}

.recruiting-answers-list dd {
  margin: 2px 0 0;
}

.recruiting-answer-row--failed dd {
  color: #b45309;
}

.recruiting-answer-knockout-tag,
.recruiting-answer-failed-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}

.recruiting-answer-knockout-tag {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.recruiting-answer-failed-tag {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.recruiting-knockout-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  background: rgba(255, 251, 235, 0.95);
}

.recruiting-knockout-banner strong {
  display: block;
  margin-bottom: 6px;
  color: #92400e;
}

.recruiting-knockout-banner p {
  margin: 0;
  color: #78350f;
  font-size: 0.92rem;
  line-height: 1.45;
}

.recruiting-knockout-banner__reasons {
  margin: 10px 0 0 18px;
  color: #78350f;
  font-size: 0.92rem;
}

.recruiting-new-job-dropdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.recruiting-template-picker {
  position: relative;
}

.recruiting-template-picker summary {
  list-style: none;
  cursor: pointer;
}

.recruiting-template-picker summary::-webkit-details-marker {
  display: none;
}

.recruiting-template-picker__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.recruiting-template-picker__menu li + li {
  margin-top: 2px;
}

.recruiting-template-picker__item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.recruiting-template-picker__item:hover {
  background: rgba(59, 130, 246, 0.08);
}

.recruiting-detail-grid__full {
  grid-column: 1 / -1;
}

.jobs-description-section {
  margin: 20px 0;
}

.jobs-description-section h2 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.jobs-detail__meta {
  margin-top: 8px;
}

.recruiting-syndication-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.recruiting-syndication-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
}

.recruiting-applicant-aside,
.recruiting-edit-aside {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.recruiting-aside-card {
  position: static;
}

.recruiting-aside-card dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.recruiting-aside-card .recruiting-section-title {
  margin-bottom: 10px;
}

.recruiting-aside-card .recruiting-section-title__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.recruiting-aside-card dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.recruiting-aside-card dd {
  margin: 2px 0 0;
  word-break: break-word;
}

.recruiting-url-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 0.88rem;
}

.recruiting-url-box code,
.recruiting-url-box a {
  word-break: break-all;
}

.recruiting-pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.recruiting-pipeline-col {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  min-height: 120px;
  max-height: min(70vh, 720px);
}

.recruiting-pipeline-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
  flex: 0 0 auto;
}

.recruiting-pipeline-col__head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.recruiting-pipeline-col__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 6px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.recruiting-pipeline-col--applied .recruiting-pipeline-col__head { border-top: 3px solid #3b82f6; }
.recruiting-pipeline-col--screening .recruiting-pipeline-col__head { border-top: 3px solid #8b5cf6; }
.recruiting-pipeline-col--interview .recruiting-pipeline-col__head { border-top: 3px solid #f59e0b; }
.recruiting-pipeline-col--offer .recruiting-pipeline-col__head { border-top: 3px solid #14b8a6; }
.recruiting-pipeline-col--hired .recruiting-pipeline-col__head { border-top: 3px solid #22c55e; }
.recruiting-pipeline-col--rejected .recruiting-pipeline-col__head { border-top: 3px solid #94a3b8; }

.recruiting-pipeline-list {
  list-style: none;
  padding: 10px;
  margin: 0;
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.recruiting-pipeline-card {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.recruiting-pipeline-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.recruiting-pipeline-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recruiting-pipeline-card__name {
  font-weight: 600;
  font-size: 0.92rem;
  flex: 1;
  min-width: 0;
}

.recruiting-applicant-hero__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.recruiting-ai-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  background: #e2e8f0;
  color: #334155;
}

.recruiting-ai-score--lg {
  min-width: 52px;
  height: 52px;
  font-size: 1.25rem;
}

.recruiting-ai-score--strong { background: #dcfce7; color: #166534; }
.recruiting-ai-score--good { background: #dbeafe; color: #1d4ed8; }
.recruiting-ai-score--weak { background: #fef3c7; color: #b45309; }
.recruiting-ai-score--poor { background: #fee2e2; color: #b91c1c; }
.recruiting-ai-score--pending { background: #f1f5f9; color: #64748b; }
.recruiting-ai-score--failed { background: #fee2e2; color: #b91c1c; }

.recruiting-ai-screening__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.recruiting-ai-screening__summary {
  margin: 0 0 12px;
  line-height: 1.5;
}

.recruiting-ai-screening__list ul,
.recruiting-resume-parsed__jobs {
  margin: 0;
  padding-left: 1.1rem;
}

.recruiting-ai-screening__list + .recruiting-ai-screening__list {
  margin-top: 10px;
}

.recruiting-ai-screening__error {
  color: #b91c1c;
}

.recruiting-ai-screening__actions {
  margin-top: 14px;
}

.recruiting-detail-grid--compact {
  margin-top: 10px;
}

.recruiting-pipeline-card__meta {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.recruiting-pipeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.recruiting-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light, #dbeafe);
  color: var(--primary-dark, #1d4ed8);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.recruiting-avatar--lg {
  width: 52px;
  height: 52px;
  font-size: 1rem;
}

.recruiting-applicant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
}

.recruiting-applicant-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.recruiting-applicant-hero__identity h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.recruiting-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 20px;
  margin-top: 16px;
}

.recruiting-detail-grid dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.recruiting-detail-grid dd {
  margin: 4px 0 0;
  font-weight: 500;
}

.recruiting-stage-badge--applied { background: #dbeafe; color: #1d4ed8; }
.recruiting-stage-badge--screening { background: #ede9fe; color: #6d28d9; }
.recruiting-stage-badge--interview { background: #ffedd5; color: #c2410c; }
.recruiting-stage-badge--offer { background: #ccfbf1; color: #0f766e; }
.recruiting-stage-badge--hired { background: #dcfce7; color: #166534; }
.recruiting-stage-badge--rejected { background: #f1f5f9; color: #64748b; }

.recruiting-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}

.recruiting-timeline li {
  position: relative;
  padding: 0 0 16px 18px;
  border-left: 2px solid var(--border, #e2e8f0);
  margin-left: 6px;
}

.recruiting-timeline li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.recruiting-timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border, #e2e8f0);
}

.recruiting-timeline__type {
  font-weight: 600;
  font-size: 0.9rem;
}

.recruiting-timeline__at {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--muted);
}

.recruiting-submitted-application__meta {
  margin: -6px 0 12px;
}

.recruiting-submitted-application__scroll {
  height: min(560px, calc(100dvh - 260px));
  min-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 4px 8px 4px 4px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.recruiting-submitted-application-form {
  margin-top: 12px;
}

.recruiting-submitted-application-form .intake-section {
  margin-bottom: 18px;
}

.recruiting-submitted-application-form .intake-section:last-child {
  margin-bottom: 0;
}

.recruiting-timeline__text {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.recruiting-action-card__title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.recruiting-action-card--danger {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff 0%, #fef2f2 100%);
}

.recruiting-settings-grid {
  display: grid;
  gap: 16px;
}

.recruiting-settings-grid > .config-form-actions {
  justify-content: flex-start;
}

.recruiting-board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.recruiting-board-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin: 0;
}

.recruiting-board-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.recruiting-board-card__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.recruiting-board-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 260px;
}

.recruiting-board-card__desc {
  flex: 1;
  margin: 0 0 16px;
  line-height: 1.5;
}

.recruiting-board-card__form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.recruiting-board-card__notes {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 14px !important;
}

.recruiting-board-card__notes textarea {
  flex: 1;
  min-height: 96px;
  resize: vertical;
}

.recruiting-board-card__footer {
  margin-top: auto;
  padding-top: 4px;
}

.recruiting-board-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.recruiting-board-card__status {
  margin: 0 0 12px;
}

.recruiting-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius, 10px);
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 0.9rem;
}

.recruiting-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.recruiting-filter-bar label {
  min-width: 200px;
}

.recruiting-nav .config-section-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recruiting-icon {
  flex-shrink: 0;
  opacity: 0.82;
}

.config-section-nav__link.is-active .recruiting-icon,
.recruiting-nav .config-section-nav__link:hover .recruiting-icon {
  opacity: 1;
}

.recruiting-section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.recruiting-section-title__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-light, #eff6ff);
  color: var(--primary-dark, #1d4ed8);
  flex-shrink: 0;
}

.recruiting-section-title__text {
  margin: 0;
  font-size: 1.05rem;
}

.recruiting-section-title__intro {
  margin: 4px 0 0;
}

.recruiting-form-section .recruiting-section-title {
  margin-bottom: 12px;
}

.recruiting-form-section .recruiting-section-title + label,
.recruiting-form-section .recruiting-section-title + .form-row,
.recruiting-form-section .recruiting-section-title + .recruiting-visibility-options,
.recruiting-form-section .recruiting-section-title + .recruiting-board-checklist {
  margin-top: 0;
}

.recruiting-visibility-option__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark, #1d4ed8);
  flex-shrink: 0;
}

.recruiting-board-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0;
  border-radius: 10px;
  background: var(--primary-light, #eff6ff);
  color: var(--primary-dark, #1d4ed8);
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .recruiting-board-grid {
    grid-template-columns: 1fr;
  }

  .recruiting-board-card__body {
    min-height: 0;
  }
}

.empty-state__icon .recruiting-icon {
  opacity: 1;
}

.recruiting-page-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-light, #eff6ff) 0%, #dbeafe 100%);
  color: var(--primary-dark, #1d4ed8);
  margin-bottom: 8px;
}

@media (max-width: 960px) {
  .recruiting-edit-layout,
  .recruiting-ai-create-layout,
  .recruiting-applicant-layout {
    grid-template-columns: 1fr;
  }

  .recruiting-applicant-aside,
  .recruiting-edit-aside {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .recruiting-pipeline {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

/* Family / senior — Who sees what visibility settings */
.visibility-settings-intro {
  max-width: 720px;
  margin-bottom: 16px;
}

.visibility-settings-picker {
  margin-bottom: 16px;
}

.visibility-settings {
  display: grid;
  gap: 16px;
}

.visibility-settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.visibility-settings-summary__copy strong {
  display: block;
  margin-bottom: 4px;
}

.visibility-settings-summary__copy p {
  margin: 0;
}

.visibility-settings-summary__stat {
  text-align: center;
  flex-shrink: 0;
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--primary-light, #eff6ff) 0%, #fff 100%);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

.visibility-settings-summary__stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary-dark, #1d4ed8);
}

.visibility-settings-summary__stat-label {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.visibility-settings-member {
  padding: 0;
  overflow: hidden;
}

.visibility-settings-member__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.visibility-settings-member__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.visibility-settings-member__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light, #eff6ff);
  color: var(--primary-dark, #1d4ed8);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.visibility-settings-member__name {
  margin: 0 0 2px;
  font-size: 1.05rem;
}

.visibility-settings-member__meta p {
  margin: 0;
}

.visibility-settings-member__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.visibility-settings-member__count {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.visibility-settings-member__note {
  margin: 0;
  padding: 12px 18px 0;
}

.visibility-settings-member__form {
  padding: 4px 18px 18px;
}

.visibility-settings-group {
  margin-top: 16px;
}

.visibility-settings-group__title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.visibility-settings-group__rows {
  display: grid;
  gap: 8px;
}

.visibility-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #fff;
}

.visibility-settings-row:has([data-visibility-toggle]:checked) {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.visibility-settings-row__text {
  flex: 1;
  min-width: 0;
}

.visibility-settings-row__text strong {
  display: block;
  margin-bottom: 2px;
}

.visibility-settings-row__text p {
  margin: 0;
}

.visibility-settings-row__switch {
  flex-shrink: 0;
}

.visibility-settings-member__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.visibility-settings-member__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 640px) {
  .visibility-settings-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .visibility-settings-summary__stat {
    align-self: flex-start;
  }

  .visibility-settings-member__header {
    flex-direction: column;
  }

  .visibility-settings-member__status {
    align-items: flex-start;
  }

  .visibility-settings-member__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .visibility-settings-member__footer .btn-primary {
    width: 100%;
  }
}

/* Family medication manager */
.med-manager-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.med-household-picker {
  margin-bottom: 14px;
}
.med-warning-list {
  margin: 8px 0 0 18px;
}
.med-schedule-form {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.med-weekday-grid,
.med-monthday-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.med-weekday-chip,
.med-monthday-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}
.med-weekday-chip input,
.med-monthday-chip input {
  margin: 0;
}
.med-weekday-chip:has(input:checked),
.med-monthday-chip:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}
.med-weekday-chip:has(input:disabled),
.med-monthday-chip:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}
.med-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.med-schedule-item {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.med-schedule-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.med-schedule-item__head {
  margin-bottom: 4px;
}
.med-monthday-intro {
  margin: 0 0 8px;
}
.med-schedule-item__freq {
  margin: 0 0 6px;
}
.med-schedule-item__month-note {
  margin: 0 0 6px;
  font-style: italic;
}
.med-schedule-item__notes {
  margin: 0 0 8px;
}
.med-schedule-item__actions {
  margin: 0;
}
.med-dose-nav {
  flex-wrap: wrap;
}
.med-dose-date-form {
  margin: 0 0 14px;
}
.med-dose-date-form .form-field {
  margin-bottom: 0;
  max-width: 220px;
}
.med-dose-progress {
  margin-bottom: 16px;
}
.med-dose-progress__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 8px;
}
.med-dose-progress__bar::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--med-progress, 0%);
  background: var(--primary, #2563eb);
  border-radius: inherit;
  transition: width 0.2s ease;
}
.med-dose-progress__label {
  margin: 0;
}
.med-dose-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.med-dose-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg, #fff);
}
.med-dose-item--logged {
  background: rgba(34, 197, 94, 0.04);
  border-color: rgba(34, 197, 94, 0.25);
}
.med-dose-item__time {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary, #2563eb);
}
.med-dose-item__title {
  margin-bottom: 4px;
}
.med-dose-item__instructions {
  margin: 6px 0 8px;
}
.med-dose-item__actions {
  margin-top: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.med-dose-empty {
  padding: 20px 12px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
@media (max-width: 900px) {
  .med-manager-grid {
    grid-template-columns: 1fr;
  }
}

/* Emergency care packet — family portal + public EMS view */
.ecp-family__lede {
  margin: -4px 0 16px;
  max-width: 52rem;
}
.ecp-family__picker {
  margin-bottom: 14px;
}
.ecp-family__allergy-banner {
  margin-bottom: 14px;
}
.ecp-family__allergy-text {
  margin-top: 6px;
  font-weight: 600;
}
.ecp-manager-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.ecp-preview-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.ecp-preview-identity__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ecp-preview-identity__name {
  font-size: 1.15rem;
}
.ecp-field-list {
  margin: 0;
}
.ecp-field {
  margin: 0 0 12px;
}
.ecp-field dt {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.ecp-field dd {
  margin: 0;
  line-height: 1.45;
}
.ecp-field--critical dd {
  color: #991b1b;
  font-weight: 600;
}
.ecp-contact-list {
  margin: 0;
  padding-left: 1.1rem;
}
.ecp-preview-empty {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-alt, #f8fafc);
}
.ecp-share-card .card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ecp-share-steps {
  margin: 0 0 14px;
  line-height: 1.55;
}
.ecp-link-box {
  margin-bottom: 14px;
}
.ecp-link-box__row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.ecp-link-box__input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
}
.ecp-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ecp-revoke-form {
  margin: 0;
  display: inline;
}
.ecp-share-disclaimer {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ecp-public {
  background: #fff;
  color: #0f172a;
}
.ecp-public__shell {
  max-width: 40rem;
  margin: 0 auto;
  padding: 20px 16px 32px;
}
.ecp-public__banner {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 2px solid #0f172a;
  border-radius: 4px;
  background: #fff;
}
.ecp-public__banner-kicker {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}
.ecp-public__patient-name {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}
.ecp-public__meta,
.ecp-public__address {
  margin: 8px 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: #334155;
}
.ecp-public__section {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
}
.ecp-public__section h2 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #334155;
}
.ecp-public__section p {
  margin: 0;
  line-height: 1.55;
  font-size: 1rem;
  white-space: pre-wrap;
}
.ecp-public__section--critical {
  border-color: #dc2626;
  border-width: 2px;
  background: #fef2f2;
}
.ecp-public__section--critical h2 {
  color: #991b1b;
}
.ecp-public__critical-body {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
  color: #7f1d1d;
  white-space: pre-wrap;
}
.ecp-public__contacts {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ecp-public__contacts li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 8px 0;
  border-top: 1px solid #e2e8f0;
  line-height: 1.4;
}
.ecp-public__contacts li:first-child {
  border-top: 0;
  padding-top: 0;
}
.ecp-public__footer {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.82rem;
  color: #64748b;
  text-align: center;
}
.ecp-public__footer p {
  margin: 0 0 4px;
}
.ecp-public__footer-brand {
  font-size: 0.75rem;
  color: #94a3b8;
}
.ecp-public__unavailable {
  margin-top: 24px;
  padding: 20px;
}

@media (max-width: 900px) {
  .ecp-manager-grid {
    grid-template-columns: 1fr;
  }
}

/* Referral CRM lite — agency referrals + partners */
.referral-crm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-alt, #f1f5f9);
  width: fit-content;
  max-width: 100%;
}
.referral-crm-tabs__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}
.referral-crm-tabs__link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}
.referral-crm-tabs__link.is-active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.referral-crm-breadcrumb {
  margin: 0 0 4px;
  font-size: 0.85rem;
}
.referral-crm-breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}
.referral-crm-breadcrumb a:hover {
  text-decoration: underline;
}
.referral-crm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.referral-crm-stat {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.referral-crm-stat__value {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}
.referral-crm-stat__label {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.referral-crm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.referral-crm-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 120ms ease, background 120ms ease;
}
.referral-crm-filter:hover {
  border-color: rgba(37, 99, 235, 0.35);
}
.referral-crm-filter.is-active {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary-dark, #1d4ed8);
}
.referral-crm-filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.72rem;
  font-weight: 700;
}
.referral-crm-filter.is-active .referral-crm-filter__count {
  background: rgba(37, 99, 235, 0.14);
}
.referral-crm-card {
  padding: 0;
  overflow: hidden;
}
.referral-crm-card .table-scroll {
  border-radius: inherit;
}
.referral-crm-table .referral-crm-notes {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 280px;
}
.referral-crm-linked-badge {
  margin-left: 6px;
  vertical-align: middle;
}
.referral-crm-stage-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0;
}
.referral-crm-stage-select {
  min-width: 9.5rem;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
}
.referral-stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.referral-stage-badge--new { background: #dbeafe; color: #1d4ed8; }
.referral-stage-badge--contacted { background: #ede9fe; color: #6d28d9; }
.referral-stage-badge--assessment { background: #ffedd5; color: #c2410c; }
.referral-stage-badge--assessment-complete { background: #fef3c7; color: #b45309; }
.referral-stage-badge--authorized { background: #ccfbf1; color: #0f766e; }
.referral-stage-badge--started { background: #dcfce7; color: #166534; }
.referral-stage-badge--lost { background: #f1f5f9; color: #64748b; }
.referral-stage-badge--lg {
  font-size: 0.82rem;
  padding: 6px 12px;
}
.referral-partner-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.referral-partner-type--hospital { background: #dbeafe; color: #1e40af; }
.referral-partner-type--snf { background: #e0e7ff; color: #3730a3; }
.referral-partner-type--physician { background: #ccfbf1; color: #0f766e; }
.referral-partner-type--hospice { background: #fae8ff; color: #86198f; }
.referral-partner-type--community { background: #fef3c7; color: #92400e; }
.referral-partner-type--other { background: #f1f5f9; color: #475569; }
.referral-partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.referral-partner-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.referral-partner-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.referral-partner-card__name {
  margin: 6px 0 0;
  font-size: 1.05rem;
  line-height: 1.3;
}
.referral-partner-card__count {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary-dark, #1d4ed8);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.referral-partner-card__contact {
  margin: 0;
  display: grid;
  gap: 8px;
}
.referral-partner-card__contact div {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 8px;
  align-items: baseline;
}
.referral-partner-card__contact dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.referral-partner-card__contact dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}
.referral-partner-card__contact a {
  color: var(--primary);
}
.referral-partner-card__notes {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.referral-partner-card__actions {
  margin-top: auto;
  padding-top: 4px;
}
.referral-crm-empty {
  padding: 28px 20px;
  text-align: center;
}
.referral-crm-empty--wide {
  grid-column: 1 / -1;
}
.referral-crm-empty h3 {
  margin: 0 0 8px;
}
.referral-crm-form-card {
  max-width: 640px;
}
.referral-crm-form .form-grid {
  margin-bottom: 0;
}

.referral-crm-view-toggle {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
}
.referral-crm-view-toggle__link {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  background: #fff;
}
.referral-crm-view-toggle__link.is-active {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: #eff6ff;
}
.referral-crm-pipeline {
  overflow-x: auto;
  padding-bottom: 8px;
}
.referral-crm-pipeline .recruiting-pipeline-col--new .recruiting-pipeline-col__head { border-top: 3px solid #3b82f6; }
.referral-crm-pipeline .recruiting-pipeline-col--contacted .recruiting-pipeline-col__head { border-top: 3px solid #8b5cf6; }
.referral-crm-pipeline .recruiting-pipeline-col--assessment .recruiting-pipeline-col__head { border-top: 3px solid #f59e0b; }
.referral-crm-pipeline .recruiting-pipeline-col--assessment-complete .recruiting-pipeline-col__head { border-top: 3px solid #eab308; }
.referral-crm-pipeline .recruiting-pipeline-col--authorized .recruiting-pipeline-col__head { border-top: 3px solid #14b8a6; }
.referral-crm-pipeline .recruiting-pipeline-col--started .recruiting-pipeline-col__head { border-top: 3px solid #22c55e; }
.referral-crm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.referral-priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  flex-shrink: 0;
}
.referral-priority-badge--high {
  background: #fee2e2;
  color: #b91c1c;
}
.referral-crm-detail-hero {
  margin-bottom: 14px;
  padding: 16px 18px;
}
.referral-crm-detail-hero__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.referral-crm-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 18px;
  margin: 0;
}
.referral-crm-detail-grid dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.referral-crm-detail-grid dd {
  margin: 4px 0 0;
  font-size: 0.92rem;
}
.referral-crm-detail-grid__full {
  grid-column: 1 / -1;
}
.referral-crm-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 14px;
  align-items: start;
}
.referral-crm-detail-main {
  display: grid;
  gap: 14px;
}
.referral-crm-detail-aside {
  display: grid;
  gap: 14px;
}
.referral-crm-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.referral-crm-subtabs__link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}
.referral-crm-subtabs__link.is-active {
  color: var(--primary);
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.25);
}
.referral-crm-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.referral-crm-timeline li {
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.referral-crm-timeline__type {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}
.referral-crm-task-list,
.referral-crm-task-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.referral-crm-task-checklist li.is-done {
  opacity: 0.65;
  text-decoration: line-through;
}
.referral-crm-convert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.referral-crm-loss-reason.is-hidden {
  display: none;
}
.referral-crm-notes-block {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}
@media (max-width: 900px) {
  .referral-crm-detail-layout {
    grid-template-columns: 1fr;
  }
}

/* Shared care expenses (family portal) */
.shared-expenses-balance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-left: 4px solid var(--primary);
}
.shared-expenses-balance__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.shared-expenses-balance__hint {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}
.shared-expenses-balance__amount {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.shared-expenses-balance__amount.is-credit { color: #166534; }
.shared-expenses-balance__amount.is-debit { color: #b45309; }
.shared-expenses-balance__amount.is-neutral { color: var(--text); }

.shared-expenses-list-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 4px;
}
.shared-expenses-list-card__header .card__title {
  margin-bottom: 0;
}

.shared-expenses-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.shared-expense-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--surface, #fff);
}
.shared-expense-card.is-settled {
  background: linear-gradient(180deg, #f0fdf4 0%, var(--surface, #fff) 72%);
  border-color: #bbf7d0;
}
.shared-expense-card.is-partial {
  background: linear-gradient(180deg, #eff6ff 0%, var(--surface, #fff) 72%);
  border-color: #bfdbfe;
}

.shared-expense-card__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  align-items: flex-start;
}
.shared-expense-card__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.shared-expense-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}
.shared-expense-card__note {
  margin: 6px 0 0;
  line-height: 1.45;
}
.shared-expense-card__amount-block {
  text-align: right;
  flex-shrink: 0;
}
.shared-expense-card__amount {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.shared-expense-card__meta {
  margin-top: 4px;
}
.shared-expense-card__paid-by {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.shared-expense-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f5f3ff;
  color: #6d28d9;
  font-size: 0.74rem;
  font-weight: 600;
}

.shared-expense-split {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.shared-expense-split__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 6px 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
}
.shared-expense-split__row.is-outstanding {
  background: #fffbeb;
  outline: 1px solid #fde68a;
}
.shared-expense-split__person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.shared-expense-split__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary-light, #eef2ff);
  color: var(--primary-dark, #3730a3);
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}
.shared-expense-split__identity {
  min-width: 0;
}
.shared-expense-split__name {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
}
.shared-expense-split__share {
  display: block;
  margin-top: 1px;
}
.shared-expense-split__ledger {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
}
.shared-expense-split__ledger-item strong {
  font-weight: 700;
}
.shared-expense-split__ledger-item--paid strong {
  color: #166534;
}
.shared-expense-split__ledger-item--owed strong {
  color: #92400e;
}
.shared-expense-split__ledger-item--owed.is-clear strong {
  color: var(--text-muted, #64748b);
}
.shared-expense-split__bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.shared-expense-split__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary, #4f46e5), #6366f1);
  transition: width 0.2s ease;
}
.shared-expense-split__bar-fill.is-complete,
.shared-expense-split__row.is-complete .shared-expense-split__bar-fill {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}
.shared-expense-split__row.is-outstanding .shared-expense-split__bar-fill:not(.is-complete) {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.shared-expense-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.shared-expense-chip--payer {
  background: #eef2ff;
  color: #4338ca;
}
.shared-expense-chip--settled {
  background: #dcfce7;
  color: #166534;
}
.shared-expense-chip--owed {
  background: #fef3c7;
  color: #92400e;
}

.shared-expense-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.shared-expense-card__action-form {
  margin: 0;
}

.shared-expenses-export-menu {
  position: relative;
  display: inline-block;
}
.shared-expenses-export-menu__trigger {
  list-style: none;
  cursor: pointer;
}
.shared-expenses-export-menu__trigger::-webkit-details-marker {
  display: none;
}
.shared-expenses-export-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 11rem;
  padding: 6px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.shared-expenses-export-menu:not([open]) .shared-expenses-export-menu__panel {
  display: none;
}
.shared-expenses-export-menu__item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text, #0f172a);
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}
.shared-expenses-export-menu__item:hover,
.shared-expenses-export-menu__item:focus-visible {
  background: var(--primary-light, #eff6ff);
  color: var(--primary-dark, #1d4ed8);
}

.payment-handles-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.payment-handles-section-header__label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.payment-handles-section-header__help {
  padding: 0;
  min-height: auto;
}

.payment-handles-help-dialog {
  max-width: min(520px, calc(100vw - 24px));
  width: 520px;
}
.payment-handles-help-dialog__head {
  margin-bottom: 12px;
}
.payment-handles-help-dialog__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  line-height: 1.3;
}
.payment-handles-help-dialog__intro {
  margin: 0;
}
.payment-handles-help-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding-right: 2px;
}
.payment-handles-help-dialog__section-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-dark, #1d4ed8);
}
.payment-handles-help-dialog__steps {
  margin: 0 0 8px;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.5;
}
.payment-handles-help-dialog__steps li + li {
  margin-top: 6px;
}
.payment-handles-help-dialog__note {
  margin: 0 0 8px;
}
.payment-handles-help-dialog__section code {
  font-size: 0.85em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--primary-light, #eff6ff);
  color: var(--primary-dark, #1d4ed8);
}
.payment-handles-help-dialog__actions {
  margin-top: 16px;
}

.shared-expense-pay-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
}
.shared-expense-pay-picker__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.shared-expense-pay-picker__select {
  min-width: 9.5rem;
  max-width: 100%;
}
.shared-expense-pay-picker__go {
  flex-shrink: 0;
}

.shared-expenses-empty {
  padding: 28px 8px 12px;
  text-align: center;
}
.shared-expenses-empty__title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}

.shared-expenses-defaults.card {
  margin-bottom: 16px;
}
.shared-expenses-defaults__body {
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.split-member-row {
  justify-content: space-between;
  gap: 8px 12px;
}
.split-pct-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.split-pct-field .input-sm {
  width: 4.5rem;
}

.shared-expense-form-modal {
  max-width: min(520px, calc(100vw - 24px));
  width: 520px;
}
.shared-expense-form-modal__head {
  margin-bottom: 12px;
}
.shared-expense-form-modal__title {
  margin: 0;
  font-size: 1.15rem;
}
.shared-expense-form-modal__panel .form-field:last-of-type {
  margin-bottom: 0;
}
.shared-expenses-empty .btn {
  margin-top: 14px;
}

@media (max-width: 640px) {
  .shared-expense-card__amount-block {
    width: 100%;
    text-align: left;
  }
  .shared-expense-card__header {
    flex-direction: column;
  }
}

.shared-expenses-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.shared-expense-attachments {
  margin-top: 12px;
}
.shared-expense-attachments__list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.shared-expense-attachments__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.shared-expense-attachments__link {
  font-weight: 500;
}
.shared-expense-attachments-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-top: 12px;
}
.shared-expense-attachments-upload__label {
  display: grid;
  gap: 6px;
  flex: 1 1 220px;
}

.shared-expense-form-modal:focus-visible {
  outline: none;
}
.shared-expense-form-modal .rithma-dialog__panel:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.shared-expenses-app {
  display: grid;
  gap: 16px;
  max-width: 720px;
}
.shared-expenses-app__header {
  display: grid;
  gap: 8px;
}
.shared-expenses-app__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shared-expenses-app__balance {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
}
.shared-expenses-app__balance-amount {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.shared-expenses-app__list {
  display: grid;
  gap: 12px;
}
.shared-expenses-app-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface, #fff);
}
.shared-expenses-app-card__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
}
.shared-expenses-app-card__meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}
.shared-expenses-app-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.shared-expenses-app__empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
}
.shared-expenses-app__status {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
}
.shared-expenses-app__status.is-error {
  background: #fee2e2;
  color: #991b1b;
}

body.rithma-native-app .shared-expenses-app {
  max-width: none;
}

.calendar-actions-menu {
  position: relative;
  display: inline-flex;
}

/* Persistent Undo control in the calendar / scheduler header. The form stays
   mounted with the button hidden so nothing shifts when it becomes available. */
.scheduler-undo {
  display: inline-flex;
  margin: 0;
}

.scheduler-undo__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scheduler-undo__btn[hidden] {
  display: none;
}

/* Stack depth, shown only when more than one change can be walked back. */
.scheduler-undo__depth {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: var(--text-muted, #64748b);
  background: rgba(15, 23, 42, 0.08);
}

.calendar-actions-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-actions-menu__caret {
  font-size: 0.75em;
  opacity: 0.85;
}

.calendar-actions-menu__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 240px;
  padding: 6px;
  margin: 0;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface, #fff);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.calendar-actions-menu__menu[hidden] {
  display: none;
}

.calendar-actions-menu__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.calendar-actions-menu__item:hover,
.calendar-actions-menu__item:focus-visible {
  background: rgba(15, 23, 42, 0.06);
}

.side-panel--full-height .side-panel__body {
  max-height: calc(100vh - 88px);
  overflow: auto;
}

.live-board--panel .live-board-control-bar--panel {
  margin-bottom: 12px;
}

/* Shift visit page/panel: client name heading + action row. */
.shift-page-heading {
  margin-bottom: 14px;
}

.shift-client-heading {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.shift-client-heading:hover,
.shift-client-heading:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.shift-page-heading__location {
  margin: 4px 0 0;
}

.shift-page-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

/* ── Schedule planner (week strip + shift list) ─────────────────────────── */
.calendar-view--mobile {
  display: none;
}
.calendar-view--mobile[hidden],
.calendar-view--desktop[hidden] {
  display: none !important;
}
@media (max-width: 830px) {
  .calendar-view--desktop {
    display: none !important;
  }
  .calendar-view--mobile {
    display: block;
  }
  /* Mobile calendar: scroll inside .main (matches native shell; body scroll breaks here). */
  html:has([data-calendar-page]) {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }
  body:has([data-calendar-page]):has(.layout) {
    display: flex;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    overflow: hidden !important;
    overscroll-behavior: none;
  }
  body:has([data-calendar-page]) .layout {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
  }
  body:has([data-calendar-page]) .main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    height: auto;
    max-height: none;
    padding-top: 0;
  }
  body:has([data-calendar-page]) .page-header {
    padding-top: 12px;
  }
  body:has([data-calendar-page]) .schedule-planner {
    margin-top: 0;
  }
  html[data-rithma-native-app="1"]:has([data-calendar-page]),
  html[data-rithma-native-app="1"] body:has([data-calendar-page]) {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-height: none;
    overflow: hidden !important;
  }
  html[data-rithma-native-app="1"] .layout:has([data-calendar-page]) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: auto;
    max-height: none;
  }
  html[data-rithma-native-app="1"] .main:has([data-calendar-page]) {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    height: auto;
    max-height: none;
    padding-top: 0;
  }
  body:has([data-calendar-page]) .schedule-planner__sticky-head {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 calc(-1 * max(16px, env(safe-area-inset-right, 0px))) 0
      calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
    padding: 0 max(16px, env(safe-area-inset-right, 0px)) 10px
      max(16px, env(safe-area-inset-left, 0px));
    background: var(--bg);
    box-shadow: 0 1px 0 var(--border);
  }
}
.schedule-planner__roster-filter {
  margin: 0;
}

.schedule-planner__roster-filter-field {
  margin: 0;
}

.schedule-planner__roster-filter select {
  width: 100%;
  max-width: none;
  height: 36px;
  min-height: 36px;
  padding: 4px 10px;
  font-size: 16px;
  line-height: 1.2;
}

.schedule-planner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.schedule-planner__tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 0 -2px 4px;
}
.schedule-planner__tab {
  flex: 1 1 0;
  text-align: center;
  padding: 10px 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.schedule-planner__tab:hover {
  color: var(--text);
  text-decoration: none;
}
.schedule-planner__tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.schedule-planner__week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}
.schedule-planner__week-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.schedule-planner__week-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
  color: var(--primary-dark);
}
.schedule-planner__month-label {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: center;
}
.schedule-planner__strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(44px, 1fr));
  gap: 6px;
  padding: 4px 0 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  touch-action: pan-x pan-y;
}
.schedule-planner__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  min-width: 44px;
  scroll-snap-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.schedule-planner__day:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  text-decoration: none;
}
.schedule-planner__day.is-selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.schedule-planner__day.is-today:not(.is-selected) .schedule-planner__dom {
  color: var(--primary);
  font-weight: 700;
}
.schedule-planner__day.is-outside {
  opacity: 0.55;
}
.schedule-planner__dow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.schedule-planner__dom {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.1;
}
.schedule-planner__dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--primary);
}
.schedule-planner__hours {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 0;
  border-left: 3px solid var(--accent);
}
.schedule-planner__hours-icon {
  font-size: 1rem;
  line-height: 1;
}
.schedule-planner__hours-label {
  flex: 1 1 auto;
  font-weight: 600;
  color: var(--text);
}
.schedule-planner__hours-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary-dark);
}
.schedule-planner__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.schedule-planner__day-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.schedule-planner__shift {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  gap: 0 14px;
  padding: 14px 16px 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.schedule-planner__shift.is-next {
  border-color: var(--primary);
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18), var(--shadow);
}
.schedule-planner__shift.is-next::before {
  background: var(--primary);
}
.schedule-planner__shift::before {
  content: "";
  position: absolute;
  left: 52px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}
.schedule-planner__shift:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(20, 184, 166, 0.12);
  text-decoration: none;
  color: inherit;
  transform: translateY(-1px);
}
.schedule-planner__shift.is-pending {
  border-left: 3px solid var(--warning);
  background: #fffbeb;
}
.schedule-planner__shift.is-pending::before {
  background: var(--warning);
}
.schedule-planner__shift.is-missed {
  border-left: 3px solid var(--danger);
  background: #fef2f2;
}
.schedule-planner__shift.is-missed::before {
  background: var(--danger);
}
.schedule-planner__shift.is-change-pending {
  border-left: 3px solid #7c3aed;
  background: #f5f3ff;
}
.schedule-planner__shift.is-change-pending::before {
  background: #7c3aed;
}
.schedule-planner__shift.is-active {
  border-left: 3px solid var(--info);
}
.schedule-planner__shift.is-active::before {
  background: var(--info);
}
.schedule-planner__shift.is-done,
.schedule-planner__shift.is-past {
  opacity: 0.88;
}
.schedule-planner__shift-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.schedule-planner__shift-time {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary-dark);
  margin-bottom: 0;
}
.schedule-planner__shift-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.schedule-planner__status {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.schedule-planner__status--upcoming {
  background: #dbeafe;
  color: #1d4ed8;
}
.schedule-planner__status--past,
.schedule-planner__status--done {
  background: #dcfce7;
  color: #166534;
}
.schedule-planner__status--pending {
  background: #fef3c7;
  color: #92400e;
}
.schedule-planner__status--change {
  background: #ede9fe;
  color: #5b21b6;
}
.schedule-planner__status--missed {
  background: #fee2e2;
  color: #991b1b;
}
.schedule-planner__status--active {
  background: #e0f2fe;
  color: #0369a1;
}
.schedule-planner__status--awaiting {
  background: #ffedd5;
  color: #9a3412;
}
.schedule-planner__shift-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding-right: 8px;
  color: var(--muted);
}
.schedule-planner__shift-dow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.schedule-planner__shift-dom {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.schedule-planner__shift-body {
  padding-left: 14px;
  min-width: 0;
}
.schedule-planner__shift-who {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}
.schedule-planner__shift-subwho {
  margin-top: 2px;
  padding-left: 22px;
  line-height: 1.35;
  font-size: 0.85rem;
}
.schedule-planner__shift-icon {
  font-size: 0.85rem;
  line-height: 1;
}
.schedule-planner__next-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.schedule-planner__empty {
  text-align: center;
  padding: 28px 16px;
}
.schedule-planner-availability {
  margin-bottom: 8px;
  border-left: 3px solid var(--primary);
}
.schedule-planner-availability summary {
  cursor: pointer;
  font-weight: 600;
}
.schedule-planner__shift--appointment,
.schedule-planner__shift--pending-req {
  cursor: default;
}
.schedule-planner__shift--appointment:hover,
.schedule-planner__shift--pending-req:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--shadow);
}
@media (max-width: 830px) {
  .schedule-planner__shift:hover {
    transform: none;
  }
  .schedule-planner__tab {
    font-size: 0.72rem;
    padding: 8px 4px 10px;
  }
}

