/* ============================================================
   Ridgeback Portal - design system
   portal/public/portal.css
   Light-theme only. No dark mode.
   ============================================================ */

/* ── 0. Self-hosted fonts (variable, latin + latin-ext) ─────
   Replaces the render-blocking fonts.googleapis.com stylesheet.
   Files ship in /fonts/ (from @fontsource-variable). Family names
   stay "Sora" / "Pathway Extreme" so every existing rule matches. */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/fonts/sora-var.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/fonts/sora-var-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Pathway Extreme";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/pathway-extreme-var.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Pathway Extreme";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/pathway-extreme-var-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* ── 1. Design tokens ──────────────────────────────────────── */
:root {
  /* Colors */
  --rb-ink: #0c0c0c;
  --rb-page: #f3f3f1;
  --rb-surface: #ffffff;
  --rb-surface-2: #f7f7f5;
  --rb-border: #e3e3e0;
  --rb-border-strong: #cfcfca;
  --rb-text: #161615;
  --rb-text-2: #6c6c68;
  --rb-text-3: #9a9a96;
  --rb-red: #ce1a1e;
  --rb-red-hover: #b3171a;
  --rb-red-soft: #fdecec;
  --rb-red-text: #a32d2d;
  --rb-pink: #d4649a;
  --rb-pink-soft: #fbe7f1;
  --rb-blue: #2b5c8a;
  --rb-blue-soft: #e7f0f8;
  --rb-green: #1f7a4d;
  --rb-green-soft: #e6f4ea;
  --rb-amber: #8a6400;
  --rb-amber-soft: #fbf1d9;

  /* Radius */
  --rb-r: 7px;
  --rb-r-lg: 10px;
  --rb-r-pill: 999px;

  /* Spacing */
  --rb-s1: 4px;
  --rb-s2: 8px;
  --rb-s3: 12px;
  --rb-s4: 16px;
  --rb-s5: 24px;

  /* Focus ring */
  --rb-focus: 0 0 0 3px rgba(43, 92, 138, .35);

  /* Layout */
  --rb-container: 1100px;

  /* Tells the browser which palette its built-in UI (form controls, scrollbars,
     default link colors) should use; overridden to dark in the dark blocks below. */
  color-scheme: light;
}

/* ── Dark theme ─────────────────────────────────────────────── */
/* Shared dark values, applied when the user explicitly picks Dark... */
[data-theme="dark"] {
  color-scheme: dark;
  --rb-page: #131312;
  --rb-surface: #1d1d1b;
  --rb-surface-2: #262624;
  --rb-border: #34332f;
  --rb-border-strong: #46453f;
  --rb-text: #f2f2ee;
  --rb-text-2: #b4b3ac;
  --rb-text-3: #86857f;
  --rb-red-soft: #38191a;
  --rb-red-text: #f1a3a3;
  --rb-pink: #e58fb8;
  --rb-pink-soft: #3a1f2d;
  --rb-blue: #8fc3f5;
  --rb-blue-soft: #18293a;
  --rb-green: #5cc98c;
  --rb-green-soft: #16331f;
  --rb-amber: #e0b75e;
  --rb-amber-soft: #352b10;
}
/* ...or when the device is in dark mode and the user hasn't forced a choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --rb-page: #131312;
    --rb-surface: #1d1d1b;
    --rb-surface-2: #262624;
    --rb-border: #34332f;
    --rb-border-strong: #46453f;
    --rb-text: #f2f2ee;
    --rb-text-2: #b4b3ac;
    --rb-text-3: #86857f;
    --rb-red-soft: #38191a;
    --rb-red-text: #f1a3a3;
    --rb-pink: #e58fb8;
    --rb-pink-soft: #3a1f2d;
    --rb-blue: #8fc3f5;
    --rb-blue-soft: #18293a;
    --rb-green: #5cc98c;
    --rb-green-soft: #16331f;
    --rb-amber: #e0b75e;
    --rb-amber-soft: #352b10;
  }
}

/* ── 2. Base reset ─────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Pathway Extreme", system-ui, sans-serif;
  color: var(--rb-text);
  background: var(--rb-page);
}

/* ── 2b. Typography ────────────────────────────────────────── */
/* Brand fonts (loaded once in PortalLayout <head>): Sora for headings,
   Pathway Extreme for body copy. Form controls don't inherit the body font
   by default, so opt them in explicitly. */
button,
input,
select,
textarea {
  font-family: inherit;
}

h1,
h2,
h3 {
  font-family: "Sora", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Card titles stay in the body face at card scale (Sora 800 is too loud
   inside dense cards). */
.rb-card h2,
.rb-card h3 {
  font-family: "Pathway Extreme", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

/* Keyboard focus: a visible ring on any interactive element that has no
   component-specific :focus-visible rule (component rules like .rb-btn's
   box-shadow ring win on specificity and keep their outline: none). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--rb-red);
  outline-offset: 2px;
}

/* Links: theme-aware default. Without this, unclassed anchors fall back to the
   browser's default navy, which is nearly invisible on the dark background.
   Classed links (.rb-btn, .rb-back, badges) and inline styles still override. */
a {
  color: var(--rb-blue);
}
/* Hover underline only for unclassed text links, so button-styled anchors
   (.rb-btn etc., which have their own rules) aren't affected. */
a:not([class]):hover {
  text-decoration: underline;
}

/* Inline text link (used by client scripts, e.g. final-report Download links). */
.rb-link {
  color: var(--rb-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

main {
  max-width: var(--rb-container);
  margin: 24px auto;
  padding: 0 20px;
}

/* ── 3. Buttons ────────────────────────────────────────────── */
.rb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 8px 14px;
  border-radius: var(--rb-r);
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.rb-btn:focus-visible {
  outline: none;
  box-shadow: var(--rb-focus);
}

.rb-btn:active {
  opacity: 0.88;
}

/* Primary */
.rb-btn--primary {
  background: var(--rb-red);
  color: #ffffff;
  border-color: var(--rb-red);
}

.rb-btn--primary:hover {
  background: var(--rb-red-hover);
  border-color: var(--rb-red-hover);
}

/* Secondary */
.rb-btn--secondary {
  background: var(--rb-surface);
  border-color: var(--rb-border-strong);
  color: var(--rb-text);
}

.rb-btn--secondary:hover {
  background: var(--rb-surface-2);
}

/* Ghost */
.rb-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--rb-text-2);
}

.rb-btn--ghost:hover {
  background: var(--rb-surface-2);
  color: var(--rb-text);
}

/* Danger */
.rb-btn--danger {
  background: var(--rb-surface);
  border-color: #f0acac;
  color: var(--rb-red-text);
}

.rb-btn--danger:hover {
  background: var(--rb-red-soft);
}

/* Action: page-level action buttons (dark ink). Distinct from the red
   sub-nav current pill so "where am I" (red) and "do something" (ink)
   never share a color. Tokens flip cleanly in dark mode. */
.rb-btn--action {
  background: var(--rb-text);
  color: var(--rb-surface);
  border-color: var(--rb-text);
}

.rb-btn--action:hover {
  opacity: 0.86;
}

/* Small */
.rb-btn--sm {
  height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

/* ── 3b. Sub-nav (uniform hub pill row) ────────────────────────
   One pill row under every hub page header. The CURRENT page/tab is the
   single red pill on the page; all other pills stay neutral. Page-level
   action buttons must use .rb-btn--action (ink), never this red. */
.rb-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
}

.rb-subnav__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 4px 14px;
  border-radius: var(--rb-r-pill);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--rb-text-2);
  background: var(--rb-surface);
  border: 1px solid var(--rb-border-strong);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.rb-subnav__pill:hover {
  background: var(--rb-surface-2);
  color: var(--rb-text);
}

.rb-subnav__pill.is-current {
  background: var(--rb-red);
  border-color: var(--rb-red);
  color: #ffffff;
  font-weight: 600;
}

.rb-subnav__pill.is-current:hover {
  background: var(--rb-red-hover);
  border-color: var(--rb-red-hover);
}

.rb-subnav__pill:focus-visible {
  outline: none;
  box-shadow: var(--rb-focus);
}

.rb-subnav__badge {
  font-size: 11px;
  opacity: 0.85;
}

/* Calendar prev/next arrows: large glyph + comfortable tap target
   (the old rb-btn--sm arrows rendered a 12px chevron that was hard to see and click) */
.rb-btn--nav {
  height: 34px;
  min-width: 42px;
  padding: 2px 12px;
  font-size: 22px;
  line-height: 1;
  font-weight: 600;
}

/* ── 4. Badges ─────────────────────────────────────────────── */
.rb-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: var(--rb-r-pill);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}

.rb-badge.is-open {
  background: var(--rb-green-soft);
  color: var(--rb-green);
}

.rb-badge.is-review {
  background: var(--rb-amber-soft);
  color: var(--rb-amber);
}

.rb-badge.is-urgent {
  background: var(--rb-red-soft);
  color: var(--rb-red);
}

.rb-badge.is-info {
  background: var(--rb-blue-soft);
  color: var(--rb-blue);
}

.rb-badge.is-closed {
  background: #eeeeec;
  color: #5f5f5b;
}

/* Muted pill for voided / inactive items (e.g. voided invoices). */
.rb-badge.is-muted {
  background: #f4f4f2;
  color: #9a9a95;
}

/* Small green "Primary" pill used inline (subjects, addresses, vehicles). */
.rb-badge.is-primary {
  background: var(--rb-green-soft);
  color: var(--rb-green);
}

/* Shared form-input styling so inputs/selects look identical everywhere. */
.rb-input {
  padding: 6px 9px;
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-r);
  font-size: 13px;
  background: var(--rb-surface);
  color: var(--rb-text);
  font-family: inherit;
}
.rb-input:focus { outline: none; box-shadow: var(--rb-focus); border-color: var(--rb-blue); }

/* ── 5. Cards ──────────────────────────────────────────────── */
.rb-card {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
  padding: 16px;
}

.rb-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rb-card__row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 13px;
  padding: 4px 0;
  border-top: 1px solid var(--rb-border);
}

.rb-card__row:first-of-type {
  border-top: none;
}

/* Dashboard "Assigned training" rows: title flexes, the status and due-date
   chips sit in fixed-min-width centered columns so every row lines up. */
.rb-train-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rb-train-row > a {
  flex: 1 1 auto;
  min-width: 0;
}
.rb-train-chip {
  flex: 0 0 auto;
  min-width: 88px; /* fits the widest label ("Recert due") so every status chip is the same size */
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.rb-train-chip--date {
  min-width: 100px; /* fits "No due date" so every date chip is the same size */
  background: var(--rb-surface-2);
  color: var(--rb-text-2);
  border: 1px solid var(--rb-border);
}

/* ── 6. Metric cards ───────────────────────────────────────── */
.rb-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--rb-s3);
}

.rb-metric {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r);
  padding: 12px 14px;
}

.rb-metric__label {
  font-size: 12px;
  color: var(--rb-text-2);
  margin-bottom: 4px;
}

.rb-metric__value {
  font-size: 23px;
  font-weight: 500;
  line-height: 1.2;
}

.rb-metric--alert .rb-metric__value {
  color: var(--rb-red);
}

/* ── 7. Forms ──────────────────────────────────────────────── */
.rb-form input,
.rb-form select,
.rb-form textarea {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-r);
  padding: 8px 11px;
  width: 100%;
  background: var(--rb-surface);
  color: var(--rb-text);
  transition: box-shadow 0.12s;
}

.rb-form input,
.rb-form select {
  height: 36px;
}

.rb-form textarea {
  resize: vertical;
  min-height: 80px;
}

.rb-form input:focus-visible,
.rb-form select:focus-visible,
.rb-form textarea:focus-visible {
  outline: none;
  box-shadow: var(--rb-focus);
}

/* Native <select> option text stays readable in dark mode (theme-variable based). */
.rb-form select option,
select option {
  background: var(--rb-surface);
  color: var(--rb-text);
}

.rb-field {
  margin-bottom: 12px;
}

.rb-label {
  display: block;
  font-size: 12px;
  color: var(--rb-text-2);
  margin-bottom: 4px;
  font-weight: 500;
}

.rb-help {
  font-size: 12px;
  color: var(--rb-text-3);
  margin-top: 3px;
}

.rb-error {
  font-size: 12px;
  color: var(--rb-red-text);
  margin-top: 3px;
}

/* ── 8. Tables ─────────────────────────────────────────────── */
.rb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rb-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--rb-text-2);
  padding: 8px 10px;
  border-bottom: 2px solid var(--rb-border-strong);
  white-space: nowrap;
}

.rb-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--rb-border);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rb-table tbody tr:hover {
  background: var(--rb-surface-2);
}

/* Cell utilities. `.rb-nowrap` keeps short tokens (case #s, dates, money) on
   one line — the td default of overflow-wrap:anywhere otherwise lets a narrow
   column break "CT1081" onto two lines. `.rb-ellipsis` truncates long text
   columns (subject, client, title) in fixed-layout tables. */
.rb-table td.rb-nowrap,
.rb-table th.rb-nowrap,
td.rb-nowrap,
th.rb-nowrap {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.rb-table td.rb-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

@media (max-width: 720px) {
  .rb-table thead {
    display: none;
  }

  .rb-table tr {
    display: block;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-r-lg);
    margin-bottom: 10px;
    padding: 6px 12px;
  }

  .rb-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border: none;
    padding: 6px 0;
  }

  .rb-table td::before {
    content: attr(data-label);
    color: var(--rb-text-2);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 90px;
  }

  /* Inside the collapsed cards there is no column to truncate against —
     let ellipsis cells wrap normally again. */
  .rb-table td.rb-ellipsis {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
}

/* ── 9. Page chrome ────────────────────────────────────────── */
.rb-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.rb-page-header h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}

@media (max-width: 720px) {
  .rb-page-header h1 {
    font-size: 22px;
  }
}

.rb-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rb-section {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.rb-section > h2 {
  font-size: 18px;
  margin-bottom: var(--rb-s3);
}

/* Section headings wrapped in a header row (title + action button) get the
   same 18px scale as bare `.rb-section > h2` headings — without this they
   fell back to the browser-default h2 size and rendered noticeably larger
   (dashboard "Assigned training"/"My week", subject/equipment sections). */
.rb-section > .rb-card__header > h2 {
  font-size: 18px;
  margin: 0;
}

.rb-empty {
  text-align: center;
  color: var(--rb-text-2);
  padding: 24px;
}

.rb-back {
  color: var(--rb-red);
  text-decoration: none;
  font-size: 13px;
}

.rb-back:hover {
  text-decoration: underline;
}

.rb-typeahead-results { position: relative; display: flex; flex-direction: column; background: var(--rb-surface); color: var(--rb-text); }
.rb-typeahead-item { text-align: left; padding: 6px 8px; border: 0; background: var(--rb-surface); color: var(--rb-text); cursor: pointer; font-size: 13px; }
.rb-typeahead-item:hover { background: var(--rb-surface-2); }

/* Removable email/recipient chips (invoice CC field) */
.rb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rb-chips:empty { margin-top: 0; }
.rb-recip-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--rb-border); background: var(--rb-surface-2); color: var(--rb-text); font-size: 12px; }
.rb-recip-chip button { border: 0; background: none; color: var(--rb-text-2); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.rb-recip-chip button:hover { color: var(--rb-text); }

/* ── 10. Utilities ─────────────────────────────────────────── */
.rb-muted {
  color: var(--rb-text-2);
}

.rb-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.rb-col {
  display: flex;
  flex-direction: column;
}

.rb-gap-2 { gap: var(--rb-s2); }
.rb-gap-3 { gap: var(--rb-s3); }
.rb-gap-4 { gap: var(--rb-s4); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── 11. Header / nav ──────────────────────────────────────── */
.rb-header {
  background: var(--rb-ink);
  color: #ffffff;
  padding: 12px 20px;
  position: relative;
  z-index: 200;
}

.rb-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rb-header__left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.rb-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.rb-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  flex-shrink: 0;
}

.rb-header__brand strong {
  font-family: "Sora", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 15px;
}

.rb-nav {
  display: flex;
  align-items: center;
}

.rb-nav a {
  color: #cfcfcf;
  margin-right: 16px;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.rb-nav a:hover {
  color: #ffffff;
}

/* Dropdown container */
.rb-navdd {
  position: relative;
  display: inline-block;
  margin-right: 16px;
}

.rb-navdd button {
  background: transparent;
  border: none;
  color: #cfcfcf;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  padding: 0;
  white-space: nowrap;
}

.rb-navdd button:hover {
  color: #ffffff;
}

.rb-navdd__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #1a1a1a;
  border: 1px solid #333333;
  border-radius: 6px;
  min-width: 160px;
  z-index: 100;
  padding: 6px 0;
}

.rb-navdd__menu a {
  display: block;
  color: #cfcfcf;
  text-decoration: none;
  font-size: 14px;
  padding: 7px 14px;
  white-space: nowrap;
  margin-right: 0;
}

.rb-navdd__menu a:hover {
  color: #ffffff;
  background: #2a2a2a;
}

/* Header search form - sits between left nav group and right who/hamburger group */
.rb-search {
  position: relative;
  width: 250px;
  flex-shrink: 0;
}

.rb-search input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--rb-r);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.rb-search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.rb-search input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

/* Global search dropdown */
.gs-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: var(--rb-surface);
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-r-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
  z-index: 9999;
  overflow: hidden;
}

.gs-group-header {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--rb-text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--rb-surface-2);
  border-top: 1px solid var(--rb-border);
}

.gs-group-header:first-child {
  border-top: none;
}

.gs-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--rb-text);
  border-top: 1px solid var(--rb-border);
  transition: background 0.08s;
}

.gs-item:first-child {
  border-top: none;
}

.gs-item:hover,
.gs-item.gs-active {
  background: var(--rb-surface-2);
  color: var(--rb-text);
}

.gs-item-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--rb-text);
}

.gs-item-sub {
  font-size: 12px;
  color: var(--rb-text-2);
}

.gs-item.gs-all {
  font-size: 13px;
  font-weight: 500;
  color: var(--rb-blue);
  background: var(--rb-surface-2);
  border-top: 1px solid var(--rb-border-strong);
  padding: 9px 12px;
}

.gs-item.gs-all:hover {
  background: var(--rb-blue-soft);
  color: var(--rb-blue);
}

.gs-no-results {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--rb-text-3);
  font-style: italic;
}

/* User chip */
.rb-who {
  font-size: 13px;
  color: #b9b9b9;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Account menu (name dropdown) on the right */
.rb-account {
  margin-right: 0;
  flex-shrink: 0;
}
.rb-account__btn {
  background: transparent;
  border: none;
  color: #b9b9b9;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  padding: 0;
  white-space: nowrap;
}
.rb-account__btn:hover {
  color: #ffffff;
}
.rb-navdd__menu--right {
  left: auto;
  right: 0;
}
/* Account actions that only appear inside the mobile hamburger panel */
.rb-nav__account-mobile {
  display: none;
}

/* Theme switch (Light / Dark / System) inside the account menu */
.rb-theme-switch {
  display: flex;
  gap: 4px;
  padding: 8px 14px 2px;
  margin-top: 4px;
  border-top: 1px solid #333333;
}
.rb-theme-switch button {
  flex: 1;
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #cfcfcf;
  font-size: 12px;
  font-family: inherit;
  padding: 5px 0;
  border-radius: 5px;
  cursor: pointer;
}
.rb-theme-switch button:hover {
  color: #ffffff;
  border-color: #555555;
}
.rb-theme-switch button[aria-pressed="true"] {
  background: var(--rb-red);
  border-color: var(--rb-red);
  color: #ffffff;
}

/* Hamburger - hidden at desktop */
.rb-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--rb-r);
  min-width: 40px;
  min-height: 40px;
}

.rb-hamburger:focus-visible {
  outline: none;
  box-shadow: var(--rb-focus);
}

/* ── 12. Weather island (.cw-*) ────────────────────────────── */
.cw-loc {
  font-size: 13px;
  color: var(--rb-text-2);
  margin-bottom: var(--rb-s3);
}

.cw-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rb-s3);
}

.cw-card {
  flex: 1 1 110px;
  min-width: 100px;
  max-width: 160px;
  background: var(--rb-surface-2);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cw-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--rb-text);
}

.cw-temp {
  font-size: 16px;
  font-weight: 500;
  color: var(--rb-text);
  line-height: 1.2;
}

.cw-cond {
  font-size: 12px;
  color: var(--rb-text-2);
  line-height: 1.3;
}

.cw-meta {
  font-size: 11px;
  color: var(--rb-text-3);
  margin-top: 2px;
}

/* Emphasized day card: the case's next scheduled surveillance date. */
.cw-card--target {
  border: 2px solid var(--rb-red);
  padding: 9px 11px; /* keep the box the same size despite the thicker border */
}

.cw-target-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--rb-red-text);
}

@media (max-width: 520px) {
  .cw-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--rb-s2);
  }

  .cw-card {
    flex-shrink: 0;
  }
}

/* ── 13. Cases bulk action bar (.cb-*) ─────────────────────── */
.cb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rb-s2);
  padding: 10px 16px;
  margin-bottom: 12px;
  background: var(--rb-blue-soft);
  border-color: var(--rb-blue);
}

.cb-presets-row {
  margin-bottom: 18px;
}

.cb-preset-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* ── 14. Mobile nav (max-width: 720px) ─────────────────────── */
@media (max-width: 720px) {
  .rb-header__top {
    flex-wrap: wrap;
  }

  .rb-header__left {
    /* Takes remaining space on the brand row */
    gap: 12px;
    flex: 1;
    min-width: 0;
  }

  .rb-header__right {
    /* who + hamburger stay on the first row */
    gap: 8px;
    flex-shrink: 0;
  }

  /* Search wraps to its own full-width second row (order > 1 so it lands after the first row) */
  .rb-search {
    order: 10;
    width: 100%;
    flex-basis: 100%;
    padding-top: 8px;
  }

  .rb-search input {
    height: 36px;
    font-size: 14px;
  }

  /* On mobile the gs-menu should span more of the viewport */
  .gs-menu {
    width: calc(100vw - 32px);
    left: 0;
  }

  .rb-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    background: var(--rb-ink);
    padding: 8px 20px 16px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 199;
    border-top: 1px solid #222222;
  }

  .rb-nav.is-open {
    display: flex;
  }

  .rb-nav a {
    display: block;
    width: 100%;
    padding: 10px 0;
    margin-right: 0;
    font-size: 15px;
    border-bottom: 1px solid #222222;
  }

  .rb-nav a:last-child {
    border-bottom: none;
  }

  .rb-hamburger {
    display: inline-flex;
  }

  /* Dropdowns become static lists inside the mobile panel */
  .rb-navdd {
    position: static;
    display: block;
    width: 100%;
    margin-right: 0;
  }

  .rb-navdd button {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #222222;
    min-height: 40px;
  }

  .rb-navdd__menu {
    position: static;
    background: transparent;
    border: none;
    border-radius: 0;
    min-width: 0;
    padding: 0 0 0 12px;
    z-index: auto;
  }

  .rb-navdd__menu a {
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid #1e1e1e;
    background: transparent;
  }

  .rb-navdd__menu a:hover {
    background: transparent;
    color: #ffffff;
  }

  /* Account actions live in the hamburger panel on mobile; hide the right-side name menu */
  .rb-account {
    display: none;
  }
  .rb-nav__account-mobile {
    display: block;
    width: 100%;
  }
  .rb-nav__account-mobile a {
    display: block;
    width: 100%;
    padding: 10px 0;
    margin-right: 0;
    font-size: 15px;
    color: #cfcfcf;
    text-decoration: none;
    border-bottom: 1px solid #222222;
  }
  .rb-nav__account-mobile a:last-child {
    border-bottom: none;
  }
}

/* ── 11. Notifications ─────────────────────────────────────── */
.nt-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nt-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--rb-r);
  color: #cfcfcf;
  cursor: pointer;
}

.nt-bell:hover {
  color: #ffffff;
}

.nt-bell:focus-visible {
  outline: none;
  box-shadow: var(--rb-focus);
}

.nt-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--rb-r-pill);
  background: var(--rb-red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.nt-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  z-index: 200;
}

.nt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rb-border);
}

.nt-head-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--rb-text);
}

.nt-readall {
  background: transparent;
  border: none;
  color: var(--rb-blue);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 0;
}

.nt-readall:hover {
  text-decoration: underline;
}

.nt-list {
  display: block;
}

.nt-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rb-border);
  text-decoration: none;
  color: var(--rb-text);
}

.nt-item:hover {
  background: var(--rb-surface-2);
}

.nt-item-title {
  display: block;
  font-size: 13px;
  color: var(--rb-text);
}

.nt-item-title.is-unread {
  font-weight: 600;
}

.nt-item-body {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--rb-text-2);
}

.nt-item-time {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--rb-text-3);
}

.nt-empty {
  padding: 18px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--rb-text-2);
}

.nt-foot {
  display: block;
  padding: 9px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--rb-blue);
  text-decoration: none;
}

.nt-foot:hover {
  text-decoration: underline;
}

/* Full notifications page */
.nt-page-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nt-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
  text-decoration: none;
  color: var(--rb-text);
}

.nt-row:hover {
  background: var(--rb-surface-2);
}

.nt-row.is-unread {
  border-left: 3px solid var(--rb-red);
}

.nt-row-main {
  min-width: 0;
}

.nt-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nt-row-title {
  font-size: 14px;
  color: var(--rb-text);
}

.nt-row.is-unread .nt-row-title {
  font-weight: 600;
}

.nt-row-body {
  margin-top: 3px;
  font-size: 13px;
  color: var(--rb-text-2);
}

.nt-row-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--rb-text-3);
  white-space: nowrap;
}

.nt-prefs {
  margin-bottom: var(--rb-s4);
}

.nt-prefs-head {
  font-size: 14px;
  font-weight: 600;
  color: var(--rb-text);
}

.nt-prefs-help {
  margin: var(--rb-s1) 0 var(--rb-s3);
  font-size: 13px;
  color: var(--rb-text-2);
}

.nt-pref-row {
  display: flex;
  align-items: center;
  gap: var(--rb-s2);
  padding: var(--rb-s1) 0;
  font-size: 14px;
  color: var(--rb-text);
  cursor: pointer;
}

.nt-pref-row .nt-pref {
  cursor: pointer;
}

.nt-pref-row .nt-pref:disabled {
  cursor: default;
}

.rb-chip{display:inline-block;padding:5px 12px;border-radius:999px;border:1px solid var(--rb-border);color:var(--rb-text-2);font-size:13px;text-decoration:none;background:var(--rb-surface);}
.rb-chip.is-on{background:var(--rb-text);color:var(--rb-surface);border-color:var(--rb-text);}
.rb-table{width:100%;border-collapse:collapse;font-size:13px;}
.rb-table th{text-align:left;padding:8px 10px;background:var(--rb-surface-2);font-weight:600;}
.rb-table th a{color:inherit;text-decoration:none;}
.rb-table td{padding:8px 10px;border-top:1px solid var(--rb-border);}
.rb-table tbody tr:hover{background:var(--rb-surface-2);}
.rb-badge.type-insured{background:#E6F1FB;color:#0C447C;}
.rb-badge.type-carrier{background:#E1F5EE;color:#085041;}
.rb-badge.type-tpa{background:#EEEDFE;color:#3C3489;}
.rb-badge.type-attorney{background:#FAEEDA;color:#633806;}
.rb-badge.type-individual{background:#F1EFE8;color:#444441;}
.rb-badge.type-other{background:#F1EFE8;color:#444441;}

/* ── Documents hub ────────────────────────────────────────────────────────────
   Breadcrumbs, list/grid toggle, row-action menus, bulk bar, move dialog,
   drag-and-drop highlight, trash view. All colors via var(--rb-*) tokens so
   light/dark themes both work. */

.rb-doc-crumbs {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--rb-text);
}
.rb-doc-crumbs a {
  color: var(--rb-text-2);
  text-decoration: none;
  border-radius: 6px;
  padding: 0 2px;
}
.rb-doc-crumbs a:hover { color: var(--rb-text); text-decoration: underline; }
.rb-doc-crumb-sep { color: var(--rb-text-3); margin: 0 6px; font-weight: 400; }

.rb-doc-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.rb-doc-viewtoggle { margin-left: auto; display: flex; gap: 4px; }
.rb-doc-viewtoggle .rb-btn.is-on {
  background: var(--rb-text);
  color: var(--rb-surface);
  border-color: var(--rb-text);
}

/* List/grid: the wrapper renders both; a class picks which one shows. */
.rb-docs-view .rb-docs-grid { display: none; }
.rb-docs-view.is-grid .rb-docs-table { display: none; }
.rb-docs-view.is-grid .rb-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.rb-doc-tile {
  border: 1px solid var(--rb-border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  background: var(--rb-surface);
}
.rb-doc-tile:hover { border-color: var(--rb-border-strong); background: var(--rb-surface-2); }
.rb-doc-tile .rb-doc-tile-icon { font-size: 28px; line-height: 1.2; }
.rb-doc-tile a {
  display: block;
  color: var(--rb-text);
  text-decoration: none;
  font-size: 13px;
  word-break: break-word;
  margin-top: 4px;
}
.rb-doc-tile-meta { color: var(--rb-text-3); font-size: 11px; margin-top: 2px; }

/* Per-row action menu (a <details> dropdown). The trigger used to be a bare, faint "⋯"
   that field staff kept missing (Make deliverable and Delete live behind it), so it now
   renders as a compact labeled button. */
.rb-doc-menu { position: relative; display: inline-block; margin-left: 8px; vertical-align: middle; }
.rb-doc-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 3px 10px;
  border: 1px solid var(--rb-border-strong);
  border-radius: 6px;
  background: var(--rb-surface);
  color: var(--rb-text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
}
.rb-doc-menu > summary::after { content: " ▾"; font-size: 10px; color: var(--rb-text-2); }
.rb-doc-menu > summary::-webkit-details-marker { display: none; }
.rb-doc-menu[open] > summary,
.rb-doc-menu > summary:hover { background: var(--rb-surface-2); border-color: var(--rb-text-3); }
.rb-doc-menu-list {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 30;
  min-width: 140px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border-strong);
  border-radius: 8px;
  padding: 4px;
  text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.rb-doc-menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13px;
  padding: 6px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  color: var(--rb-text);
  cursor: pointer;
  white-space: nowrap;
}
.rb-doc-menu-list button:hover { background: var(--rb-surface-2); }
.rb-doc-menu-list button.is-danger { color: var(--rb-red-text); }

/* Bulk-select toolbar. */
.rb-doc-bulkbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  padding: 8px 12px;
  border: 1px solid var(--rb-border-strong);
  border-radius: 8px;
  background: var(--rb-surface-2);
  font-size: 13px;
  color: var(--rb-text);
}

/* Drag-and-drop target highlight. */
.rb-drop-hot {
  outline: 2px dashed var(--rb-blue);
  outline-offset: -2px;
  background: var(--rb-surface-2);
  border-radius: 6px;
}

/* Move/Copy destination dialog. */
.rb-doc-dialog {
  border: 1px solid var(--rb-border-strong);
  border-radius: 10px;
  background: var(--rb-surface);
  color: var(--rb-text);
  padding: 16px;
  min-width: 320px;
}
.rb-doc-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.rb-doc-dialog select {
  width: 100%;
  font-size: 13px;
  border: 1px solid var(--rb-border-strong);
  border-radius: 6px;
  background: var(--rb-surface);
  color: var(--rb-text);
  padding: 4px;
}

/* ===================== Training hub ===================== */

/* Module rows in the track list. */
.tr-module {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rb-border);
  background: var(--rb-surface);
}
.tr-module:last-child { border-bottom: none; }
.tr-module.is-retired { opacity: 0.65; }

/* Rendered module bodies (lessons + slides). */
.tr-body h3, .tr-slide h3 {
  font-size: 14px;
  margin: 12px 0 4px;
  color: var(--rb-text);
}
.tr-body ul, .tr-slide ul { margin: 6px 0; padding-left: 22px; }
.tr-figure {
  margin: 10px 0;
}
.tr-figure img {
  max-width: 100%;
  border: 1px solid var(--rb-border);
  border-radius: 8px;
  background: #fff;
}
.tr-figure figcaption {
  font-size: 12px;
  color: var(--rb-text-2);
  margin-top: 4px;
}

/* Presentation decks: one slide visible at a time, stepped by training.js. */
.tr-deck {
  margin-top: 10px;
  border: 1px solid var(--rb-border);
  border-radius: 8px;
  background: var(--rb-surface-2);
  padding: 14px 16px;
  outline: none;
}
.tr-deck:focus-visible { border-color: var(--rb-border-strong); }
.tr-slide {
  display: none;
  font-size: 14px;
  line-height: 1.5;
  color: var(--rb-text);
  min-height: 60px;
}
.tr-slide.is-active { display: block; }
.tr-deck__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rb-border);
}
.tr-deck__counter {
  font-size: 12px;
  color: var(--rb-text-2);
  white-space: nowrap;
}

/* Knowledge checks (quiz forms injected by training.js). */
.tr-quiz {
  margin-top: 12px;
  border: 1px solid var(--rb-border);
  border-radius: 8px;
  background: var(--rb-surface-2);
  padding: 12px 14px;
}
.tr-quiz h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--rb-text-2);
}
.tr-quiz__q {
  border: none;
  margin: 0 0 10px;
  padding: 0;
}
.tr-quiz__q legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--rb-text);
  padding: 0 0 4px;
}
.tr-quiz__choice {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--rb-text);
  padding: 2px 0 2px 6px;
  cursor: pointer;
}
.tr-quiz__result {
  font-size: 13px;
  margin: 8px 0;
}
.tr-quiz__result.is-fail { color: var(--rb-red-text); }

/* ============================================================
   Equipment hub
   Custody tracker: inventory groups, per-row action menus,
   the dual e-signature modal, and the drawable signature pad.
   ============================================================ */

/* Category group heading above each inventory table. */
.eq-cat-header {
  font-size: 15px;
  margin: 0 0 8px;
  color: var(--rb-text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* "Awaiting your signature" callout card. */
.eq-pending {
  border-left: 3px solid var(--rb-red);
}

/* Per-row actions menu (index rows) — mirrors the documents ⋯ menu. */
.eq-menu { position: relative; display: inline-block; }
.eq-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 2px 8px;
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-r);
  background: var(--rb-surface-2);
  color: var(--rb-text-2);
  font-size: 14px;
  user-select: none;
}
.eq-menu > summary::-webkit-details-marker { display: none; }
.eq-menu-list {
  position: absolute;
  right: 0;
  z-index: 40;
  margin-top: 4px;
  min-width: 168px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-r);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  padding: 4px;
  text-align: left;
}
.eq-menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  background: none;
  color: var(--rb-text);
  font-size: 13px;
  border-radius: 5px;
  cursor: pointer;
}
.eq-menu-list button:hover { background: var(--rb-surface-2); }
.eq-menu-list button.is-danger { color: var(--rb-red-text); }

/* Custody ledger signature thumbnails (managers only). */
.eq-sig-thumb {
  display: block;
  margin-top: 4px;
  width: 180px;
  height: auto;
  max-height: 70px;
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r);
  background: #ffffff;
}

/* ---- Signature modal ---- */
.eq-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.eq-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}
.eq-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  background: var(--rb-surface);
  color: var(--rb-text);
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-r-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  padding: 20px;
}

/* ---- Signature pad ---- */
.eq-sigpad {
  display: inline-block;
  max-width: 100%;
}
.eq-sigpad canvas {
  display: block;
  width: 460px;
  max-width: 100%;
  height: 160px;
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-r);
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}

/* ---- LMS ---- */
/* Training LMS surfaces. Brand fonts (Sora headings / Pathway Extreme body) are
   loaded via Google Fonts on the /training pages; everything falls back to the
   system stack. All neutrals come from theme tokens so light + dark both work. */
.rb-lms {
  font-family: "Pathway Extreme", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
}
.rb-lms h1,
.rb-lms h2,
.rb-lms h3,
.rb-lms .rb-lms-title {
  font-family: "Sora", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Hero band on the catalog */
.rb-lms-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 26px 28px;
  margin-bottom: 28px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-left: 4px solid var(--rb-red);
  border-radius: var(--rb-r-lg);
}
.rb-lms-hero h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3vw, 28px);
}
.rb-lms-hero p {
  margin: 0;
  color: var(--rb-text-2);
  font-size: 15px;
  line-height: 1.6;
}
.rb-lms-hero__side {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Conic-gradient progress ring. Set completion with --p (0-100). */
.rb-lms-ring {
  --p: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(var(--rb-red) calc(var(--p) * 1%), var(--rb-border) 0);
  display: grid;
  place-items: center;
  position: relative;
  flex: none;
}
.rb-lms-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--rb-surface);
}
.rb-lms-ring > span {
  position: relative;
  font-family: "Sora", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--rb-text);
}
.rb-lms-ring--sm {
  width: 42px;
  height: 42px;
}
.rb-lms-ring--sm::before {
  inset: 4px;
}
.rb-lms-ring--sm > span {
  font-size: 11px;
}

/* Course card grid */
.rb-lms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.rb-lms-section {
  margin-bottom: 34px;
}
.rb-lms-section > h2 {
  font-size: 17px;
  margin: 0 0 4px;
}
.rb-lms-section > .rb-lms-section__sub {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--rb-text-2);
}
.rb-lms-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
  color: var(--rb-text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
a.rb-lms-card:hover {
  transform: translateY(-3px);
  border-color: var(--rb-red);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: var(--rb-text);
}
.rb-lms-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rb-lms-card__icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--rb-r);
  background: var(--rb-red-soft);
  color: var(--rb-red);
}
[data-theme="dark"] .rb-lms-card__icon {
  color: var(--rb-red-text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .rb-lms-card__icon {
    color: var(--rb-red-text);
  }
}
.rb-lms-card__icon svg {
  width: 22px;
  height: 22px;
}
.rb-lms-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}
.rb-lms-card__meta {
  font-size: 12.5px;
  color: var(--rb-text-2);
}
.rb-lms-card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rb-lms-card__due {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rb-text-2);
}

/* Status chips */
.rb-lms-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--rb-r-pill);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.rb-lms-chip.is-overdue {
  background: var(--rb-red);
  color: #ffffff;
}
.rb-lms-chip.is-due {
  background: var(--rb-amber-soft);
  color: var(--rb-amber);
}
.rb-lms-chip.is-complete {
  background: var(--rb-green-soft);
  color: var(--rb-green);
}
.rb-lms-chip.is-recert {
  background: var(--rb-red-soft);
  color: var(--rb-red-text);
}
.rb-lms-chip.is-progress {
  background: var(--rb-blue-soft);
  color: var(--rb-blue);
}

/* Timeline (account activity feed: interactions/cases/invoices/tasks) */
.rb-timeline {
  display: flex;
  flex-direction: column;
}
.rb-timeline__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--rb-border);
}
.rb-timeline__item:last-child {
  border-bottom: none;
}
.rb-timeline__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rb-surface-2);
  color: var(--rb-text-2);
}
.rb-timeline__icon--interaction {
  background: var(--rb-blue-soft);
  color: var(--rb-blue);
}
.rb-timeline__icon--case {
  background: var(--rb-green-soft);
  color: var(--rb-green);
}
.rb-timeline__icon--invoice {
  background: var(--rb-amber-soft);
  color: var(--rb-amber);
}
.rb-timeline__icon--task {
  background: var(--rb-red-soft);
  color: var(--rb-red);
}
.rb-timeline__body {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}
.rb-timeline__title {
  font-weight: 600;
}
.rb-timeline__sub {
  color: var(--rb-text-2);
  font-size: 13px;
}
.rb-timeline__date {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 13px;
  color: var(--rb-text-2);
  white-space: nowrap;
}

@media (max-width: 760px) {
  /* Task rows carry chip + title + account link + button on one flex line;
     let them wrap instead of pushing the card wider than the phone. */
  .rb-timeline__item {
    flex-wrap: wrap;
  }
}

/* Course overview */
.rb-lms-cover {
  padding: 30px 32px;
  margin-bottom: 24px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-top: 4px solid var(--rb-red);
  border-radius: var(--rb-r-lg);
}
.rb-lms-cover h2 {
  margin: 10px 0 10px;
  font-size: clamp(24px, 3.4vw, 32px);
}
.rb-lms-cover p {
  margin: 0 0 8px;
  max-width: 70ch;
  color: var(--rb-text-2);
  font-size: 15.5px;
  line-height: 1.7;
}
.rb-lms-cover__meta {
  font-size: 13px;
  color: var(--rb-text-2);
  margin-bottom: 16px;
}
.rb-lms-lessonrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
  color: var(--rb-text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
a.rb-lms-lessonrow:hover {
  transform: translateY(-2px);
  border-color: var(--rb-red);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: var(--rb-text);
}
.rb-lms-lessonrow__num {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--rb-border-strong);
  font-family: "Sora", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: var(--rb-text-2);
}
.rb-lms-lessonrow__num.is-done {
  border-color: var(--rb-green);
  background: var(--rb-green-soft);
  color: var(--rb-green);
}
.rb-lms-lessonrow__body {
  flex: 1;
  min-width: 0;
}
.rb-lms-lessonrow__title {
  font-weight: 600;
  font-size: 14.5px;
}
.rb-lms-lessonrow__sub {
  font-size: 12.5px;
  color: var(--rb-text-2);
  margin-top: 2px;
}
.rb-lms-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: var(--rb-r-lg);
  background: var(--rb-green-soft);
  border: 1px solid var(--rb-green);
  color: var(--rb-green);
  font-weight: 600;
}

/* Lesson player */
.rb-lms-player {
  max-width: 860px;
  margin: 0 auto;
}
.rb-lms-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.rb-lms-topbar__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--rb-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-lms-dots {
  display: flex;
  gap: 5px;
  flex: 1;
  min-width: 80px;
}
.rb-lms-dot {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--rb-border);
  transition: background 0.2s ease;
}
.rb-lms-dot.is-done {
  background: var(--rb-red);
}
.rb-lms-stage {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
  padding: 44px 48px;
  min-height: 320px;
}
.rb-lms-slide {
  display: none;
}
.rb-lms-slide.is-active {
  display: block;
  animation: rb-lms-slide-in 0.35s ease both;
}
@keyframes rb-lms-slide-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rb-lms-slide.is-active {
    animation: none;
  }
}
.rb-lms-slide h3 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
  margin: 0 0 18px;
}
.rb-lms-slide p {
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 16px;
  color: var(--rb-text);
}
.rb-lms-slide ul {
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 16px;
  padding-left: 24px;
}
.rb-lms-slide li {
  margin-bottom: 8px;
}
.rb-lms-slide figure {
  margin: 0 0 16px;
}
.rb-lms-slide figure img {
  max-width: 100%;
  border-radius: var(--rb-r);
  border: 1px solid var(--rb-border);
}
.rb-lms-slide figcaption {
  font-size: 13px;
  color: var(--rb-text-2);
  margin-top: 6px;
}
.rb-lms-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

/* Knowledge check */
.rb-lms-quiz {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
  padding: 32px 36px;
  margin-top: 4px;
}
.rb-lms-quiz h3 {
  margin: 0 0 4px;
  font-size: 20px;
}
.rb-lms-q {
  margin: 22px 0;
}
.rb-lms-q h4 {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 12px;
  font-weight: 600;
}
.rb-lms-choice {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  margin-bottom: 8px;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--rb-text);
  background: var(--rb-surface);
  border: 1.5px solid var(--rb-border-strong);
  border-radius: var(--rb-r);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.rb-lms-choice:hover {
  border-color: var(--rb-red);
}
.rb-lms-choice.is-picked {
  border-color: var(--rb-red);
  background: var(--rb-red-soft);
}
.rb-lms-quiz__result {
  margin: 14px 0;
  font-weight: 600;
}
.rb-lms-quiz__result.is-fail {
  color: var(--rb-red-text);
}

/* Completion panel */
.rb-lms-done {
  text-align: center;
  padding: 48px 32px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
}
.rb-lms-done__check {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--rb-green-soft);
  color: var(--rb-green);
  font-size: 30px;
  font-weight: 800;
}
.rb-lms-done h3 {
  margin: 0 0 8px;
  font-size: 24px;
}
.rb-lms-done p {
  color: var(--rb-text-2);
  margin: 0 0 20px;
}
.rb-lms-done__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .rb-lms-hero {
    padding: 20px;
    gap: 16px;
  }
  .rb-lms-grid {
    gap: 12px;
  }
  .rb-lms-cover {
    padding: 20px;
  }
  .rb-lms-stage {
    padding: 24px 20px;
    min-height: 240px;
  }
  .rb-lms-slide h3 {
    margin-bottom: 12px;
  }
  .rb-lms-slide p,
  .rb-lms-slide ul {
    font-size: 15.5px;
  }
  .rb-lms-quiz {
    padding: 20px 16px;
  }
  .rb-lms-topbar__title {
    display: none;
  }
}

/* ---- Onboarding packet (extends the LMS block; .rb-ob-*) ---- */
.rb-lms-chip.is-pending {
  background: var(--rb-surface-2);
  border: 1px solid var(--rb-border);
  color: var(--rb-text-2);
}

/* Packet-list kind glyph turns green once the item is complete */
.rb-ob-glyph.is-done {
  background: var(--rb-green-soft);
  color: var(--rb-green);
}
[data-theme="dark"] .rb-ob-glyph.is-done {
  color: var(--rb-green);
}

.rb-ob-cover h2 {
  margin-bottom: 0;
}

/* Scrollable rendered document (sign / ack bodies) */
.rb-ob-doc {
  max-height: 60vh;
  overflow: auto;
  padding: 26px 30px;
  margin-bottom: 20px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
}
.rb-ob-doc h3 {
  font-size: 17px;
  margin: 22px 0 10px;
}
.rb-ob-doc h3:first-child {
  margin-top: 0;
}
.rb-ob-doc p,
.rb-ob-doc ul {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--rb-text);
  margin: 0 0 14px;
}
.rb-ob-doc ul {
  padding-left: 22px;
}
.rb-ob-doc li {
  margin-bottom: 6px;
}

/* Status panels (signed / acknowledged / awaiting approval) */
.rb-ob-panel {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: var(--rb-r-lg);
  font-weight: 600;
}
.rb-ob-panel.is-done {
  background: var(--rb-green-soft);
  border: 1px solid var(--rb-green);
  color: var(--rb-green);
}
.rb-ob-panel.is-wait {
  background: var(--rb-amber-soft);
  border: 1px solid var(--rb-amber);
  color: var(--rb-amber);
}
.rb-ob-panel__sub {
  font-weight: 400;
  font-size: 13px;
}

/* Signature / action card */
.rb-ob-sigcard {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.rb-ob-sigcard__title {
  font-size: 16px;
  margin: 0 0 12px;
}
.rb-ob-sigpad {
  max-width: 600px;
}
.rb-ob-sigpad canvas {
  display: block;
  width: 100%;
  height: 180px;
  background: #ffffff; /* intentional in both themes: ink-on-paper signature, baked into the PNG */
  border: 1px dashed var(--rb-border-strong);
  border-radius: var(--rb-r);
  touch-action: none;
  cursor: crosshair;
}
.rb-ob-legal {
  font-size: 12.5px;
  color: var(--rb-text-2);
  margin: 10px 0 14px;
  max-width: 62ch;
}
.rb-ob-sigcard__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Read-only submitted-form summary */
.rb-ob-facts {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 8px 16px;
  margin: 0;
}
.rb-ob-facts dt {
  font-size: 13px;
  color: var(--rb-text-2);
}
.rb-ob-facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
@media (max-width: 560px) {
  .rb-ob-facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .rb-ob-facts dd {
    margin-bottom: 8px;
  }
}

/* Upload picker */
.rb-ob-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.rb-ob-filelabel {
  cursor: pointer;
}
.rb-ob-filename {
  font-size: 13px;
  color: var(--rb-text-2);
  overflow-wrap: anywhere;
}
.rb-ob-instructions {
  font-size: 14.5px;
  line-height: 1.7;
  margin: 0 0 16px;
  max-width: 70ch;
}

/* Admin matrix */
.rb-ob-matrixwrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rb-ob-matrix th {
  font-size: 12px;
}
.rb-ob-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.rb-ob-checklist {
  margin-top: 6px;
  font-size: 12.5px;
}
.rb-ob-checklist summary {
  cursor: pointer;
  color: var(--rb-text-2);
  font-weight: 500;
}
.rb-ob-checklist ul {
  margin: 8px 0 0;
  padding-left: 18px;
  max-width: 34ch;
  color: var(--rb-text-2);
}
.rb-ob-checklist li {
  margin-bottom: 6px;
}
@media (max-width: 720px) {
  .rb-ob-cell {
    align-items: flex-end;
  }
}

/* ── Field brief (.rb-brief) ───────────────────────────────── */
/* The investigator's at-a-glance card at the top of the case Workspace tab:
   ID shot | subject vitals | case logistics. Token-only; works in both themes. */
.rb-brief {
  margin-bottom: var(--rb-s4);
}

.rb-brief__label {
  font-family: "Sora", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rb-red);
  margin-bottom: var(--rb-s3);
}

.rb-brief__grid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--rb-s4);
  align-items: start;
}

.rb-brief__photo img,
.rb-brief__silhouette {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--rb-r);
  border: 1px solid var(--rb-border);
  background: var(--rb-surface-2);
}

.rb-brief__silhouette {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rb-text-3);
}

.rb-brief__name {
  display: block;
  font-family: "Sora", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--rb-text);
  margin-bottom: var(--rb-s2);
}

a.rb-brief__name {
  color: var(--rb-red);
  text-decoration: none;
}

a.rb-brief__name:hover {
  text-decoration: underline;
}

.rb-brief__list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--rb-text);
}

.rb-brief__list li {
  padding: 3px 0;
  overflow-wrap: anywhere;
}

.rb-brief__k {
  display: inline-block;
  min-width: 52px;
  margin-right: var(--rb-s2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--rb-text-2);
}

.rb-brief__links {
  margin-left: var(--rb-s2);
  white-space: nowrap;
}

.rb-brief__links a {
  color: var(--rb-blue);
  font-size: 12px;
  margin-right: var(--rb-s2);
}

.rb-brief__snippet {
  color: var(--rb-text-2);
}

.rb-brief--empty {
  margin-bottom: var(--rb-s4);
}

@media (max-width: 760px) {
  .rb-brief__grid {
    grid-template-columns: 1fr;
  }

  .rb-brief__photo img,
  .rb-brief__silhouette {
    width: 96px;
    height: 96px;
  }
}

/* ---------- Hub brief (Analyst / Field / Canvass brief cards on the hub home) ---------- */
.rb-hubbrief {
  margin: 0 0 22px;
}
.rb-hubbrief__heading {
  font-size: 17px;
  margin: 0 0 10px;
}
.rb-hubbrief__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.rb-hubbrief__card {
  gap: 6px;
}
.rb-hubbrief__card--overdue {
  border-color: var(--rb-red);
}
.rb-hubbrief__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.rb-hubbrief__name {
  font-weight: 600;
  font-size: 14px;
}
.rb-hubbrief__row {
  font-size: 12.5px;
  color: var(--rb-text-2);
}
.rb-hubbrief__snippet {
  font-size: 12.5px;
  color: var(--rb-text-2);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rb-hubbrief__foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

/* ── Marketing campaigns (batch-send progress) ─────────────── */
.rb-mkt-progress {
  height: 10px;
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-r-pill);
  background: var(--rb-surface-2);
  overflow: hidden;
}

.rb-mkt-progress__bar {
  height: 100%;
  background: var(--rb-green);
  border-radius: var(--rb-r-pill);
  transition: width 0.3s ease;
}

/* ── 30. Hubs menu flyouts (2026-07-04 nav restructure) ──
   The Hubs dropdown shows one row per hub; hubs with related pages get a side
   flyout on hover/focus. On mobile the flyout collapses to an indented list. */
.rb-navdd__menu a.rb-navdd__hub { font-weight: 700; }
.rb-navdd__item { position: relative; }
.rb-navdd__item > a.rb-navdd__hub { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rb-navdd__caret { font-size: 13px; opacity: 0.7; line-height: 1; }
.rb-navdd__flyout {
  display: none;
  position: absolute;
  left: 100%;
  top: -6px;
  min-width: 170px;
  background: #1a1a1a;
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 6px 0;
  z-index: 101;
}
.rb-navdd__item:hover > .rb-navdd__flyout,
.rb-navdd__item:focus-within > .rb-navdd__flyout { display: block; }
@media (max-width: 720px) {
  .rb-navdd__item { position: static; }
  .rb-navdd__item > a.rb-navdd__hub { justify-content: flex-start; }
  .rb-navdd__caret { display: none; }
  .rb-navdd__flyout {
    display: block;
    position: static;
    background: transparent;
    border: none;
    border-radius: 0;
    min-width: 0;
    padding: 0 0 0 14px;
    z-index: auto;
  }
}

/* ── 31. Pro-Tail hub week grid ── */
.rb-weekgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.rb-weekgrid__day { border: 1px solid var(--rb-border); border-radius: 8px; padding: 6px; min-height: 84px; background: var(--rb-surface); }
.rb-weekgrid__day.is-today { border-color: var(--rb-red); }
.rb-weekgrid__head { font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.rb-weekgrid__card { display: block; border: 1px solid var(--rb-border); border-radius: 6px; padding: 5px 6px; margin-bottom: 5px; font-size: 12px; text-decoration: none; color: var(--rb-text); background: var(--rb-surface-2); }
.rb-weekgrid__card:hover { border-color: var(--rb-red); }
.rb-weekgrid__subj { display: block; font-size: 11px; color: var(--rb-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-weekgrid__inv { display: inline-block; font-size: 10px; font-weight: 700; color: var(--rb-red); }
.rb-weekgrid__empty { font-size: 12px; color: var(--rb-text-3); text-align: center; padding-top: 18px; }
@media (max-width: 760px) {
  .rb-weekgrid { grid-template-columns: 1fr; }
  .rb-weekgrid__day { min-height: 0; }
  .rb-weekgrid__empty { display: none; }
}

/* ── 32. Case stage badge + hover path popover ── */
.rb-stagebadge { position: relative; display: inline-flex; }
.rb-stagebadge__pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; background: var(--rb-surface); border: 1px solid var(--rb-border-strong); border-radius: 8px; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); min-width: 190px; }
.rb-stagebadge:hover .rb-stagebadge__pop,
.rb-stagebadge:focus-within .rb-stagebadge__pop { display: block; }
.rb-stagebadge__row { font-size: 12px; padding: 2px 0; color: var(--rb-text-2); white-space: nowrap; }
.rb-stagebadge__row.is-current { color: var(--rb-red); font-weight: 700; }
.rb-stagebadge__row.is-done { color: #1f7a4d; }

/* ── Collapsible announcements (dashboard + management list) ─────────────── */
.rb-annc > summary { list-style: none; cursor: pointer; }
.rb-annc > summary::-webkit-details-marker { display: none; }
.rb-annc > summary:hover .rb-annc-toggle { text-decoration: underline; }
.rb-annc[open] > summary .rb-annc-toggle::after { content: "Show less"; }
.rb-annc:not([open]) > summary .rb-annc-toggle::after { content: "Show more"; }
.rb-annc-toggle { color: var(--rb-blue); white-space: nowrap; }
.rb-annc-toggle::after { font-size: 12px; }

/* ── 33. Shared loading spinner + busy-button convention ─────────────────────
   .rb-spin       — standalone inline spinner (16px ring, red sweep).
   .rb-btn.is-busy — busy state for any button: shows a spinner before the
   label, blocks pointer input, and dims slightly. Client JS toggles the class
   (and disabled) while an async request is in flight. */
.rb-spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--rb-border);
  border-top-color: var(--rb-red);
  border-radius: 50%;
  vertical-align: -3px;
  animation: rb-spin 0.7s linear infinite;
}
@keyframes rb-spin {
  to { transform: rotate(360deg); }
}
.rb-btn.is-busy {
  pointer-events: none;
  opacity: 0.75;
}
.rb-btn.is-busy::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid var(--rb-border);
  border-top-color: currentColor;
  border-radius: 50%;
  vertical-align: -2px;
  animation: rb-spin 0.7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .rb-spin,
  .rb-btn.is-busy::before { animation: none; }
}

/* Quiz results list (lesson player): per-question right/wrong marks. */
.rb-lms-results {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  text-align: left;
}
.rb-lms-results li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 12px;
  border: 1px solid var(--rb-border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--rb-surface);
}
.rb-lms-results__mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}
.rb-lms-results li.is-right .rb-lms-results__mark { background: #1f9d57; }
.rb-lms-results li.is-wrong .rb-lms-results__mark { background: var(--rb-red); }
.rb-lms-results li.is-wrong { border-color: var(--rb-red); }
.rb-lms-results__body { display: block; min-width: 0; }
.rb-lms-results__q { display: block; font-size: 13px; font-weight: 600; color: var(--rb-text); line-height: 1.45; }
.rb-lms-results__a { display: block; font-size: 12px; color: var(--rb-text-2); margin-top: 2px; }
.rb-lms-results__a--correct { color: var(--rb-green); font-weight: 600; }

/* ── Workflow buttons ──────────────────────────────────────────────────────────
   Red = action outstanding, grey = complete. Used for Acknowledge / Check-In /
   Report across my-cases, the case Schedule tab and hub tables, so the colour
   convention is defined exactly once. See components/WorkflowButton.astro. */
.rb-wfbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.rb-wfbtn.is-todo { background: var(--rb-red); color: #fff; }
.rb-wfbtn.is-todo:hover { filter: brightness(1.08); }
.rb-wfbtn.is-done { background: var(--rb-surface-2); color: var(--rb-text-2); border-color: var(--rb-border); }
.rb-wfbtn.is-done:hover { filter: none; }
.rb-wfbtn[aria-disabled="true"] { cursor: default; pointer-events: none; opacity: .75; }

/* ── Conditional prompt panel ──────────────────────────────────────────────────
   Only rendered when the user actually owes an action (equipment sign-off due,
   manager feedback to acknowledge). See components/PromptSection.astro. */
.rb-prompt {
  border: 1px solid var(--rb-red); border-left-width: 4px;
  border-radius: 10px;
  background: var(--rb-surface); padding: 14px 16px; margin-bottom: 16px;
}
.rb-prompt__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rb-prompt__title { font-weight: 700; font-size: 15px; color: var(--rb-text); }
.rb-prompt__count { font-size: 12px; color: var(--rb-text-2); }

/* ── Case address / vehicle classification badges ─────────────────────────────
   Appended 2026-07-22 for the case Brief restructure. The vocabulary (values +
   labels + these class names) lives in src/lib/case-classification.ts; the render,
   the API validation and public/case-edit.js all read it from there.

   Primary stays `.rb-badge.is-primary` (green) and is a separate boolean column, so
   nothing below touches it. Each classification gets its own hue; the two new pairs
   (purple, teal) are declared as tokens here so light and dark both resolve. */
:root {
  --rb-purple: #5b3fa8;
  --rb-purple-soft: #eeebfa;
  --rb-teal: #0f6b63;
  --rb-teal-soft: #e2f3f1;
  --rb-slate: #55565a;
  --rb-slate-soft: #eceef1;
}
[data-theme="dark"] {
  --rb-purple: #b9a6f0;
  --rb-purple-soft: #241d3a;
  --rb-teal: #6fcfc4;
  --rb-teal-soft: #10302d;
  --rb-slate: #b0b2b8;
  --rb-slate-soft: #26282c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --rb-purple: #b9a6f0;
    --rb-purple-soft: #241d3a;
    --rb-teal: #6fcfc4;
    --rb-teal-soft: #10302d;
    --rb-slate: #b0b2b8;
    --rb-slate-soft: #26282c;
  }
}

/* Shared concepts keep one colour across addresses and vehicles: a relative's house
   and a relative's car read as the same kind of fact in the field. */
.rb-badge.is-cls-relative  { background: var(--rb-purple-soft); color: var(--rb-purple); }
.rb-badge.is-cls-poi       { background: var(--rb-blue-soft);   color: var(--rb-blue); }
.rb-badge.is-cls-visited   { background: var(--rb-amber-soft);  color: var(--rb-amber); }
.rb-badge.is-cls-prior     { background: var(--rb-slate-soft);  color: var(--rb-slate); }
.rb-badge.is-cls-employer  { background: var(--rb-teal-soft);   color: var(--rb-teal); }
.rb-badge.is-cls-medical   { background: var(--rb-red-soft);    color: var(--rb-red-text); }
.rb-badge.is-cls-other     { background: var(--rb-slate-soft);  color: var(--rb-slate); }

.rb-badge.is-cls-subject   { background: var(--rb-green-soft);  color: var(--rb-green); }
.rb-badge.is-cls-associate { background: var(--rb-teal-soft);   color: var(--rb-teal); }
.rb-badge.is-cls-residence { background: var(--rb-blue-soft);   color: var(--rb-blue); }
.rb-badge.is-cls-rental    { background: var(--rb-amber-soft);  color: var(--rb-amber); }
.rb-badge.is-cls-former    { background: var(--rb-slate-soft);  color: var(--rb-slate); }
.rb-badge.is-cls-unknown   { background: var(--rb-red-soft);    color: var(--rb-red-text); }

/* The selector that sets the badge, shown inline on each row for editors. */
.rb-cls-select {
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-r);
  background: var(--rb-surface);
  color: var(--rb-text);
  max-width: 170px;
}

/* ============================================================
   Check-in rework (appended 2026-07-22)
   ============================================================ */

/* ── Flavour / helper text is RED ─────────────────────────────
   `.rb-help` is the portal's dedicated helper-text class: short guidance that sits under a
   form field explaining how to fill it in. It is used ONLY for that (case edit, invoice
   subject, onboarding upload, the styleguide sample and now the whole check-in form), so
   colouring it is safe and does not touch anything structural.

   `.rb-muted` is deliberately NOT changed. It is the portal's general secondary-text colour
   and carries hundreds of table cells, timestamps, counts and sub-labels; turning it red
   would repaint most of the app. Flavour text written as `.rb-muted` + an inline font-size
   should migrate to `.rb-help` page by page.

   `--rb-red-text` (not `--rb-red`) is the token that already carries a light and a dark
   value, so this reads correctly in both themes and keeps AA contrast on both surfaces. */
.rb-help {
  color: var(--rb-red-text);
  line-height: 1.5;
}

/* Same treatment for flavour text that is not inside a .rb-field, so a page never has to
   reach for an inline colour. */
.rb-flavor {
  font-size: 12px;
  line-height: 1.5;
  color: var(--rb-red-text);
  margin: 4px 0 0;
}

/* ── Compact checkbox group ───────────────────────────────────
   Checkboxes inside a `.rb-label` used to inherit the label's block layout and the browser's
   default control size, which rendered them oversized and loosely aligned. `.rb-checks` is a
   tidy left-aligned stack; `.rb-check` is one row of it. */
.rb-checks {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 0 0;
}

.rb-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--rb-text);
  cursor: pointer;
}

.rb-check input[type="checkbox"] {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 0;
  accent-color: var(--rb-red);
  cursor: pointer;
}

.rb-check input[type="checkbox"]:disabled {
  cursor: default;
  opacity: .6;
}

/* ── Check-in list + form ─────────────────────────────────────
   One row per surveillance day on the Check-Ins landing page. */
.rb-ci-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--rb-border);
}

.rb-ci-row__main {
  flex: 1;
  min-width: 220px;
}

.rb-ci-row__date {
  font-size: 14px;
  font-weight: 600;
}

.rb-ci-row__meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--rb-text-2);
}

.rb-ci-row__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

/* The "submitted and locked" / "edits requested" banner on the per-day form. */
.rb-ci-lock {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-r);
  background: var(--rb-surface-2);
  color: var(--rb-text);
  font-size: 13px;
  line-height: 1.5;
}

.rb-ci-lock.is-reopened {
  background: var(--rb-red-soft);
  border-color: var(--rb-red-text);
}

/* Textareas on the check-in form. Replaces the per-element inline styles, which hardcoded a
   light-mode background and so read wrong in dark theme. */
.rb-ci-ta {
  width: 100%;
  max-width: 700px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--rb-border-strong);
  border-radius: 5px;
  font-size: 13px;
  background: var(--rb-surface);
  color: var(--rb-text);
}
