.page.ask-page { max-width: 1080px; }
.ask-surface { background: var(--rc-surface); border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); padding: 28px; margin-top: 24px; }
.ask-examples { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-examples .btn { white-space: normal; text-align: left; }
.ask-log:empty { display: none; }
.ask-question { align-self: flex-end; background: var(--rc-wash); border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); padding: 14px 18px; max-width: 90%; overflow-wrap: anywhere; }
.ask-answer { border-bottom: 1px solid var(--rc-rule); padding: 20px 0; overflow-wrap: anywhere; }
.ask-answer .ask-note { font-size: 13px; color: var(--rc-meta); line-height: 1.65; }
.ask-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 14px 0; }
.ask-figure { font-size: 24px; font-weight: 600; }
.ask-sources summary { color: var(--rc-forest); cursor: pointer; font-weight: 600; font-size: 13px; }
.ask-sources ul { padding-left: 22px; font-size: 13px; line-height: 1.8; }
.ask-composer { padding-top: 20px; border-top: 1px solid var(--rc-rule); }
.ask-composer textarea { resize: vertical; min-height: 80px; }
@media (max-width: 600px) {
  .ask-surface { padding: 18px; }
  .ask-figures { grid-template-columns: 1fr; }
  .ask-surface > .row, .ask-composer .row { flex-wrap: wrap; gap: 12px; }
}

@font-face {
  font-family: "Lexend Deca"; font-style: normal; font-weight: 100 900;
  font-display: swap; src: url("../fonts/LexendDeca.ttf") format("truetype");
}

/* =============================================================================
   RadiCare CRM — design tokens + component classes.
   Implements docs/HUBSPOT_UI_REFERENCE.md (owner direction, 2026-09-05).
   Lexend Deca · RadiCare square logo · soft sage navigation · white content ·
   compact controls with clear contrast · tabular
   figures · status carried by a coloured edge and a chip.

   THE RULE: every page and component under static/crm/ styles itself using ONLY
   (a) the --rc-* custom properties declared here and (b) the classes defined
   here. Hex values appear in THIS FILE AND NOWHERE ELSE.
   ============================================================================= */

:root {
  color-scheme: light;

  /* ── Compatibility aliases — navigation and links ──────────────────────────────── */
  --rc-pine: #284638;      /* dark green emphasis */
  --rc-forest: #365c45;    /* readable links and focus outlines */
  --rc-leaf: #2e503c;
  --rc-moss: #244332;
  --rc-signal: #3f9a5f;    /* positive deltas, live dots */

  /* ── Soft sage chrome, white content, defined borders ─────────────── */
  --rc-canvas: #eef3ef; --rc-surface: #ffffff; --rc-wash: #f4f7f4;
  --rc-header-bg: #edf3ee; --rc-nav-bg: #e6eee7; --rc-nav-ink: #294333;
  --rc-mint: #dce9df; --rc-mint-hover: #cfdfd3;
  --rc-primary-bg: #284638; --rc-primary-hover: #203c2d; --rc-primary-line: #284638;
  --rc-line: #c4d1c7; --rc-line-strong: #9eafa3; --rc-line-hover: #789280;
  --rc-rule: #e2e9e3; --rc-zebra: #f9fbf9; --rc-shimmer-hi: #fafcfa;
  --rc-edge: #d2ddd4;
  --rc-row-amber: #fffcf6;     /* "your move" list-row tint */

  /* ── Ink — six levels, all legible ───────────────────────────────────── */
  --rc-ink: #17251e;           /* headings, titles, values */
  --rc-ink-2: #24352b;         /* control labels, emphasis */
  --rc-body: #24352b;          /* sentences, descriptions */
  --rc-meta: #59685e;          /* refs, dates, counts */
  --rc-label: #59685e;         /* readable property labels */
  --rc-disabled: #8a8a8a;      /* disabled controls ONLY, never live text */
  --rc-on-dark: #ffffff; --rc-on-pine: #ffffff; --rc-on-pine-dim: #dedede;

  /* ── State colours — bordered fill, dark ink, saturated dot ──────────── */
  --rc-amber-bg: #fdf1de; --rc-amber-line: #edd6ab; --rc-amber-ink: #7a4a1c; --rc-amber-dot: #dc9a3f;
  --rc-blue-bg: #dde9f2;  --rc-blue-line: #b9cfe0;  --rc-blue-ink: #17405c;  --rc-blue-dot: #3f7398;
  --rc-good-bg: #e2eee6;  --rc-good-line: #b8d3c2;  --rc-good-ink: #2f5e3f;  --rc-good-dot: #3f9a5f;
  --rc-bad-bg: #fbe6e4;   --rc-bad-line: #eec4bf;   --rc-bad-ink: #94271b;   --rc-bad-dot: #c0392b;
  --rc-idle-bg: #f0f4f0;  --rc-idle-line: #d2ddd4;  --rc-idle-ink: #333333;  --rc-idle-dot: #8a8a8a;
  --rc-bad-hover: #cf4a3c; --rc-bad-edge: #8f271b;

  /* ── Rings, translucencies, overlay ──────────────────────────────────── */
  --rc-ring: 0 0 0 3px rgba(47, 94, 63, 0.16);
  --rc-ring-bad: 0 0 0 3px rgba(192, 57, 43, 0.12);
  --rc-forest-10: rgba(47, 94, 63, 0.1);
  --rc-white-12: rgba(255, 255, 255, 0.12); --rc-white-35: rgba(255, 255, 255, 0.35);
  --rc-overlay: rgba(0, 0, 0, 0.38);
  --rc-guide-accent: #ffcf4a; --rc-guide-edge: #906000;

  /* ── Radii ───────────────────────────────────────────────────────────── */
  --rc-r-pill: 999px;   /* buttons, chips, tabs */
  --rc-r-modal: 16px;   /* modals, drawers */
  --rc-r-card: 8px;    /* cards, tables, panels */
  --rc-r-row: 6px;     /* list rows, inner wells */
  --rc-r-input: 4px;    /* inputs, selects, tiles */
  --rc-r-badge: 6px;    /* badges, index chips */

  /* ── Elevation ───────────────────────────────────────────────────────── */
  --rc-press: none;
  --rc-surface-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  --rc-lift: 0 2px 10px rgba(0, 0, 0, 0.1);
  --rc-pop: 0 10px 26px rgba(16, 32, 26, 0.13);
  --rc-modal: 0 24px 64px rgba(16, 32, 26, 0.3);
  --rc-toast: 0 16px 40px rgba(16, 32, 26, 0.36);

  /* ── Motion ──────────────────────────────────────────────────────────── */
  --rc-t-press: 120ms; --rc-t-hover: 160ms; --rc-t-focus: 140ms;
  --rc-t-enter: 220ms; --rc-t-overlay: 320ms; --rc-t-shimmer: 1.3s;
  --rc-ease-enter: cubic-bezier(0.2, 0.7, 0.3, 1);

  /* ── Type & measure ──────────────────────────────────────────────────── */
  --rc-font: "Lexend Deca", Helvetica, Arial, sans-serif;
  --rc-mono: ui-monospace, Menlo, Consolas, monospace;
  --rc-gutter: 32px; --rc-max: 1680px; --rc-rail-width: 216px; --rc-header-height: 64px;
}

/* Communications: compact inbox rows and a focused reading / linking workspace. */
.inquiries-page .inquiries-head { margin-bottom: 24px; }
.inquiries-page .inquiries-head .title { font-size: 30px; letter-spacing: -0.035em; }
.inquiries-page .inquiries-head .subtitle { font-size: 14px; margin-top: 5px; }
.inquiries-page .inbox-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--rc-line); margin-bottom: 4px; }
.inbox-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 2px; font-size: 13px; cursor: pointer; color: var(--rc-meta); }
.inbox-tabs button[aria-pressed="true"] { border-bottom-color: var(--rc-forest); color: var(--rc-forest); font-weight: 600; }
.inbox-tabs button:focus-visible { outline: 2px solid var(--rc-forest); outline-offset: 3px; }
.inquiries-page .inbox-surface { padding: 24px; border: 1px solid var(--rc-line); border-radius: 12px; background: var(--rc-surface); gap: 20px; }
.inbox-toolbar { border-bottom: 1px solid var(--rc-rule); padding-bottom: 16px; }
.inbox-toolbar .muted { font-size: 12px; }
.inbox-list { display: flex; flex-direction: column; min-width: 0; }
.inbox-message { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 16px; width: 100%; padding: 20px 8px; border: 0; border-bottom: 1px solid var(--rc-rule); border-radius: 4px; background: var(--rc-surface); text-align: left; cursor: pointer; }
.inbox-message:hover { background: var(--rc-wash); }
.inbox-message:focus-visible { outline: 2px solid var(--rc-forest); outline-offset: -2px; }
.email-avatar { display: flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--rc-mint); color: var(--rc-pine); font-size: 12px; font-weight: 600; }
.inbox-message-content { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.email-sender { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.email-date { font-size: 11px; color: var(--rc-meta); font-weight: 400; }
.inbox-subject { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-preview { font-size: 12px; line-height: 1.6; color: var(--rc-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-unlinked { font-size: 11px; color: var(--rc-meta); padding: 5px 10px; background: var(--rc-wash); border-radius: 5px; }
.inquiries-page #mail-drawer { align-items: center; justify-content: center; padding: 24px; }
.inquiries-page #mail-drawer .drawer-panel { width: min(1120px, 100%); height: min(820px, calc(100dvh - 48px)); border-radius: 14px; overflow: hidden; }
.inquiries-page #mail-drawer .drawer-head { padding: 22px 28px; flex-shrink: 0; }
.inquiries-page #mail-drawer .drawer-title { font-size: 19px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.inquiries-page #mail-drawer .drawer-body { padding: 0; background: var(--rc-surface); min-height: 0; }
.email-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: 100%; align-items: start; }
.email-reading { padding: 28px 32px; min-width: 0; }
.email-message-head { display: flex; align-items: center; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--rc-rule); min-width: 0; }
.email-body { padding-top: 24px; min-width: 0; }
.email-prose { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.85 Arial, Helvetica, sans-serif; color: var(--rc-body); }
.email-quoted { margin-top: 24px; border-top: 1px solid var(--rc-rule); padding-top: 16px; }
.email-quoted summary { cursor: pointer; color: var(--rc-forest); font-size: 12px; width: fit-content; }
.email-quoted .email-prose { margin-top: 18px; padding-left: 16px; border-left: 2px solid var(--rc-line); color: var(--rc-meta); font-size: 13px; }
.email-link-panel { background: var(--rc-wash); border-left: 1px solid var(--rc-line); padding: 26px 22px; min-height: 100%; gap: 18px; }
.email-link-panel .section-title { font-size: 15px; }
.email-link-panel .hint, .email-link-panel .label { font-size: 12px; line-height: 1.7; }
.email-link-panel .select { width: 100%; min-width: 0; font-size: 12px; }
.email-link-panel .btn { white-space: normal; height: auto; min-height: 38px; font-size: 12px; }
.mail-filing-controls > .btn { white-space: normal; height: auto; min-height: 38px; }
.email-link-panel summary { font-size: 12px; cursor: pointer; line-height: 1.7; }
.email-consent { display: grid; grid-template-columns: 16px 1fr; gap: 9px; align-items: start; font-size: 12px; line-height: 1.7; }
.email-consent input { margin-top: 4px; accent-color: var(--rc-forest); }
.email-thread-message { padding: 22px; border: 1px solid var(--rc-line); border-radius: 10px; background: var(--rc-surface); }
.email-thread-message .email-body { padding-top: 0; }
.email-date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.email-search-result { padding: 18px 0; border-bottom: 1px solid var(--rc-line); min-width: 0; }
.email-search-result .btn { align-self: flex-start; margin-top: 8px; }
@media (max-width: 850px) {
  .email-workspace { grid-template-columns: 1fr; }
  .email-link-panel { border-left: 0; border-top: 1px solid var(--rc-line); }
  .email-reading { padding: 22px; }
  .inbox-message { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .inbox-message .email-avatar { width: 32px; height: 32px; }
  .inbox-message > .pill, .inbox-message > .email-unlinked { grid-column: 2; justify-self: start; }
  .inquiries-page #mail-drawer { padding: 0; }
  .inquiries-page #mail-drawer .drawer-panel { height: 100dvh; border-radius: 0; }
  .inquiries-page .inbox-surface { padding: 16px; }
  .inbox-tabs { gap: 18px; }
}

/* ── Keyframes ─────────────────────────────────────────────────────────── */
@keyframes rc-spin { to { transform: rotate(360deg); } }
@keyframes rc-shimmer { 0% { background-position: -320px 0; } 100% { background-position: 320px 0; } }
@keyframes rc-pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 154, 63, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(220, 154, 63, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 154, 63, 0); } }
@keyframes rc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rc-slide { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
  min-height: 100dvh; font-family: var(--rc-font); font-size: 15px;
  font-weight: 400; line-height: 1.6; color: var(--rc-body); background: var(--rc-canvas);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { color: var(--rc-ink); font-weight: 600; line-height: 1.25; }
h1 { font-size: 28px; letter-spacing: -0.015em; }
h2 { font-size: 19px; letter-spacing: -0.01em; }
h3 { font-size: 15.5px; }
h4 { font-size: 15px; }
a { color: var(--rc-forest); text-decoration: none; transition: color var(--rc-t-hover) ease; }
a:hover { color: var(--rc-moss); }
:focus-visible { outline: 2px solid var(--rc-forest); outline-offset: 2px; }
::selection { background: var(--rc-mint); color: var(--rc-forest); }

/* ── Layout ────────────────────────────────────────────────────────────── */
.page {
  width: 100%; max-width: var(--rc-max); margin-inline: auto;
  padding: 28px var(--rc-gutter) 64px; display: flex; flex-direction: column; gap: 30px;
}
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-tight { gap: 7px; }
.stack-loose { gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.row-nowrap { flex-wrap: nowrap; }
.spacer { flex: 1 1 auto; }
.divider { height: 1px; background: var(--rc-rule); border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Type roles ────────────────────────────────────────────────────────── */
.title { font-size: 28px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; color: var(--rc-ink); }
.section-title { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: var(--rc-ink); }
.subtitle { font-size: 15px; font-weight: 400; line-height: 1.6; color: var(--rc-body); }
.muted { font-size: 13px; font-weight: 400; color: var(--rc-meta); }
.faint { color: var(--rc-label); }
.strong { color: var(--rc-ink); font-weight: 600; }
.mono, .data { font-family: var(--rc-mono); font-size: 12.5px; font-weight: 500; color: var(--rc-ink-2); font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* NUMERALS — non-negotiable: every column of figures carries one of these. */
.tnum, .num, .figure { font-variant-numeric: tabular-nums; }
.micro-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--rc-label); }
.micro-label-accent { color: var(--rc-forest); }
/* Age — the only red text allowed. */
.age { font-size: 13.5px; font-weight: 400; color: var(--rc-meta); font-variant-numeric: tabular-nums; }
.age-warn { font-weight: 600; color: var(--rc-amber-ink); }
.age-over { font-weight: 600; color: var(--rc-bad-dot); }

/* ── Card ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--rc-surface); border: 1px solid var(--rc-line);
  border-radius: var(--rc-r-card); padding: 24px; box-shadow: var(--rc-surface-shadow);
  transition: border-color var(--rc-t-hover) ease, box-shadow var(--rc-t-hover) ease, transform var(--rc-t-hover) ease;
}
.card-compact { padding: 20px; }
.card-hover:hover { border-color: var(--rc-line-strong); box-shadow: var(--rc-lift); transform: translateY(-1px); }

/* ── Buttons — compact controls with clear contrast ──────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 10px 22px; font-family: inherit; font-size: 13.5px;
  font-weight: 500; line-height: 1.2; color: var(--rc-ink-2); background: var(--rc-surface);
  border: 1px solid var(--rc-line-strong); border-radius: var(--rc-r-input);
  box-shadow: 0 1px 0 var(--rc-edge); cursor: pointer; touch-action: manipulation; white-space: nowrap;
  transition: transform var(--rc-t-press) ease, box-shadow var(--rc-t-press) ease,
    background var(--rc-t-hover) ease, border-color var(--rc-t-hover) ease, color var(--rc-t-hover) ease;
}
.btn:hover:not(:disabled) { background: var(--rc-wash); border-color: var(--rc-line-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 0 0 var(--rc-edge); }
/* .btn-secondary is the base look, named so a page can say what it means. */
.btn-secondary { color: var(--rc-ink-2); background: var(--rc-surface); border-color: var(--rc-line-strong); }

.btn-primary { font-weight: 600; color: var(--rc-on-dark); background: var(--rc-forest); border-color: var(--rc-forest); box-shadow: var(--rc-press); }
.btn-primary:hover:not(:disabled) { color: var(--rc-on-dark); background: var(--rc-leaf); border-color: var(--rc-leaf); }
.btn-primary:active:not(:disabled) { box-shadow: 0 0 0 var(--rc-moss); }

.btn-danger { color: var(--rc-on-dark); background: var(--rc-bad-dot); border-color: var(--rc-bad-dot); box-shadow: 0 2px 0 var(--rc-bad-edge); }
.btn-danger:hover:not(:disabled) { color: var(--rc-on-dark); background: var(--rc-bad-hover); border-color: var(--rc-bad-hover); }
.btn-danger:active:not(:disabled) { box-shadow: 0 0 0 var(--rc-bad-edge); }

.btn-soft { color: var(--rc-forest); background: var(--rc-mint); border-color: var(--rc-good-line); box-shadow: none; }
.btn-soft:hover:not(:disabled) { color: var(--rc-forest); background: var(--rc-mint-hover); border-color: var(--rc-good-line); }
.btn-ghost { color: var(--rc-forest); background: transparent; border-color: transparent; box-shadow: none; padding-inline: 14px; }
.btn-ghost:hover:not(:disabled) { color: var(--rc-forest); background: var(--rc-mint); border-color: transparent; }

.btn-sm { min-height: 30px; padding: 7px 16px; font-size: 12.5px; box-shadow: 0 1px 0 var(--rc-edge); }
.btn-sm:active:not(:disabled) { transform: translateY(1px); }
.btn-sm.btn-primary { box-shadow: 0 2px 0 var(--rc-moss); }
.btn-sm.btn-danger { box-shadow: 0 2px 0 var(--rc-bad-edge); }
.btn-sm.btn-soft, .btn-sm.btn-ghost { box-shadow: none; }
.btn-lg { min-height: 47px; padding: 13px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; min-height: 38px; padding: 0; }
.btn-loading { cursor: progress; }
.spinner { width: 13px; height: 13px; flex: none; border-radius: 50%; border: 2px solid var(--rc-white-35); border-top-color: var(--rc-on-dark); animation: rc-spin 700ms linear infinite; }
/* Flat variants never depress; disabled and focus land last so no size or
   variant rule above can eat the press reset, the dead look, or the ring. */
.btn-soft:active:not(:disabled), .btn-ghost:active:not(:disabled) { transform: none; box-shadow: none; }
.btn:disabled { background: var(--rc-wash); border-color: var(--rc-line); color: var(--rc-disabled); box-shadow: none; transform: none; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: 0 1px 0 var(--rc-edge), var(--rc-ring); }
.btn-sm:focus-visible { box-shadow: 0 1px 0 var(--rc-edge), var(--rc-ring); }
.btn-primary:focus-visible { box-shadow: var(--rc-press), var(--rc-ring); }
.btn-danger:focus-visible { box-shadow: 0 2px 0 var(--rc-bad-edge), var(--rc-ring-bad); }
.btn-soft:focus-visible, .btn-ghost:focus-visible { box-shadow: var(--rc-ring); }
.btn-sm.btn-primary:focus-visible { box-shadow: 0 2px 0 var(--rc-moss), var(--rc-ring); }
.btn-sm.btn-danger:focus-visible { box-shadow: 0 2px 0 var(--rc-bad-edge), var(--rc-ring-bad); }
.btn-sm.btn-soft:focus-visible, .btn-sm.btn-ghost:focus-visible { box-shadow: var(--rc-ring); }

/* ── Segmented control ─────────────────────────────────────────────────── */
.seg { display: inline-flex; padding: 4px; gap: 3px; background: var(--rc-wash); border: 1px solid var(--rc-line); border-radius: var(--rc-r-row); }
.seg > * {
  border: 0; background: none; color: var(--rc-forest); font: inherit; font-size: 13px;
  font-weight: 500; padding: 8px 14px; border-radius: var(--rc-r-input); cursor: pointer;
  white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background var(--rc-t-hover) ease, color var(--rc-t-hover) ease;
}
.seg > *:hover { background: var(--rc-forest-10); }
.seg > [aria-selected="true"], .seg > [aria-pressed="true"], .seg > .is-active { background: var(--rc-surface); color: var(--rc-forest); font-weight: 600; box-shadow: var(--rc-surface-shadow); }
.seg > [aria-selected="true"]:hover, .seg > [aria-pressed="true"]:hover, .seg > .is-active:hover { background: var(--rc-surface); }

/* ── Status pills (where it sits) — a chip states a fact, it never acts ── */
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px;
  border-radius: var(--rc-r-pill); font-size: 12.5px; font-weight: 500; line-height: 1.5;
  white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--rc-idle-ink); background: var(--rc-idle-bg);
}
.pill-neutral { color: var(--rc-idle-ink); background: var(--rc-idle-bg); }
.pill-info { color: var(--rc-blue-ink); background: var(--rc-blue-bg); }
.pill-warn { color: var(--rc-amber-ink); background: var(--rc-amber-bg); }
.pill-success { color: var(--rc-good-ink); background: var(--rc-good-bg); }
.pill-danger { color: var(--rc-bad-ink); background: var(--rc-bad-bg); }
.pill-solid { color: var(--rc-on-dark); background: var(--rc-forest); }
/* Two ways to wear the 8px dot: an explicit <span class="dot">, or .pill-dot
   for a pill whose text a page replaces wholesale (a child would be wiped). */
.pill .dot, .pill-dot::before { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--rc-idle-dot); }
.pill-dot::before { content: ""; }
.pill-info .dot, .pill-info.pill-dot::before { background: var(--rc-blue-dot); }
.pill-warn .dot, .pill-warn.pill-dot::before { background: var(--rc-amber-dot); }
.pill-success .dot, .pill-success.pill-dot::before { background: var(--rc-good-dot); }
.pill-danger .dot, .pill-danger.pill-dot::before { background: var(--rc-bad-dot); }
.pill-solid .dot, .pill-solid.pill-dot::before { background: var(--rc-on-dark); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: var(--rc-r-pill); background: var(--rc-mint); border: 1px solid var(--rc-primary-line); color: var(--rc-pine); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.count-bad { background: var(--rc-bad-bg); border-color: var(--rc-bad-line); color: var(--rc-bad-ink); }
.attention { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--rc-amber-ink); }
.attention::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rc-amber-dot); animation: rc-pulse 2s ease-out infinite; }

/* ── Turn chips (whose move) ───────────────────────────────────────────── */
.chip-turn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: var(--rc-r-badge); border: 1px solid var(--rc-idle-line);
  background: var(--rc-idle-bg); color: var(--rc-idle-ink); font-size: 11.5px;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.chip-turn-amber { background: var(--rc-amber-bg); border-color: var(--rc-amber-line); color: var(--rc-amber-ink); }
.chip-turn-blue { background: var(--rc-blue-bg); border-color: var(--rc-blue-line); color: var(--rc-blue-ink); }
.chip-turn-good { background: var(--rc-good-bg); border-color: var(--rc-good-line); color: var(--rc-good-ink); }
.chip-turn-idle { background: var(--rc-idle-bg); border-color: var(--rc-idle-line); color: var(--rc-idle-ink); }

/* ── Form controls ─────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.bia-request-page { max-width: 800px; }
.bia-request-page > .btn { align-self: flex-start; }
.bia-request-page .facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.bia-request-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.bia-request-fields > legend:not(.sr-only) { margin-bottom: 12px; }
.bia-service-option {
  display: flex; align-items: flex-start; gap: 12px; min-height: 44px;
  padding: 10px 12px; border: 1px solid var(--rc-line);
  border-radius: var(--rc-r-input); cursor: pointer;
}
.bia-service-option:hover { background: var(--rc-wash); border-color: var(--rc-line-hover); }
.bia-service-option:has(:checked) { border-color: var(--rc-forest); background: var(--rc-mint); }
.bia-service-option input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--rc-forest); }
.bia-service-option span { overflow-wrap: anywhere; }
.bia-request-page .body, .bia-request-page .title { overflow-wrap: anywhere; }
.bia-submission-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.label { font-size: 12.5px; font-weight: 500; color: var(--rc-ink-2); }
.hint { font-size: 13px; font-weight: 400; color: var(--rc-meta); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 11px 14px; font-family: inherit; font-size: 14px;
  font-weight: 400; color: var(--rc-ink); background: var(--rc-surface);
  border: 1px solid var(--rc-line-strong); border-radius: var(--rc-r-input);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--rc-t-focus) ease, box-shadow var(--rc-t-focus) ease, background var(--rc-t-hover) ease;
}
.input:hover:not(:disabled), .select:hover:not(:disabled), .textarea:hover:not(:disabled) { border-color: var(--rc-line-hover); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--rc-forest); box-shadow: var(--rc-ring); }
.input::placeholder, .textarea::placeholder { color: var(--rc-label); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--rc-bad-dot); box-shadow: var(--rc-ring-bad); }
.input[readonly] { background: var(--rc-wash); border-color: var(--rc-line); color: var(--rc-meta); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--rc-wash); border-color: var(--rc-line); color: var(--rc-disabled); cursor: not-allowed; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select {
  font-weight: 500; cursor: pointer; appearance: none; padding-right: 38px;
  background-repeat: no-repeat; background-position: right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234d5f55' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* ── Banners (.msg keeps working; .banner is the guide's name) ─────────── */
.banner, .msg {
  display: flex; align-items: center; gap: 13px; padding: 15px 18px;
  border: 1px solid var(--rc-line-strong); border-radius: var(--rc-r-row);
  background: var(--rc-wash); color: var(--rc-body); font-size: 13.5px; font-weight: 400; line-height: 1.55;
}
.banner-good, .msg-success { background: var(--rc-good-bg); border-color: var(--rc-good-line); color: var(--rc-good-ink); }
.banner-amber, .msg-warn { background: var(--rc-amber-bg); border-color: var(--rc-amber-line); color: var(--rc-amber-ink); }
.banner-bad, .msg-danger { background: var(--rc-bad-bg); border-color: var(--rc-bad-line); color: var(--rc-bad-ink); }
.banner-blue { background: var(--rc-blue-bg); border-color: var(--rc-blue-line); color: var(--rc-blue-ink); }
.banner-info, .msg-info { background: var(--rc-wash); border-color: var(--rc-line-strong); color: var(--rc-body); }
.banner-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: var(--rc-r-badge); background: var(--rc-forest); color: var(--rc-on-dark); font-size: 14px; font-weight: 600; }
.banner-amber .banner-icon { background: var(--rc-amber-dot); }
.banner-bad .banner-icon { background: var(--rc-bad-dot); }
.banner-blue .banner-icon { background: var(--rc-blue-dot); }
.banner-info .banner-icon { background: var(--rc-meta); }
/* .msg mints its own icon tile, so a region a page fills with textContent
   alone (which would wipe a child element) still reads as a guide banner. */
.msg-success::before, .msg-warn::before, .msg-danger::before, .msg-info::before {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: var(--rc-r-badge);
  background: var(--rc-meta); color: var(--rc-on-dark); font-size: 14px; font-weight: 600;
}
.msg-success::before { content: "✓"; background: var(--rc-forest); }
.msg-warn::before { content: "!"; background: var(--rc-amber-dot); }
.msg-danger::before { content: "×"; background: var(--rc-bad-dot); }
.msg-info::before { content: "i"; }

/* ── Tables — comparable data only. quiet header, zebra, tabular figures ── */
.table-wrap { position: relative; width: 100%; overflow-x: auto; background: var(--rc-surface); border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); box-shadow: var(--rc-surface-shadow); }
.table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13.5px; }
.table th {
  padding: 11px 18px; text-align: left; white-space: nowrap; font-size: 12.5px; font-weight: 600;
  color: var(--rc-ink-2); background: var(--rc-wash); border-bottom: 1px solid var(--rc-line);
}
.table th[aria-sort]:not([aria-sort="none"]) { color: var(--rc-forest); }
.table td { padding: 13px 18px; color: var(--rc-body); font-weight: 400; border-bottom: 1px solid var(--rc-rule); vertical-align: middle; }
.table tbody tr { background: var(--rc-surface); transition: background var(--rc-t-hover) ease; }
.table tbody tr:nth-child(even) { background: var(--rc-zebra); }
.table tbody tr:hover { background: var(--rc-wash); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { background: var(--rc-mint); color: var(--rc-good-ink); font-weight: 600; border-bottom: 0; }
/* Controls sitting inside a cell run compact so a row keeps its 13px rhythm. */
.table .input, .table .select { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.table .select { padding-right: 32px; background-position: right 9px center; }

/* ── List rows — the default data surface (3px state edge) ────────────── */
.row-list { display: flex; flex-direction: column; gap: 8px; }
.row-item {
  display: flex; align-items: stretch; gap: 16px; padding: 15px 18px;
  background: var(--rc-surface); border: 1px solid var(--rc-line); border-radius: var(--rc-r-row);
  transition: border-color var(--rc-t-hover) ease, box-shadow var(--rc-t-hover) ease, transform var(--rc-t-hover) ease;
}
.row-item::before { content: ""; width: 3px; flex: none; border-radius: 3px; background: var(--rc-idle-dot); }
.row-item:has(a, button):hover, a.row-item:hover { border-color: var(--rc-line-hover); box-shadow: var(--rc-lift); transform: translateY(-1px); }
.row-item-amber { background: var(--rc-row-amber); border-color: var(--rc-amber-line); }
.row-item-amber::before { background: var(--rc-amber-dot); }
.row-item-amber:hover { border-color: var(--rc-amber-dot); }
.row-item-blue::before { background: var(--rc-blue-dot); }
.row-item-blue:hover { border-color: var(--rc-blue-dot); }
.row-item-good::before { background: var(--rc-good-line); }
.row-item-good:hover { border-color: var(--rc-signal); }
.row-item-idle::before { background: var(--rc-idle-dot); }
.row-title { font-size: 15.5px; font-weight: 600; color: var(--rc-ink); overflow-wrap: anywhere; }
.row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 400; color: var(--rc-meta); }
.row-meta > span { min-width: 0; overflow-wrap: anywhere; }

/* ── KPI cards ─────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 22px; background: var(--rc-surface); border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); box-shadow: var(--rc-surface-shadow); }
.kpi-value { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--rc-ink); font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 13px; font-weight: 400; color: var(--rc-body); }
.kpi-good { background: var(--rc-good-bg); border-color: var(--rc-good-line); }
.kpi-good .micro-label, .kpi-good .kpi-value { color: var(--rc-good-ink); }
.kpi-amber { background: var(--rc-amber-bg); border-color: var(--rc-amber-dot); }
.kpi-amber .micro-label, .kpi-amber .kpi-value, .kpi-amber .kpi-sub { color: var(--rc-amber-ink); }
.kpi-delta { align-self: flex-start; padding: 4px 9px; border-radius: var(--rc-r-badge); background: var(--rc-mint); color: var(--rc-good-ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* A delta that fell. The guide names Signal as "positive deltas" and reserves red
   for overdue + destructive ONLY, so a quieter month must not wear it — a month
   down 3% is a fact, not an alarm. Idle is the guide's own "no state" tint, which
   is exactly what this is. (Guide §25.) */
.kpi-delta-down { background: var(--rc-idle-bg); color: var(--rc-idle-ink); }

/* ── Fact grid ─────────────────────────────────────────────────────────── */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px 16px; }
.fact { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fact-value { font-size: 15px; font-weight: 600; color: var(--rc-ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* ── Empty state & loading skeleton ────────────────────────────────────── */
.empty { background: var(--rc-wash); border: 1px solid var(--rc-line-strong); border-radius: var(--rc-r-card); padding: 30px; text-align: center; }
.empty-icon { display: inline-block; width: 44px; height: 36px; margin-bottom: 12px; background: var(--rc-meta); mask: url("../img/empty-state.svg") center / contain no-repeat; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--rc-ink); }
.empty-body { margin-top: 6px; font-size: 13.5px; font-weight: 400; line-height: 1.6; color: var(--rc-body); }
.skeleton {
  height: 13px; border-radius: var(--rc-r-pill); background-size: 320px 100%;
  background-image: linear-gradient(90deg, var(--rc-rule) 0%, var(--rc-shimmer-hi) 40%, var(--rc-rule) 80%);
  animation: rc-shimmer var(--rc-t-shimmer) linear infinite;
}

/* ── Modal (the confirm dialog wears this) ─────────────────────────────── */
.modal { background: var(--rc-surface); border-radius: var(--rc-r-modal); box-shadow: var(--rc-modal); overflow: hidden; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--rc-rule); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--rc-ink); }
.modal-body { padding: 20px 22px; font-size: 15px; font-weight: 400; line-height: 1.6; color: var(--rc-body); overflow-wrap: anywhere; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }

/* ── Top bar — soft sage masthead ──────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--rc-header-bg); border-bottom: 1px solid var(--rc-line); }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; max-width: var(--rc-max); min-height: 64px; margin-inline: auto; padding: 12px var(--rc-gutter);
}
.topbar-meta { font-size: 13px; font-weight: 400; color: var(--rc-meta); }
.topbar .btn-ghost { color: var(--rc-nav-ink); }
.topbar .btn-ghost:hover:not(:disabled) { background: var(--rc-mint); color: var(--rc-pine); }
.topbar .btn-ghost:focus-visible { box-shadow: var(--rc-ring); }
.wordmark { display: inline-flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--rc-ink); }
.wordmark:hover { color: var(--rc-ink); }
.wordmark .care { color: var(--rc-forest); }
.wordmark .mark { display: inline-flex; flex: none; width: 32px; height: 32px; border-radius: var(--rc-r-input); background: url("../img/favicon.png") center / cover no-repeat; transition: opacity var(--rc-t-hover) ease; }
.wordmark:hover .mark { opacity: 0.88; }
.wordmark .crm { font-weight: 400; margin-left: 1px; opacity: 0.85; }
.wordmark-lg { font-size: 20px; gap: 16px; }
.wordmark-lg .mark { width: 50px; height: 50px; border-radius: var(--rc-r-card); }
.brand-logo { display: block; width: 36px; height: 36px; flex: none; object-fit: contain; }
.brand-product { color: var(--rc-forest); font-size: 11px; font-weight: 500; border-left: 1px solid var(--rc-line-strong); padding-left: 10px; }
.wordmark-lg .brand-logo { width: 52px; height: 52px; }
.topbar .wordmark, .topbar .wordmark:hover { color: var(--rc-nav-ink); }
.topbar .wordmark .care { color: var(--rc-forest); }

/* ── Breadcrumb ────────────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--rc-meta); }
.breadcrumb a { color: var(--rc-meta); }
.breadcrumb a:hover { color: var(--rc-forest); }
.breadcrumb .current, .breadcrumb [aria-current] { color: var(--rc-ink); }
.breadcrumb-sep { color: var(--rc-line-strong); }

/* ── Auth shell (login) ────────────────────────────────────────────────── */
.auth-shell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; min-height: 100dvh; padding: 32px 16px 48px; }
.auth-card { width: 100%; max-width: 440px; box-shadow: var(--rc-lift); animation: rc-in var(--rc-t-enter) var(--rc-ease-enter) both; }
.auth-foot { max-width: 440px; text-align: center; font-size: 13px; font-weight: 400; line-height: 1.6; color: var(--rc-meta); }

/* ── Phones — 16px inputs (no iOS zoom) and bigger touch targets ───────── */
@media (max-width: 640px) {
  :root { --rc-gutter: 16px; }
  .page { padding: 20px var(--rc-gutter) 48px; gap: 20px; }
  .inquiries-head > .work-head { flex-basis: 100%; }
  .card { padding: 20px; }
  .topbar-inner { min-height: 58px; padding: 10px var(--rc-gutter); }
  .input, .select, .textarea { font-size: 16px; min-height: 46px; }
  .table .input, .table .select { font-size: 16px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; padding: 9px 16px; }
  .table th, .table td { padding-inline: 14px; }
  .title { font-size: 22px; }
  .kpi-value { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

.email-reply { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--rc-line); }
.email-reply > .btn { align-self: flex-start; }
.email-reply-to { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.email-reply-input { min-height: 160px; width: 100%; resize: vertical; font: 15px/1.65 Arial, sans-serif; }
.email-reply .hint { overflow-wrap: anywhere; }
.email-reply [role="status"]:empty { display: none; }

/* ── App shell — soft sage navigation rail ─────────────────
   Mounted by js/components/nav.js after auth. body.has-rail switches the
   document into the rail grid; the rail is sticky and full-height. */
body.has-rail { display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: start; }
.rail {
  position: sticky; top: 0; z-index: 50; height: 100dvh;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--rc-nav-bg); border-right: 1px solid var(--rc-line); padding: 22px 14px 18px; overflow-y: auto; box-shadow: var(--rc-surface-shadow);
}
.rail-brand { padding: 0 10px; }
.rail-brand, .rail-brand:hover { color: var(--rc-nav-ink); }
.rail-brand .care { color: var(--rc-forest); }
.rail-nav { display: flex; flex-direction: column; gap: 3px; }
.rail-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px;
  border-radius: var(--rc-r-input); font-size: 14px; font-weight: 400;
  color: var(--rc-nav-ink); transition: background var(--rc-t-hover) ease, color var(--rc-t-hover) ease;
}
a.rail-item:hover { background: var(--rc-mint); color: var(--rc-nav-ink); }
.rail-item-active, .rail-item-active:hover { background: var(--rc-mint-hover); color: var(--rc-nav-ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--rc-forest); }
.rail-item-soon { cursor: default; color: var(--rc-meta); justify-content: space-between; }
.rail-tools { padding-top: 12px; border-top: 1px solid var(--rc-line-strong); }
.rail-tools-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; border-radius: var(--rc-r-input); cursor: pointer; list-style: none;
  color: var(--rc-nav-ink); font-size: 11px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  transition: background var(--rc-t-hover) ease, color var(--rc-t-hover) ease;
}
.rail-tools-summary::-webkit-details-marker { display: none; }
.rail-tools-summary::after {
  content: "›"; color: var(--rc-forest); font-size: 17px; line-height: 1;
  transform: rotate(0deg); transition: transform var(--rc-t-hover) ease;
}
.rail-tools[open] > .rail-tools-summary::after { transform: rotate(90deg); }
.rail-tools-summary:hover { background: var(--rc-mint); color: var(--rc-nav-ink); }
.rail-tools-summary-active { background: var(--rc-mint-hover); color: var(--rc-nav-ink); }
.rail-tools-nav { display: flex; flex-direction: column; gap: 2px; padding-top: 5px; }
.rail-tool-item { padding-block: 8px; font-size: 13px; }
.rail-group {
  margin: 14px 0 6px; padding: 15px 14px 0;
  border-top: 1px solid var(--rc-line-strong);
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--rc-nav-ink);
}
.rail-soon {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--rc-meta); border: 1px solid var(--rc-line-strong);
  padding: 2px 8px; border-radius: var(--rc-r-pill);
}
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.rail-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rail-avatar {
  flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--rc-forest);
  color: var(--rc-on-dark); font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.rail-email { font-size: 13px; font-weight: 600; color: var(--rc-on-dark); min-width: 0; }
.rail-signout { align-self: stretch; color: var(--rc-on-pine); }
.rail-signout:hover { color: var(--rc-on-dark); background: rgba(255, 255, 255, 0.08); }

@media (max-width: 920px) {
  /* minmax(0, …), not 1fr: a bare `1fr` track floors at the content's min-content
     width, so ONE wide descendant anywhere on the page widens the whole grid and
     the document scrolls sideways. The desktop rule above already carries the
     guard; dropping it here was why a 360px screen could be pushed past its own
     viewport. */
  body.has-rail { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: sticky; height: auto; display: grid; align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand tools foot" "nav nav nav";
    gap: 7px 10px; padding: 10px 14px; overflow: visible;
  }
  .rail-brand { grid-area: brand; }
  .rail-nav {
    grid-area: nav; min-width: 0; width: 100%; flex-direction: row;
    overflow-x: auto; gap: 2px; scrollbar-width: none;
  }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-item { padding: 8px 12px; white-space: nowrap; font-size: 13px; }
  .rail-item-soon { display: none; }   /* phones show only what works */
  .rail-nav > .rail-group { display: none; } /* only the horizontal rail drops section labels */
  .rail-tools { position: static; grid-area: tools; justify-self: end; padding: 0; border: 0; }
  .rail-tools-summary {
    padding: 8px 12px; white-space: nowrap; color: var(--rc-nav-ink);
    font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
  }
  .rail-tools-summary::after { font-size: 16px; }
  .rail-tools-nav {
    position: absolute; top: calc(100% + 1px); right: 14px; z-index: 60;
    width: min(280px, calc(100vw - 28px)); max-height: calc(100dvh - 114px);
    overflow-y: auto; padding: 8px; border: 1px solid var(--rc-line-strong);
    border-radius: var(--rc-r-card); background: var(--rc-surface); box-shadow: var(--rc-pop);
  }
  .rail-tool-item { padding: 9px 12px; }
  .rail-foot { grid-area: foot; margin: 0; border: 0; padding: 0; flex-direction: row; align-items: center; }
  .rail-email { display: none; }
}

@media (max-width: 420px) {
  .rail-brand { padding: 0; }
  .rail-brand > span:last-child { display: none; }
}

/* ── Completion photos (issue #20, UI_STYLE_GUIDE §13) ────────────────────
   72px linked thumbnails in a wrapping row (phone-first); the link opens the
   signed full-size photo. Hover states the interactivity (guide §11). */
.thumb-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.thumb {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: var(--rc-r-input); border: 1px solid var(--rc-line-strong);
  background: var(--rc-wash);
  transition: border-color var(--rc-t-hover) ease, box-shadow var(--rc-t-hover) ease;
}
.thumb-link { display: inline-flex; border-radius: var(--rc-r-input); }
.thumb-link:hover .thumb { border-color: var(--rc-forest); box-shadow: var(--rc-lift); }

/* ── Home dashboard (issue #49) ────────────────────────────────────────── */
/* One column on phones — the crew reads this on a 390px screen. Two from
   900px: the exception list earns the wider track, today/my-week stack beside
   it. Layout only; every card, row, pill and count is an existing component. */
.home-grid { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
.dashboard-preferences-wide { grid-column: 1 / -1; }
.dashboard-pref-hidden { display: none !important; }
.preferences-group { border: 1px solid var(--rc-line); border-radius: 12px; padding: 16px; min-width: 0; }
.preference-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preference-row > label { flex: 1; min-width: 0; }
#view-preferences { margin-bottom: 24px; scroll-margin-top: 64px; }
@media (max-width: 560px) {
  .preference-row { flex-wrap: wrap; }
  .preference-row > label { flex-basis: 100%; }
}
@media (min-width: 900px) {
  .home-grid { grid-template-columns: 3fr 2fr; gap: 20px; }
}

/* ── Drawer — a side panel that is a dialog (UI_STYLE_GUIDE §27) ──────────
   One element, two shapes: a right-side panel on wide screens, a full-screen
   sheet under 720px, which is the §27 rule "the drawer IS the narrow-screen
   page". Always modal (scrim + aria-modal), because the list behind it must not
   be operable while it is open — that is what makes one Esc/one restore point
   correct. Motion is the guide's 220ms enter on the panel only; the scrim
   fades, and both are disabled by the reduced-motion block above. */
.drawer { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer-scrim { position: absolute; inset: 0; background: var(--rc-overlay); animation: rc-fade var(--rc-t-overlay) ease; }
.drawer-panel {
  position: relative; display: flex; flex-direction: column; gap: 0;
  width: min(560px, 100%); max-width: 100%; height: 100%;
  background: var(--rc-surface); box-shadow: var(--rc-modal);
  border-top-left-radius: var(--rc-r-modal); border-bottom-left-radius: var(--rc-r-modal);
  animation: rc-slide-in var(--rc-t-enter) cubic-bezier(0.2, 0.7, 0.3, 1);
}
.drawer-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--rc-rule); background: var(--rc-surface);
  position: sticky; top: 0; z-index: 1;
}
.drawer-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--rc-ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; background: var(--rc-canvas); }
.drawer-body .facts:not(:has(.field)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@keyframes rc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rc-slide-in { from { transform: translateX(18px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 720px) {
  /* The sheet fills the screen: at 360px a 460px panel would scroll the page
     sideways, and half a row of unusable list behind it helps nobody. */
  .drawer-panel { width: 100%; border-radius: 0; }
}

/* ── Surface hierarchy and readable filter groups (guide §31) ─────────── */
h1[tabindex="-1"]:focus { outline: none; }
.subtitle { max-width: 72ch; }
.card .table-wrap, .card .card, .card .row-item { box-shadow: none; }
.filter-panel { padding: 20px; gap: 16px; }
.filter-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.filter-group > .row { gap: 8px; }
.filter-panel .seg { align-self: flex-start; max-width: 100%; }
.filter-panel .btn[aria-pressed="true"] { box-shadow: none; }
.filter-footer { padding-top: 16px; border-top: 1px solid var(--rc-rule); }
.work-controls .work-views { align-self: stretch; }
.work-controls #filters { border: 0; border-top: 1px solid var(--rc-rule); border-radius: 0; padding: 16px 0 0; }
.work-row-side > .strong { font-size: 13px; font-weight: 500; color: var(--rc-forest); }
.work-row-open:hover .row-title { color: var(--rc-forest); text-decoration: underline; text-underline-offset: 3px; }

/* ── Work Hub screen (issue #111, UI_STYLE_GUIDE §27) ─────────────────────
   Layout only — every row, chip, pill and button below is an existing
   component. The screen adds three things the CRM did not have: a toolbar that
   wraps instead of scrolling, a list row whose right-hand column collapses
   under the title on a phone, and the gate list in the detail. */
/* The header stack takes a ZERO flex basis, not `auto`: with `auto` the three-line
   explainer's own width is the basis, the pair overflows the row, and the two
   buttons wrap under the counts instead of holding the right edge. */
.work-head { flex: 1 1 0; }
.work-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.work-search { flex: 1 1 220px; min-width: 0; position: relative; display: flex; align-items: center; }
.work-search .input { padding-right: 40px; }
.work-search-clear {
  position: absolute; right: 6px; border: 0; background: none; cursor: pointer;
  color: var(--rc-meta); font-size: 16px; line-height: 1; padding: 8px 10px;
  border-radius: var(--rc-r-pill);
}
.work-search-clear:hover { background: var(--rc-mint); color: var(--rc-ink); }

/* The saved-view rail scrolls sideways on a phone rather than wrapping into a
   two-storey block that pushes the list below the fold. */
.work-views { display: flex; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.work-views::-webkit-scrollbar { display: none; }

.work-filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* Row body: title block left, facts right. One column under 720px — the facts
   read as a meta line under the title instead of a squeezed second column. */
.work-row { display: grid; gap: 10px 18px; grid-template-columns: minmax(0, 1fr) auto; align-items: start; width: 100%; }
.work-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
@media (max-width: 720px) {
  .work-row { grid-template-columns: minmax(0, 1fr); }
  .work-row-side { align-items: flex-start; text-align: left; }
}

/* A whole row is the control that opens the detail — a link-styled button so
   keyboard users get it in tab order and hover states it (guide §11). */
.work-row-open {
  flex: 1 1 auto; min-width: 0;
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 0; font: inherit; color: inherit; cursor: pointer;
}
.work-row-open:focus-visible { outline: 2px solid var(--rc-forest); outline-offset: 3px; border-radius: var(--rc-r-row); }
.row-item-selected { border-color: var(--rc-forest); box-shadow: var(--rc-lift); }

/* Closeout gates: met / outstanding / not required for this work type. */
.work-gates { display: flex; flex-direction: column; gap: 6px; }
.work-gate { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 400; color: var(--rc-body); }
.work-gate-mark {
  flex: none; width: 18px; height: 18px; border-radius: var(--rc-r-badge);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; border: 1px solid var(--rc-idle-line);
  background: var(--rc-idle-bg); color: var(--rc-idle-ink);
}
.work-gate-met { background: var(--rc-good-bg); border-color: var(--rc-good-line); color: var(--rc-good-ink); }
.work-gate-owed { background: var(--rc-amber-bg); border-color: var(--rc-amber-line); color: var(--rc-amber-ink); }

/* The one next-action card. Amber when a person owes the move, idle when the
   record is finished — the same two tones the list rows carry. */
.work-next { border: 1px solid var(--rc-amber-line); background: var(--rc-row-amber); border-radius: var(--rc-r-row); padding: 15px 18px; }
.work-next-idle { border-color: var(--rc-line); background: var(--rc-wash); }

/* Final responsive overrides follow the base component rules. */
@media (max-width: 720px) {
  .filter-panel { padding: 16px; }
  .work-head { flex-basis: 100%; }
  .drawer-body { padding: 16px; }
  .drawer-body > .card { padding: 16px; }
  .work-toolbar > .muted { flex-basis: 100%; }
  .client-row { position: relative; flex-wrap: wrap; padding-left: 32px; gap: 12px; }
  .client-row::before { position: absolute; left: 16px; top: 16px; bottom: 16px; }
  .client-row > .spacer { flex-basis: 100%; }
  .client-row > .row { flex: 1 1 100%; justify-content: space-between; }
}


/* Approved task map and workspace presentation, 2026-10-18.
   Shared aliases keep the existing forms and secondary tools consistent. */
body { font-size: 14px; font-weight: 400; line-height: 1.6; }
h1, .title { font-size: 32px; font-weight: 600; line-height: 1.25; letter-spacing: -0.025em; }
h2, .section-title { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
h3, h4, .row-title, .strong { font-weight: 600; }
.subtitle { font-size: 15px; font-weight: 400; color: var(--rc-meta); max-width: 75ch; }
.muted, .hint, .row-meta, .age, .kpi-sub { font-size: 13px; font-weight: 400; color: var(--rc-meta); }
.label, .micro-label { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--rc-label); }
.page > .row .micro-label, .page > .stack > .micro-label { display: none; }
.faint { color: var(--rc-meta); }
.input, .select, .textarea { font-size: 15px; font-weight: 400; min-height: 42px; padding: 10px 12px; border-radius: 6px; }
.input::placeholder, .textarea::placeholder { color: var(--rc-meta); opacity: 1; }
.btn { min-height: 40px; padding: 9px 16px; font-size: 14px; font-weight: 500; box-shadow: none; border-radius: 6px; }
.btn-sm { min-height: 34px; padding: 7px 12px; font-size: 13px; box-shadow: none; }
.btn-primary, .btn-sm.btn-primary { background: var(--rc-primary-bg); border-color: var(--rc-primary-line); color: var(--rc-on-dark); font-weight: 600; box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--rc-primary-hover); border-color: var(--rc-primary-hover); color: var(--rc-on-dark); }
.btn-soft { background: var(--rc-wash); border-color: var(--rc-line-strong); color: var(--rc-forest); }
.btn:active:not(:disabled), .btn-sm:active:not(:disabled) { transform: none; box-shadow: none; }
.btn:focus-visible, .btn-sm:focus-visible { box-shadow: var(--rc-ring); }
.card { box-shadow: none; padding: 20px; }
.card-compact { padding: 16px; }
.card-hover:hover { transform: none; box-shadow: none; }
.row-item { border-radius: 4px; box-shadow: none; padding: 12px 14px; }
.row-item:has(a, button):hover, a.row-item:hover { transform: none; box-shadow: none; background: var(--rc-wash); }
.row-title { font-size: 16px; }
.pill, .chip-turn { font-size: 12px; font-weight: 400; padding: 3px 9px; letter-spacing: 0; text-transform: none; align-self: center; justify-self: start; }
.attention { font-weight: 400; }
.attention::before { animation: none; }
.table { font-size: 14px; }
.table th { font-size: 13px; font-weight: 500; color: var(--rc-meta); background: var(--rc-idle-bg); padding: 12px 14px; }
.table td { font-weight: 400; padding: 14px; }
.table a { color: var(--rc-forest); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.table-wrap { box-shadow: none; border-radius: 4px; }
.seg { border-radius: 0; background: transparent; border: 0; border-bottom: 1px solid var(--rc-line); padding: 0; gap: 6px; }
.seg > * { border-radius: 4px 4px 0 0; padding: 12px 14px; color: var(--rc-meta); font-weight: 400; }
.seg > [aria-selected="true"], .seg > [aria-pressed="true"], .seg > .is-active { background: var(--rc-wash); color: var(--rc-pine); font-weight: 600; box-shadow: inset 0 -3px 0 var(--rc-forest); }
.filter-panel { border: 0; border-radius: 0; padding: 0; gap: 12px; box-shadow: none; }
.filter-panel .btn { border-radius: 6px; }
.filter-footer { padding-top: 12px; }
.work-controls .work-toolbar { padding-bottom: 4px; }
.work-search .input, #client-search { border-radius: 6px; }
#client-search { max-width: 460px; }
.work-views { flex-wrap: wrap; }
.work-row-side > .strong { font-size: 13px; font-weight: 400; }
.drawer-panel { width: min(680px, 100%); }
.drawer-title { font-size: 24px; font-weight: 600; line-height: 1.3; }
.drawer-body { background: var(--rc-surface); padding: 24px; }
.drawer-body > .card { background: var(--rc-surface); box-shadow: none; }
.facts { gap: 24px; }
.fact { gap: 6px; }
.facts dt, .fact > .micro-label { font-size: 13px; font-weight: 500; color: var(--rc-label); }
.facts dd, .fact-value { font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--rc-ink); overflow-wrap: anywhere; }
.kpi { box-shadow: none; }
.kpi-value { font-size: 30px; font-weight: 500; }
body.has-rail { grid-template-columns: var(--rc-rail-width) minmax(0, 1fr); grid-template-rows: var(--rc-header-height) 1fr; }
.app-header { grid-column: 1 / -1; grid-row: 1; position: sticky; top: 0; z-index: 65; height: var(--rc-header-height); display: flex; align-items: center; gap: var(--rc-gutter); padding: 0 var(--rc-gutter); background: var(--rc-surface); border-bottom: 1px solid var(--rc-line); color: var(--rc-nav-ink); }
.app-header .rail-brand { width: var(--rc-rail-width); align-self: stretch; flex: none; margin-left: calc(-1 * var(--rc-gutter)); padding: 0 24px; border-right: 1px solid var(--rc-line); background: var(--rc-nav-bg); font-size: 14px; font-weight: 500; }
.app-header .mark { width: 26px; height: 26px; background: none; color: var(--rc-on-dark); font: 500 20px var(--rc-font); border: 1px solid var(--rc-on-pine-dim); border-radius: 5px; }
.app-header .mark::before, .app-header .mark::after { display: none; }
.global-search { display: flex; margin-left: auto; width: min(360px, 36vw); min-width: 100px; align-items: center; background: var(--rc-surface); border: 1px solid var(--rc-line-strong); border-radius: 6px; padding: 8px 10px; }
.global-search input { color: var(--rc-ink); background: none; border: 0; min-width: 0; width: 100%; font-size: 14px; font-weight: 400; }
.global-search input::placeholder { color: var(--rc-meta); opacity: 1; }
.global-search button { border: 0; background: none; color: var(--rc-forest); cursor: pointer; padding: 1px 4px; }
.app-account { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.app-account .rail-email { max-width: 150px; font-weight: 400; font-size: 12px; color: var(--rc-meta); }
.app-account .rail-avatar { background: var(--rc-mint); color: var(--rc-pine); border-radius: 50%; width: 26px; height: 26px; font-weight: 400; }
.app-signout { color: var(--rc-nav-ink); background: none; border: 0; padding: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.rail { grid-column: 1; grid-row: 2; top: var(--rc-header-height); height: calc(100dvh - var(--rc-header-height)); padding: 20px 10px; gap: 24px; box-shadow: none; }
.rail-item { padding: 12px 14px; border-radius: var(--rc-r-pill); color: var(--rc-nav-ink); font-weight: 400; font-size: 14px; gap: 12px; }
.rail-item-active, .rail-item-active:hover { background: var(--rc-mint-hover); color: var(--rc-pine); font-weight: 600; box-shadow: none; }
.nav-icon { width: 20px; height: 20px; flex: none; }
.rail-tools-summary { font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 300; }
.rail-tool-item { font-size: 13px; }
body.has-rail > .page { grid-column: 2; grid-row: 2; width: 100%; max-width: none; margin: 0; min-height: calc(100dvh - var(--rc-header-height)); padding: var(--rc-gutter); gap: 28px; background: var(--rc-canvas); border-radius: 0; box-shadow: none; }
.client-directory-head, .client-row { display: grid; grid-template-columns: minmax(180px, 1.35fr) minmax(150px, 1.3fr) minmax(110px, .9fr) 95px 120px 64px; gap: 14px; align-items: center; }
.client-directory-head { padding: 11px 14px; background: var(--rc-idle-bg); font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--rc-line); }
#client-list { gap: 0; border: 1px solid var(--rc-line); border-radius: 4px; overflow: hidden; }
.client-row { border: 0; border-bottom: 1px solid var(--rc-line); border-radius: 0; background: var(--rc-surface); padding: 13px 14px; min-width: 0; }
.client-row:last-child { border-bottom: 0; }
.client-row::before { display: none; }
.client-row > * { min-width: 0; overflow-wrap: anywhere; }
.client-row-name { display: flex; align-items: center; gap: 10px; }
.client-avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--rc-idle-bg); color: var(--rc-ink); font-size: 10px; font-weight: 400; }
.client-name-button { text-align: left; border: 0; background: none; padding: 0; font: 500 14px var(--rc-font); color: var(--rc-forest); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; overflow-wrap: anywhere; }
.client-cell { font-size: 13px; color: var(--rc-body); }
.client-cell-label { display: none; }
.client-controls .seg { align-self: stretch; min-width: 0; overflow-x: auto; }
.client-controls .seg > * { flex: none; }
.client-toolbar { gap: 10px; }
.client-toolbar #client-search { flex: 1 1 200px; width: auto; max-width: 360px; }
.filter-menu { position: relative; }
.filter-menu > summary { list-style: none; cursor: pointer; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu > summary::after { content: "⌄"; margin-left: 6px; }
.filter-menu > .row { position: absolute; z-index: 55; top: calc(100% + 8px); left: 0; min-width: 220px; max-width: calc(100vw - 64px); padding: 10px; background: var(--rc-surface); border: 1px solid var(--rc-line); border-radius: 8px; box-shadow: var(--rc-pop); }
.filter-menu > .row > .btn { width: 100%; justify-content: flex-start; border: 0; border-radius: 4px; }
.work-directory-head, .work-directory-row .work-row { display: grid; grid-template-columns: minmax(170px, 1.4fr) minmax(140px, 1.1fr) minmax(100px, .75fr) minmax(110px, .85fr) minmax(140px, 1fr); gap: 20px; align-items: center; }
.work-directory-head { padding: 11px 14px; background: var(--rc-idle-bg); font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--rc-line); }
#work-list { gap: 0; border: 1px solid var(--rc-line); border-radius: 4px; overflow: hidden; }
.work-directory-row { background: var(--rc-surface); border: 0; border-bottom: 1px solid var(--rc-line); border-radius: 0; padding: 0; }
.work-directory-row:last-child { border-bottom: 0; }
.work-directory-row::before { display: none; }
.work-directory-row .work-row-open { padding: 14px; }
.work-directory-row .work-row > * { min-width: 0; overflow-wrap: anywhere; }
.work-directory-row .row-title { font-weight: 500; color: var(--rc-forest); text-decoration: underline; text-underline-offset: 3px; }
.work-directory-row .row-meta { font-size: 12px; }
.work-directory-row .work-row-side { align-items: flex-start; text-align: left; }
.work-status-cell { align-items: flex-start; }
.work-client-cell, .work-next-cell { font-size: 13px; color: var(--rc-body); }
.work-next-cell { color: var(--rc-forest); font-weight: 400; }
.work-directory-row.row-item-selected { background: var(--rc-mint); }
@media (max-width: 1250px) {
  .work-directory-head { display: none; }
  .work-directory-row .work-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .work-directory-row .work-status-cell { grid-column: 2; grid-row: 1; align-items: flex-end; }
  .work-directory-row .work-client-cell { grid-column: 1; grid-row: 2; }
  .work-directory-row .work-row-side { grid-column: 2; grid-row: 2; align-items: flex-end; text-align: right; }
  .work-directory-row .work-next-cell { grid-column: 1 / -1; }
}
#client-list > #detail { border-radius: 0; background: var(--rc-wash); padding: 24px; border: 0; border-block: 1px solid var(--rc-line); }
@media (max-width: 1250px) and (min-width: 921px) {
  .client-directory-head, .client-row { grid-template-columns: minmax(150px, 1.4fr) minmax(130px, 1fr) 100px 80px 64px; }
  .client-created { display: none; }
}
@media (max-width: 920px) {
  body.has-rail { display: block; }
  #view-preferences { scroll-margin-top: 180px; }
  .app-header { height: 48px; padding: 0 12px; gap: 12px; }
  .app-header .rail-brand { width: auto; font-size: 12px; }
  .app-account .rail-email { display: none; }
  .global-search { flex: 1; width: auto; }
  .rail { display: flex; top: 48px; height: auto; padding: 6px 10px; gap: 4px; overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--rc-line); }
  .rail-nav { flex: 1 0 100%; display: flex; flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .rail-item { padding: 7px 10px; font-size: 12px; }
  .rail-item .nav-icon { display: none; }
  .rail-tools { flex: none; margin: 0 0 0 auto; }
  .rail-tools-summary { padding: 7px 6px; font-size: 12px; }
  .rail-tools-nav { top: 100%; right: 10px; }
  body.has-rail > .page { width: calc(100% - 20px); margin: 10px; padding: 20px; min-height: calc(100dvh - 116px); }
  .client-directory-head { display: none; }
  .client-row { position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; padding: 16px; }
  .client-row-name { grid-column: 1; }
  .client-row > .client-open { grid-column: 2; grid-row: 1; }
  .client-row > .client-cell { grid-column: 1 / -1; }
  .client-cell-label { display: inline; font-weight: 500; margin-right: 8px; }
  .client-created { display: block; }
}
@media (max-width: 520px) {
  .app-header .rail-brand > span:last-child, .app-account .rail-user { display: none; }
  .app-header .brand-logo { width: 32px; height: 32px; }
  .app-account { gap: 0; }
  .global-search { padding-inline: 8px; }
  body.has-rail > .page { padding: 16px; }
  .work-toolbar > .muted { flex-basis: 100%; }
  .drawer-panel { width: 100%; }
  .drawer-body, .drawer-body > .card { padding: 16px; }
  .filter-panel { padding: 0; }
}

/* Follow-ups keep readable notes and full-width editors on narrow screens. */
.client-followup { align-items: flex-start; flex-wrap: wrap; }
.client-followup > .spacer { flex: 1 1 260px; min-width: 0; }
.client-followup-actions { flex: 1 1 240px; align-items: flex-start; min-width: 0; }
.client-followup-actions > details { width: 100%; min-width: 0; }
.client-followup-actions form { padding-top: 12px; }
.client-followup-actions > a { white-space: normal; text-align: left; }
@media (max-width: 640px) {
  .client-followup { flex-direction: column; align-items: stretch; }
  .client-followup > .spacer, .client-followup-actions { flex-basis: auto; width: 100%; }
}

/* Calendar: explicit day boundaries, restrained surfaces, and readable shifts. */
.sched-range { color: var(--rc-ink); font-size: 16px; font-weight: 400; margin-top: 8px; }
.sched-panel { --rc-sched-line: #8a8a8a; container-type: inline-size; border: 1px solid var(--rc-sched-line); border-radius: 6px; background: var(--rc-surface); overflow: hidden; }
.sched-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding: 14px 16px; font-size: 13px; color: var(--rc-meta); }
.sched-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.sched-key { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.sched-key::before { content: ""; width: 10px; height: 10px; border: 1px solid; border-radius: 2px; }
.sched-key-assigned::before { background: var(--rc-blue-bg); border-color: var(--rc-blue-dot); }
.sched-key-confirmed::before { background: var(--rc-good-bg); border-color: var(--rc-good-dot); }
.sched-key-off::before { background: var(--rc-amber-bg); border-color: var(--rc-amber-dot); }
.sched-scroll { border: 0; border-top: 1px solid var(--rc-sched-line); border-radius: 0; overscroll-behavior-x: contain; }
.sched-scroll:focus-visible { outline: 2px solid var(--rc-forest); outline-offset: -2px; }
.sched-table { min-width: 1110px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.sched-table th, .sched-table td { border-right: 1px solid var(--rc-sched-line); border-bottom: 1px solid var(--rc-sched-line); }
.sched-table th:last-child, .sched-table td:last-child { border-right: 0; }
.sched-table tbody tr:last-child th, .sched-table tbody tr:last-child td { border-bottom: 0; }
.sched-table thead th { position: relative; height: 90px; vertical-align: top; padding: 12px 14px; background: var(--rc-wash); color: var(--rc-ink); border-bottom-width: 2px; }
.sched-table th.sched-who { position: sticky; left: 0; z-index: 2; width: 158px; border-right-width: 2px; white-space: normal; text-align: left; }
.sched-table thead th.sched-who { vertical-align: middle; font-size: 13px; }
.sched-table tbody th.sched-who { padding: 18px 14px; vertical-align: top; background: var(--rc-wash); color: var(--rc-ink); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.sched-weekday { display: block; font-size: 13px; font-weight: 400; }
.sched-date { display: block; font-size: 23px; font-weight: 500; line-height: 1.35; font-variant-numeric: tabular-nums; }
.sched-today-label { position: absolute; top: 13px; right: 10px; font-size: 12px; font-weight: 500; color: var(--rc-forest); }
.sched-table thead th.sched-today { background: var(--rc-mint); box-shadow: inset 0 3px 0 var(--rc-forest); }
.sched-table tbody tr, .sched-table tbody tr:hover, .sched-table tbody tr:nth-child(even) { background: var(--rc-surface); }
.sched-table .sched-weekend { background: var(--rc-wash); }
.sched-table td { height: 1px; padding: 0; vertical-align: top; }
.sched-table td.sched-today { background: var(--rc-mint); }
.sched-table td.sched-cell-off { background: var(--rc-row-amber); }
.sched-day { display: block; width: 100%; height: 100%; min-height: 112px; margin: 0; padding: 10px 8px; border: 0; border-radius: 0; background: transparent; color: var(--rc-ink); font: inherit; text-align: left; cursor: pointer; transition: background var(--rc-t-hover) ease; }
.sched-day:hover { background: var(--rc-mint-hover); }
.sched-cell-selected .sched-day { box-shadow: inset 0 0 0 3px var(--rc-forest); }
.sched-day:focus-visible { outline: 2px dashed var(--rc-ink); outline-offset: -5px; }
.sched-stack { display: flex; flex-direction: column; gap: 7px; height: 100%; }
.sched-unplanned { display: block; padding: 4px; color: var(--rc-meta); font-weight: 300; }
.sched-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 100%; padding: 8px; border: 1px solid var(--rc-blue-line); border-left: 3px solid var(--rc-blue-dot); border-radius: 4px; background: var(--rc-blue-bg); color: var(--rc-blue-ink); font-size: 12px; font-weight: 400; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.sched-chip-title { font-weight: 500; }
.sched-chip-time { font-size: 12px; font-variant-numeric: tabular-nums; }
.sched-src { font-size: 12px; font-weight: 400; }
.sched-chip-confirmed { background: var(--rc-good-bg); border-color: var(--rc-good-line); border-left-color: var(--rc-good-dot); color: var(--rc-good-ink); }
.sched-chip-off { background: var(--rc-amber-bg); border-color: var(--rc-amber-line); border-left-color: var(--rc-amber-dot); color: var(--rc-amber-ink); }
.sched-chip-avail { background: var(--rc-idle-bg); border-color: var(--rc-idle-line); border-left-color: var(--rc-idle-dot); color: var(--rc-idle-ink); }
.sched-chip-external { background: var(--rc-wash); border-style: dashed; border-color: var(--rc-line-hover); color: var(--rc-meta); }
.sched-imported-button { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.sched-empty { border: 0; border-radius: 0; background: var(--rc-surface); }
.sched-empty .btn { margin-top: 16px; }
.sched-scroll-hint { display: none; padding: 12px 16px; border-top: 1px solid var(--rc-sched-line); color: var(--rc-meta); font-size: 12px; }
@container (max-width: 1110px) {
  .sched-scroll-hint { display: block; }
}
@media (max-width: 640px) {
  .sched-table th.sched-who { width: 130px; }
  .sched-toolbar { align-items: flex-start; gap: 10px; }
  .sched-legend { gap: 12px; font-size: 12px; }
}

/* Shared loading, transitions and feedback. No artificial completion percentage. */
.empty { background: var(--rc-surface); border-color: var(--rc-line); padding: 32px 24px; }
.empty-title { font-size: 17px; font-weight: 500; }
.empty-body { max-width: 58ch; margin: 8px auto 0; font-size: 14px; font-weight: 300; }
.loading-panel { padding: 24px; gap: 20px; }
.loading-heading { display: flex; align-items: center; gap: 10px; color: var(--rc-meta); font-size: 14px; font-weight: 400; }
.skeleton { height: 11px; background-image: linear-gradient(90deg, var(--rc-idle-bg) 0%, var(--rc-shimmer-hi) 50%, var(--rc-idle-bg) 100%); animation-duration: 1.6s; }
.loading-row { display: flex; align-items: center; gap: 16px; padding: 20px 18px; border: 1px solid var(--rc-line); border-radius: 5px; background: var(--rc-surface); }
.loading-avatar { flex: none; width: 32px; height: 32px; border-radius: 5px; background: var(--rc-idle-bg); }
.loading-row .skeleton:first-child { width: 46%; }
.loading-row .skeleton:last-child { width: 78%; }
.loading-row:nth-child(2n) .skeleton:first-child { width: 58%; }
.loading-row .stack { gap: 10px; }
.loading-row > .skeleton.loading-tag { width: 68px; height: 24px; flex: none; border-radius: 5px; }
.spinner, .btn-loading:not(:has(.spinner))::before { display: inline-block; width: 14px; height: 14px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rc-spin 800ms linear infinite; }
.btn-loading:not(:has(.spinner))::before { content: ""; }
.btn:active:not(:disabled), .btn-sm:active:not(:disabled) { filter: brightness(0.94); }
.btn:focus-visible, .dialog-close:focus-visible, .toast-close:focus-visible { outline: 2px solid var(--rc-forest); outline-offset: 3px; box-shadow: none; }
.activity-feedback { position: fixed; inset: 0; pointer-events: none; z-index: 160; }
.activity-line { position: absolute; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; background: var(--rc-idle-bg); }
.activity-line::after { content: ""; display: block; width: 32%; height: 100%; background: var(--rc-forest); animation: rc-progress 1.3s ease-in-out infinite; }
.activity-label { position: absolute; top: 60px; right: 24px; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--rc-line); border-radius: 6px; background: var(--rc-surface); color: var(--rc-ink); box-shadow: var(--rc-surface-shadow); font-size: 13px; font-weight: 400; }
.activity-label .spinner { width: 12px; height: 12px; }
.toast-host { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); right: 24px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 100px); overflow-y: auto; pointer-events: none; padding: 4px; }
.toast { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 16px; border: 1px solid var(--rc-line-strong); border-left: 3px solid var(--rc-blue-dot); border-radius: 7px; background: var(--rc-surface); color: var(--rc-ink); box-shadow: var(--rc-surface-shadow); font-size: 14px; font-weight: 300; line-height: 1.6; pointer-events: auto; overflow-wrap: anywhere; animation: rc-content-in 160ms ease both; }
.toast-success { border-left-color: var(--rc-good-dot); }
.toast-error { border-left-color: var(--rc-bad-dot); }
.toast-warn { border-left-color: var(--rc-amber-dot); }
.toast-icon { display: inline-flex; flex: none; margin-top: 2px; color: var(--rc-blue-ink); }
.toast-icon svg { width: 20px; height: 20px; }
.toast-success .toast-icon { color: var(--rc-good-ink); }
.toast-error .toast-icon { color: var(--rc-bad-ink); }
.toast-warn .toast-icon { color: var(--rc-amber-ink); }
.toast-text { flex: 1; min-width: 0; }
.toast-close, .dialog-close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; padding: 6px; border: 0; border-radius: 5px; background: transparent; color: var(--rc-meta); cursor: pointer; }
.toast-close { margin: -4px -6px -4px 0; }
.toast-close svg, .dialog-close svg { width: 18px; height: 18px; }
.toast-close:hover, .dialog-close:hover { background: var(--rc-idle-bg); color: var(--rc-ink); }
.toast-leaving { animation: rc-content-out 140ms ease both; }
.confirm-dialog { width: min(480px, calc(100vw - 32px)); max-width: 100%; max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--rc-line-strong); border-radius: 10px; background: var(--rc-surface); color: var(--rc-ink); box-shadow: var(--rc-modal); overflow-y: auto; }
.confirm-dialog::backdrop { background: var(--rc-overlay); animation: rc-fade 140ms ease both; }
.confirm-dialog .modal { border-radius: 0; box-shadow: none; }
.confirm-dialog[open] { animation: rc-content-in 160ms ease both; }
.confirm-dialog .modal-head { padding: 24px 24px 12px; border: 0; justify-content: space-between; align-items: flex-start; }
.confirm-dialog .modal-head h2 { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.4; }
.dialog-close { margin: -4px -8px 0 4px; }
.confirm-dialog .modal-body { margin: 0; padding: 0 24px 24px; font-size: 14px; font-weight: 300; line-height: 1.7; color: var(--rc-meta); }
.confirm-field { padding: 0 24px 24px; }
.confirm-field .label { display: block; margin-bottom: 8px; }
.confirm-field .input, .confirm-field .textarea { width: 100%; }
.confirm-dialog .modal-foot { padding: 16px 24px; border-top: 1px solid var(--rc-line); background: var(--rc-wash); gap: 10px; flex-wrap: wrap; }
.confirm-dialog .btn { min-height: 38px; border-radius: 5px; font-weight: 400; }
.confirm-dialog.dialog-leaving { animation: rc-content-out 120ms ease both; }
.confirm-dialog.dialog-leaving::backdrop { animation: rc-fade-out 120ms ease both; }
body.has-rail > .page, #detail:not([hidden]) { animation: rc-content-in 160ms ease; }
.topbar .wordmark .mark { background: transparent; border: 1px solid var(--rc-line-strong); color: var(--rc-on-dark); font-size: 22px; font-weight: 300; }
.topbar .wordmark .mark::before { content: "R"; }
.topbar + .page { background: var(--rc-surface); border: 1px solid var(--rc-line); border-radius: 8px; margin: 20px auto; width: calc(100% - 40px); min-height: calc(100dvh - 110px); }
details[open] > :not(summary) { animation: rc-fade 120ms ease; }
@keyframes rc-progress { from { transform: translateX(-110%); } to { transform: translateX(420%); } }
@keyframes rc-content-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rc-content-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(3px); } }
@keyframes rc-fade-out { from { opacity: 1; } to { opacity: 0; } }
@media (max-width: 640px) {
  .activity-label { top: 100px; right: 16px; }
  .toast-host { bottom: max(16px, env(safe-area-inset-bottom)); right: 12px; width: calc(100vw - 24px); }
  .confirm-dialog .modal-head { padding: 20px 20px 12px; }
  .confirm-dialog .modal-body { padding: 0 20px 20px; }
  .confirm-dialog .modal-foot { padding: 16px 20px; }
  .confirm-dialog .btn, .toast-close, .dialog-close { min-width: 44px; min-height: 44px; }
  .loading-row { gap: 12px; padding: 16px; }
  .loading-row > .loading-tag { display: none; }
}

/* Business development: shared CRM surfaces, compact relationship comparisons. */
.bd-page { max-width: 1480px; }
.bd-heading { gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.bd-workspace { gap: 0; border: 1px solid var(--rc-line); border-radius: 8px; background: var(--rc-surface); overflow: hidden; }
.bd-tabs { display: flex; gap: 24px; padding: 0 22px; border-bottom: 1px solid var(--rc-line); }
.bd-tab { display: flex; align-items: center; gap: 9px; padding: 17px 0; border: 0; border-bottom: 3px solid transparent; background: transparent; font: inherit; color: var(--rc-meta); cursor: pointer; }
.bd-tab[aria-pressed="true"] { border-bottom-color: var(--rc-forest); color: var(--rc-ink); font-weight: 500; }
.bd-tab:hover { color: var(--rc-forest); }
.bd-tab:focus-visible { outline: 2px solid var(--rc-forest); outline-offset: 2px; }
.bd-count { padding: 2px 7px; border-radius: 5px; background: var(--rc-mint); font-size: 12px; color: var(--rc-ink); }
.bd-toolbar { display: flex; align-items: flex-end; gap: 12px; padding: 20px 22px 12px; flex-wrap: wrap; }
.bd-toolbar .field { min-width: 150px; flex: 1; }
.bd-toolbar .bd-search { flex: 2; min-width: 230px; }
.bd-toolbar .btn { min-height: 38px; margin-bottom: 1px; }
.bd-toolbar .input, .bd-toolbar .select { min-height: 38px; width: 100%; }
.bd-results { padding: 8px 22px 14px; gap: 10px; }
.bd-records { width: 100%; overflow-x: auto; }
.bd-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 800px; }
.bd-table th { padding: 12px 18px; border-block: 1px solid var(--rc-line); background: var(--rc-wash); font-size: 12px; font-weight: 500; color: var(--rc-meta); text-align: left; }
.bd-table td { padding: 18px; vertical-align: top; border-bottom: 1px solid var(--rc-rule); overflow-wrap: anywhere; }
.bd-table th:first-child { width: 25%; }
.bd-table th:nth-child(2) { width: 19%; }
.bd-table th:nth-child(3) { width: 26%; }
.bd-table th:last-child { width: 76px; }
.bd-table tr:last-child td { border-bottom: 0; }
.bd-table tbody tr:hover { background: var(--rc-wash); }
.bd-record-link.btn { display: inline; padding: 0; border: 0; min-height: auto; background: transparent; text-align: left; color: var(--rc-forest); font-size: 14px; font-weight: 500; white-space: normal; box-shadow: none; }
.bd-record-link:hover { text-decoration: underline; }
.bd-table .hint { font-size: 12px; line-height: 1.6; margin: 5px 0 0; }
.bd-value { font-weight: 400; font-size: 13px; margin: 0; }
.bd-due { color: var(--rc-amber-ink); font-size: 12px; margin: 5px 0 0; }
.bd-table .pill { font-size: 11px; padding: 4px 9px; }
.business-development-page .drawer-panel { width: min(720px, 100%); }
.business-development-page .drawer-head { padding: 20px 24px; }
.business-development-page .drawer-head > .stack { flex: 1; min-width: 0; }
.business-development-page .bd-detail { background: var(--rc-wash); }
.bd-section { padding: 22px; border-radius: 7px; box-shadow: none; }
.bd-section .section-title { font-size: 16px; }
.bd-section .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bd-section .input, .bd-section .select, .bd-section .textarea { width: 100%; }
.bd-subsection { border-top: 1px solid var(--rc-line); padding-top: 20px; margin-top: 4px; }
.bd-detail p { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .bd-table { min-width: 0; table-layout: auto; }
  .bd-table thead { display: none; }
  .bd-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; }
  .bd-table tr { display: block; border: 1px solid var(--rc-line); border-radius: 7px; padding: 14px; }
  .bd-table td { display: block; padding: 7px 0; border: 0; }
  .bd-table td:not(:first-child):not(:last-child)::before { content: attr(data-label); display: block; color: var(--rc-meta); font-size: 11px; margin-bottom: 5px; }
  .bd-table td:last-child { padding-bottom: 0; }
}
@media (max-width: 600px) {
  .bd-heading { flex-direction: column; }
  .bd-tabs { padding-inline: 16px; gap: 20px; }
  .bd-tab { font-size: 13px; }
  .bd-toolbar, .bd-results { padding-inline: 16px; }
  .bd-toolbar .field { min-width: min(150px, 100%); }
  .bd-table tbody { grid-template-columns: minmax(0, 1fr); }
  .bd-section { padding: 16px; }
  .bd-section .facts { grid-template-columns: minmax(0, 1fr); }
  .business-development-page .drawer-head { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .activity-line::after { width: 100%; animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Shared workspace, controls and feedback — approved CRM refresh. */
.app-location { color: var(--rc-forest); font-size: 14px; font-weight: 500; min-width: 0; }
.rail > .app-account { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--rc-line); flex-direction: column; gap: 6px; }
.rail > .app-account .rail-user { width: 100%; }
.rail-tools { padding-top: 20px; }
.rail-tool-group { min-width: 0; }
.rail-tool-group-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--rc-nav-ink); border-radius: 6px; }
.rail-tool-group-summary::-webkit-details-marker { display: none; }
.rail-tool-group-summary::after { content: ""; width: 16px; height: 16px; flex: none; background: currentColor; mask: url("../img/icons/chevron-down.svg") center / contain no-repeat; }
.rail-tool-group[open] > .rail-tool-group-summary::after { transform: rotate(180deg); }
.rail-tool-group-summary:hover { background: var(--rc-mint); }
.rail-tool-group > .rail-tool-item { padding: 10px 12px 10px 22px; border-radius: 6px; }
.rail-tools-nav { padding-top: 0; gap: 6px; }
.count { border-color: var(--rc-line); }
.workspace { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.35fr); min-width: 0; align-items: start; gap: 24px; }
.workspace-list { min-width: 0; }
.workspace-detail { min-width: 0; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); padding: 24px; background: var(--rc-surface); }
.workspace-placeholder { padding: 48px 24px; color: var(--rc-meta); min-height: 360px; border: 1px dashed var(--rc-line-strong); border-radius: var(--rc-r-card); background: var(--rc-wash); }
.workspace-placeholder > p { margin-top: 10px; max-width: 44ch; }
.workspace:has(> .drawer:not([hidden])) > .workspace-placeholder { display: none; }
.workspace-row { color: var(--rc-body); background: var(--rc-surface); border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); cursor: pointer; }
.workspace-row:hover { background: var(--rc-wash); border-color: var(--rc-line-hover); }
.workspace-row-active, .workspace-row[aria-current="true"] { background: var(--rc-mint); border-color: var(--rc-forest); box-shadow: inset 3px 0 var(--rc-forest); }
.workspace-row:focus-visible { position: relative; outline: 2px solid var(--rc-forest); outline-offset: -2px; }
.drawer.is-docked { position: static; inset: auto; display: block; z-index: auto; width: auto; height: auto; }
.workspace > .drawer:not(.is-docked) { padding: 0; border: 0; border-radius: 0; background: transparent; }
.drawer.is-docked .drawer-scrim { display: none; }
.drawer.is-docked .drawer-panel { width: 100%; height: auto; max-height: none; box-shadow: none; border-radius: var(--rc-r-card); animation: none; overflow: hidden; }
.drawer.is-docked .drawer-head { position: static; }
.drawer.is-docked .drawer-body { overflow: visible; }
.drawer.is-docked .drawer-panel:focus { outline: none; }
.drawer .drawer-body .card { box-shadow: none; }
.drawer .drawer-body > .card + .card { border-top: 1px solid var(--rc-line); }
.detail-tabs { display: flex; flex-wrap: nowrap; gap: 20px; overflow-x: auto; border-bottom: 1px solid var(--rc-line); margin-bottom: 24px; scrollbar-width: thin; }
.detail-tab { flex: none; padding: 12px 2px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--rc-meta); cursor: pointer; white-space: nowrap; }
.detail-tab:hover { color: var(--rc-forest); }
.detail-tab[aria-selected="true"], .detail-tab[aria-pressed="true"] { color: var(--rc-ink); font-weight: 600; border-bottom-color: var(--rc-forest); }
.detail-tab-panel { min-width: 0; }
.next-action { padding: 20px; border: 1px solid var(--rc-good-line); border-radius: var(--rc-r-card); background: var(--rc-good-bg); }
.next-action .micro-label { color: var(--rc-forest); }
.section-heading { font-size: 21px; font-weight: 600; color: var(--rc-ink); line-height: 1.35; }
div.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading > h2, .section-heading > h3 { font: inherit; }
.page-actions, .form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.page-actions.row-between { justify-content: space-between; }
.form-actions { padding-top: 20px; border-top: 1px solid var(--rc-rule); }
form .form-actions { margin-top: 8px; }
.btn, .select, summary { -webkit-tap-highlight-color: transparent; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--rc-forest); width: 18px; height: 18px; flex: none; }
.select { appearance: auto; background-image: none; padding-right: 12px; }
.select option { background: var(--rc-surface); color: var(--rc-ink); font-weight: 400; }
.filter-menu > .row { max-height: min(420px, 60dvh); overflow-y: auto; }
.filter-menu > summary { min-height: 40px; }
.filter-menu > summary::after, .rail-tools-summary::after { content: ""; display: inline-block; width: 16px; height: 16px; flex: none; margin-left: 6px; background: currentColor; mask: url("../img/icons/chevron-down.svg") center / contain no-repeat; }
.filter-menu[open] > summary::after { transform: rotate(180deg); }
.msg, .banner, .toast { font-size: 14px; font-weight: 400; line-height: 1.6; }
.msg { align-items: flex-start; overflow-wrap: anywhere; }
.msg:empty { display: none; }
.msg-success::before, .msg-warn::before, .msg-danger::before, .msg-info::before { content: ""; color: inherit; margin-top: 1px; width: 20px; height: 20px; border-radius: 0; background: currentColor; mask: url("../img/icons/information-circle.svg") center / contain no-repeat; }
.msg-success::before { mask-image: url("../img/icons/check-circle.svg"); }
.msg-warn::before { mask-image: url("../img/icons/exclamation-triangle.svg"); }
.msg-danger::before { mask-image: url("../img/icons/exclamation-circle.svg"); }
.toast-host { z-index: 200; }
.confirm-dialog .modal-head h2 { font-size: 23px; font-weight: 600; }
.confirm-dialog .modal-body { color: var(--rc-body); font-size: 15px; font-weight: 400; }
.confirm-dialog .btn { min-height: 40px; font-weight: 500; }
.confirm-dialog .btn-primary, .confirm-dialog .btn-danger { font-weight: 600; }
.activity-label { top: calc(var(--rc-header-height) + 12px); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--rc-bad-dot); }
@media (min-width: 921px) {
  .rail-tools > .rail-tools-summary { display: none; }
  .rail-tools > .rail-tools-nav { display: flex; }
}
@media (max-width: 1099px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .workspace > .workspace-placeholder { display: none; }
  .workspace > .drawer { border-left: 0; padding: 0; }
}
@media (max-width: 920px) {
  :root { --rc-header-height: 58px; }
  .app-header { height: var(--rc-header-height); padding: 0 16px; gap: 12px; }
  .app-header .rail-brand { width: auto; margin-left: 0; padding: 0; border-right: 0; background: transparent; }
  .app-header .app-location { display: none; }
  .global-search { width: min(420px, 70vw); margin-left: auto; }
  .rail { top: var(--rc-header-height); padding: 8px 12px; gap: 8px; }
  .rail-nav { flex: 1 0 100%; }
  .rail > .app-account { margin: 0; padding: 0; border: 0; flex-direction: row; gap: 6px; align-items: center; }
  .rail > .app-account .rail-user { display: none; }
  .rail-tools { padding: 0; margin: 0 auto 0 0; }
  .rail-tools-nav { padding: 8px; }
  body.has-rail > .page { width: 100%; margin: 0; padding: 24px; border-radius: 0; }
}
@media (max-width: 600px) {
  h1, .title { font-size: 27px; }
  .input, .select, .textarea { font-size: 16px; min-height: 44px; }
  .btn { min-height: 42px; }
  body.has-rail > .page { padding: 20px 16px 48px; }
  .app-header .brand-product { display: none; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dd, .fact-value { font-size: 16px; }
  .detail-tabs { gap: 16px; }
  .form-actions > .btn { flex: 1 1 auto; white-space: normal; }
}
/* Home refresh: integrate after the shared workspace rules in tokens.css. */
.home-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.home-heading-meta { display: grid; justify-items: end; gap: 12px; }
.home-heading-meta p { margin: 0; }
.home-notice { display: flex; align-items: center; gap: 16px; }
.home-notice .msg { flex: 1; margin: 0; }
.home-page .home-grid { gap: 20px 24px; }
.home-page #attention-card { grid-column: 1 / -1; padding: 0; gap: 24px; border: 0; background: transparent; }
.home-task-map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.home-step { display: flex; align-items: flex-start; gap: 16px; min-width: 0; padding: 24px 20px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); }
.home-step.next-action { border-color: var(--rc-good-line); background: var(--rc-good-bg); }
.home-step-number { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--rc-mint); color: var(--rc-forest); font-size: 19px; font-weight: 600; }
.home-step-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; height: 100%; gap: 12px; }
.home-step-body .section-title { font-size: 19px; margin: 0; }
.home-step-count { font-size: clamp(38px, 4vw, 60px); font-weight: 600; line-height: 1; letter-spacing: -.03em; color: var(--rc-forest); margin: 0; }
.home-step-description { color: var(--rc-body); margin: 0; line-height: 1.6; }
.home-step-secondary { margin: 0; color: var(--rc-meta); font-size: 13px; }
.home-step-link { margin-top: auto; padding-top: 12px; color: var(--rc-forest); font-weight: 500; text-underline-offset: 4px; }
.home-step-link:hover { text-decoration-thickness: 2px; }
.home-step .btn { margin-top: auto; }
.home-step .btn, .home-step-link { white-space: normal; }
.home-priority { padding: 24px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); }
.home-priority .section-heading { align-items: flex-start; }
.home-priority-table { min-width: 0; width: 100%; }
.home-priority-table th:first-child { width: 48%; }
.home-priority-table th:last-child { width: 23%; }
.home-priority-table td { vertical-align: middle; }
.home-priority-table .row-title { font-size: 15px; font-weight: 500; }
.home-priority-waiting .age { display: block; margin-top: 4px; }
.home-queue-count { font-size: 17px; font-weight: 600; color: var(--rc-ink); }
.home-priority-urgent td:first-child { border-left: 3px solid var(--rc-amber-dot); }
.home-priority-action .btn { white-space: normal; }
.home-disclosure, .home-section { min-width: 0; padding: 22px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); }
.home-disclosure-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 20px; list-style: none; cursor: pointer; padding: 0 0 4px; }
.home-disclosure-heading::-webkit-details-marker { display: none; }
.home-disclosure-heading::after { content: "+"; margin-left: auto; font-size: 22px; color: var(--rc-meta); }
.home-disclosure[open] > .home-disclosure-heading::after { content: "−"; }
.home-disclosure-heading:hover .section-title { color: var(--rc-forest); }
.home-disclosure-heading:focus-visible { outline: 2px solid var(--rc-forest); outline-offset: 6px; }
.home-disclosure-heading .section-title { margin: 0; }
.home-disclosure-heading .hint { margin: 0; }
.home-disclosure > :not(summary) { margin-top: 16px; }
.home-page #ceo-section .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.home-page #ceo-section .kpi-grid { margin-bottom: 8px; }
.home-page #health-line { padding-top: 16px; border-top: 1px solid var(--rc-line); }
@media (max-width: 1100px) {
  .home-step { padding-inline: 12px; gap: 12px; }
  .home-step-number { flex-basis: 34px; height: 34px; font-size: 16px; }
  .home-step-body .section-title { font-size: 17px; }
}
@media (max-width: 760px) {
  .home-heading { flex-direction: column; }
  .home-heading-meta { justify-items: start; }
  .home-notice { align-items: flex-start; flex-direction: column; }
  .home-task-map { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .home-step { padding: 20px 12px; }
  .home-step-body { width: 100%; }
  .home-step-count { font-size: 38px; }
  .home-page #ceo-section .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-priority-table thead { display: none; }
  .home-priority-table tr { display: block; border-bottom: 1px solid var(--rc-line); padding: 16px 12px; }
  .home-priority-table td { display: block; border: 0; padding: 6px 0; }
  .home-priority-table .home-priority-urgent { border-left: 3px solid var(--rc-amber-dot); }
  .home-priority-table .home-priority-urgent td:first-child { border-left: 0; }
  .home-priority-waiting::before { content: attr(data-label); font-size: 13px; color: var(--rc-meta); margin-right: 10px; }
  .home-priority-waiting .age { display: inline; margin-left: 12px; }
  .home-disclosure-heading .hint { flex-basis: 100%; order: 1; }
}

/* Operational workspace: integrate after the shared refresh rules. */
.work-page .work-controls { padding: 20px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); gap: 16px; }
.work-page .work-views { gap: 8px; border-bottom: 1px solid var(--rc-line); border-radius: 0; background: none; padding: 0; }
.work-page .work-views > button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 12px 14px; white-space: nowrap; background: none; }
.work-page .work-views > button.is-active { border-bottom-color: var(--rc-forest); color: var(--rc-ink); font-weight: 600; background: none; box-shadow: none; }
.work-page .work-controls #view-description:empty { display: none; }
.work-page .work-controls #view-description { margin-top: -6px; }
.work-page .work-controls #filters { padding: 20px 0; border-bottom: 1px solid var(--rc-line); }
.work-page .work-toolbar { align-items: center; }
.work-page #refreshed { font-size: 12px; }
.work-page .work-workspace { gap: 24px; }
.work-page .work-queue { min-width: 0; }
.work-page .work-queue-count { padding: 14px 18px 14px 0; font-size: 13px; }
.work-page #work-list { display: flex; flex-direction: column; border: 0; border-radius: 0; gap: 12px; overflow: visible; }
.work-page .work-directory-row { border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); box-shadow: none; }
.work-page .work-directory-row:hover { transform: none; box-shadow: none; }
.work-page .work-directory-row:not(.row-item-selected):hover { border-color: var(--rc-line-hover); }
.work-page .work-directory-row.row-item-selected { border-color: var(--rc-forest); background: var(--rc-mint); box-shadow: inset 3px 0 var(--rc-forest); }
.work-page .work-directory-row .work-row-open { padding: 18px 16px; }
.work-page .work-directory-row .work-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; }
.work-page .work-directory-row .work-row > .stack:first-child { grid-column: 1; grid-row: 1; }
.work-page .work-directory-row .row-title { font-size: 17px; font-weight: 600; color: var(--rc-ink); text-decoration: none; line-height: 1.4; }
.work-page .work-directory-row .row-meta { font-size: 12px; }
.work-page .work-directory-row .work-client-cell { grid-column: 1; grid-row: 2; font-size: 14px; }
.work-page .work-directory-row .work-status-cell { grid-column: 2; grid-row: 1 / span 2; align-items: flex-end; max-width: 150px; }
.work-page .work-directory-row .work-row-side { grid-column: 1 / -1; grid-row: 3; flex-direction: row; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; align-items: center; text-align: left; }
.work-page .work-directory-row .work-next-cell { grid-column: 1 / -1; grid-row: 4; color: var(--rc-forest); font-size: 13px; line-height: 1.5; }
.work-page #more-row { padding: 18px; }
.work-page .work-placeholder { padding: 48px 24px; min-height: 420px; align-content: start; gap: 12px; }
.work-page #detail-drawer .drawer-title { font-size: 28px; line-height: 1.25; font-weight: 600; }
.work-page #detail-context { line-height: 1.6; font-size: 15px; }
.work-page #detail-drawer .drawer-head { align-items: flex-start; }
.work-page #detail-drawer .drawer-body { background: var(--rc-wash); }
.work-page .work-section { padding: 20px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); box-shadow: none; }
.work-page .work-section > .section-heading { margin: 0; }
.work-page .work-section + .work-section { padding-top: 20px; }
.work-page .work-action-section { gap: 10px; padding: 20px; border-color: var(--rc-good-line); background: var(--rc-good-bg); border-radius: var(--rc-r-card); }
.work-page .work-action-section .stack > .btn { align-self: flex-start; }
.work-page .work-action-section > .section-heading { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--rc-forest); }
.work-page .work-next { padding: 0; border: 0; border-radius: 0; background: none; }
.work-page .work-next .row-title { font-size: 21px; font-weight: 600; }
.work-page .work-next .hint { font-size: 14px; line-height: 1.6; }
.work-page .work-next .row { margin-top: 10px; align-items: flex-start; }
.work-page .work-next form { max-width: 100%; }
.work-page .work-disclosure { border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); padding: 0; }
.work-page .work-disclosure > summary { cursor: pointer; padding: 18px 20px; font-size: 16px; }
.work-page .work-disclosure-body { padding: 4px 16px 16px; }
.work-page .work-disclosure-body > .work-section + .work-section { margin-top: 4px; }
.work-page .work-section .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.work-page .work-section .fact { min-width: 0; overflow-wrap: anywhere; }
.work-page #detail-body > .detail-tabs { margin-top: 4px; }
.work-page #detail-body .detail-tab-panel[hidden] { display: none; }
.work-page #detail-error { margin-bottom: 16px; }
.work-page #new-body .form-actions { margin-top: 12px; }
@media (min-width: 1100px) {
  .work-page #detail-drawer.is-docked { padding: 0; }
  .work-page #detail-drawer.is-docked .drawer-head { padding: 20px 24px 16px; }
  .work-page #detail-drawer.is-docked .drawer-body { padding: 24px; border-top: 1px solid var(--rc-line); }
}
@media (max-width: 1099px) {
  .work-page .work-workspace { grid-template-columns: minmax(0, 1fr); }
  .work-page .work-placeholder { display: none; }
}
@media (max-width: 600px) {
  .work-page #detail-drawer .drawer-title { font-size: 24px; }
  .work-page .work-section .facts { grid-template-columns: minmax(0, 1fr); }
  .work-page .work-directory-row .work-status-cell { max-width: 115px; }
  .work-page .work-directory-row .work-row-open { padding: 16px 10px; }
  .work-page .work-action-section { padding: 16px; }
}

/* Clients: one quiet directory beside the selected record. Shared workspace,
   tabs, facts, forms and .is-docked drawer rules come from tokens.css. */
.clients-page .clients-directory { gap: 20px; min-width: 0; }
.clients-page .client-controls { padding: 16px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); box-shadow: none; }
.clients-page .client-controls .seg { width: 100%; gap: 0; }
.clients-page .client-controls .seg > button { padding: 10px 12px; font-size: 13px; }
.clients-page .client-toolbar #client-search { width: 100%; max-width: none; flex: none; }
.clients-page .clients-filter-actions { gap: 8px; }
.clients-page #client-list { display: flex; flex-direction: column; border: 0; border-radius: 0; overflow: visible; gap: 12px; }
.clients-page .clients-directory-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-width: 0; padding: 20px 16px; border-radius: var(--rc-r-card);
  text-align: left; font-family: var(--rc-font);
}
.clients-page .clients-row-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.clients-page .clients-avatar { width: 42px; height: 42px; font-size: 14px; font-weight: 500; }
.clients-page .clients-row-text { min-width: 0; }
.clients-page .clients-row-name { color: var(--rc-ink); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.clients-page .clients-row-meta { color: var(--rc-meta); font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }
.clients-page .clients-directory-row > .pill { flex: none; font-size: 11px; }
.clients-page .clients-detail .drawer-head .section-title { font-size: 28px; line-height: 1.3; }
.clients-page .clients-detail .drawer-body { background: var(--rc-wash); }
.clients-page .detail-tab-panel > section { padding: 20px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); }
.clients-page .clients-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.clients-page .clients-tabs > button { flex: none; white-space: nowrap; }
.clients-page .clients-detail .detail-tab-panel { min-width: 0; outline-offset: 4px; }
.clients-page .clients-detail .facts { gap: 24px; }
.clients-page .clients-detail .fact .label { font-size: 13px; font-weight: 500; color: var(--rc-meta); }
.clients-page .clients-detail .fact-value { font-size: 17px; font-weight: 600; }
.clients-page .clients-notes-value { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--rc-body); }
.clients-page .clients-editor form { padding-top: 24px; }
.clients-page .clients-editor summary { width: fit-content; }
.clients-page .clients-activity-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--rc-rule); }
.clients-page .clients-activity-row > .tnum { font-size: 13px; }
.clients-page .clients-activity-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.clients-page .clients-detail .next-action { align-items: center; }
.clients-page .clients-detail .next-action > .spacer { min-width: 200px; }
.clients-page .clients-detail .row-item { box-shadow: none; }
.clients-page .clients-detail #client-next-controls { align-items: flex-start; }
.clients-page .clients-detail .clients-form-error { margin: 0; }
.clients-page .clients-create { padding: 24px; }
@media (min-width: 1100px) {
  .clients-page .clients-directory { padding-right: 0; }
  .clients-page .clients-detail.is-docked { padding: 0; }
  .clients-page .clients-detail.is-docked .drawer-head { position: static; padding: 24px; border-bottom: 0; }
  .clients-page .clients-detail.is-docked .drawer-body { padding: 24px; border-top: 1px solid var(--rc-line); }
}
@media (max-width: 600px) {
  .clients-page .clients-detail .drawer-head .section-title { font-size: 23px; }
  .clients-page .clients-activity-row { grid-template-columns: 1fr; gap: 6px; }
  .clients-page .clients-directory-row { padding-inline: 0; }
  .clients-page .clients-avatar { width: 36px; height: 36px; }
}

/* Calendar proposal: integrate after the existing calendar component rules. */
.sched-week-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding-top: 8px; }
.sched-week-range { font-size: 21px; line-height: 1.4; font-weight: 600; color: var(--rc-ink); }
.sched-workspace { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 24px; }
.sched-workspace > * { min-width: 0; }
.sched-page .sched-panel { --rc-sched-line: var(--rc-line); border-radius: var(--rc-r-input); }
.sched-page .sched-toolbar { padding: 12px 16px; }
.sched-page .sched-table { min-width: 840px; }
.sched-page .sched-table th.sched-who { width: 140px; border-right-width: 1px; }
.sched-page .sched-table thead th { height: 108px; padding: 16px 12px; border-bottom-width: 1px; }
.sched-page .sched-table tbody th.sched-who { background: var(--rc-surface); font-size: 15px; font-weight: 600; padding: 20px 12px; }
.sched-page .sched-weekday { font-size: 13px; font-weight: 400; }
.sched-page .sched-date { font-size: 26px; font-weight: 600; margin-top: 4px; }
.sched-page .sched-today-label { position: static; display: inline-block; margin-top: 6px; }
.sched-page .sched-day { min-height: 142px; padding: 10px 8px; }
.sched-page .sched-day:disabled { cursor: wait; }
.sched-page .sched-chip { border: 0; border-left: 2px solid var(--rc-blue-dot); padding: 10px 8px; gap: 6px; }
.sched-page .sched-chip-confirmed { border-left-color: var(--rc-good-dot); }
.sched-page .sched-chip-off { border-left-color: var(--rc-amber-dot); }
.sched-page .sched-chip-avail { border-left-color: var(--rc-idle-dot); }
.sched-page .sched-chip-external { border: 1px dashed var(--rc-line-hover); }
.sched-page .sched-chip-title { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sched-page .sched-src { margin-top: 5px; font-weight: 500; }
.sched-detail { border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); padding: 24px; background: var(--rc-surface); }
.sched-detail-body { gap: 24px; }
.sched-detail-date { color: var(--rc-meta); font-size: 14px; line-height: 1.6; }
.sched-person { font-size: 28px; line-height: 1.3; font-weight: 600; color: var(--rc-ink); overflow-wrap: anywhere; }
.sched-section { gap: 16px; }
.sched-section-title { font-size: 18px; line-height: 1.4; font-weight: 600; color: var(--rc-ink); }
.sched-assignment + .sched-assignment { border-top: 1px solid var(--rc-line); padding-top: 20px; }
.sched-facts { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.sched-form { gap: 12px; }
.sched-form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.sched-field { min-width: 0; gap: 6px; }
.sched-field-wide { grid-column: 1 / -1; }
.sched-field .input, .sched-field .select { min-width: 0; width: 100%; }
.sched-imports { border-top: 1px solid var(--rc-line); padding-top: 24px; }
.sched-placeholder { min-height: 180px; padding: 0; text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; }
@media (min-width: 1440px) {
  .sched-workspace { grid-template-columns: minmax(0, 1fr) 320px; }
  .sched-detail { padding: 20px; }
}
@media (min-width: 1600px) {
  .sched-workspace { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 640px) {
  .sched-week-controls > .row { flex-wrap: wrap; }
  .sched-week-range { order: -1; flex-basis: 100%; }
  .sched-person { font-size: 24px; }
}

/* Final consistency checks across Home and all native feedback. */
.home-priority-table .row-title { font-size: 16px; font-weight: 600; }
.home-disclosure-heading::after { content: ""; width: 20px; height: 20px; flex: none; background: currentColor; mask: url("../img/icons/chevron-down.svg") center / contain no-repeat; }
.home-disclosure[open] > .home-disclosure-heading::after { content: ""; transform: rotate(180deg); }
.page-failure { justify-content: space-between; flex-wrap: wrap; }
.page-failure > p { flex: 1 1 260px; }
/* Contracts: compact directory and real agreement workspace. */
.contracts-page .contracts-workspace { margin-top: 8px; }
.contracts-page .contracts-list { padding-right: 0; }
.contracts-page .contracts-toolbar { padding: 16px; margin-bottom: 16px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); gap: 14px; }
.contracts-page #list { display: flex; flex-direction: column; gap: 12px; }
.contracts-page .contracts-toolbar .input,
.contracts-page .contracts-toolbar .select { width: 100%; min-width: 0; max-width: none; }
.contracts-page .contracts-list-item { min-width: 0; }
.contracts-page .contracts-row { display: flex; flex-direction: column; align-items: stretch; gap: 7px; width: 100%; min-width: 0; padding: 20px 16px; text-align: left; font-family: var(--rc-font); }
.contracts-page .contracts-row-heading { align-items: flex-start; gap: 10px; }
.contracts-page .contracts-row-heading > .pill { flex: none; font-size: 11px; }
.contracts-page .contracts-row-title { flex: 1 1 160px; color: var(--rc-ink); font-size: 16px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.contracts-page .contracts-row-client { color: var(--rc-body); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.contracts-page .contracts-row > .hint { font-size: 13px; }
.contracts-page .contracts-detail { padding: 24px; min-height: 540px; }
.contracts-page .contracts-detail-content { gap: 24px; }
.contracts-page .contracts-detail-content > .row { align-items: flex-start; }
.contracts-page .contracts-detail-title { color: var(--rc-ink); font-size: 28px; line-height: 1.3; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.contracts-page .contracts-client-link { width: fit-content; color: var(--rc-body); font-size: 16px; text-decoration: none; }
.contracts-page .contracts-client-link:hover { color: var(--rc-forest); text-decoration: underline; }
.contracts-page .contracts-next-action > .stack { flex: 1 1 260px; }
.contracts-page .contracts-next-action > .btn { flex: none; }
.contracts-page .contracts-next-action .hint { font-size: 14px; line-height: 1.6; }
.contracts-page .detail-tabs { margin: 0; gap: 20px; }
.contracts-page .contracts-panel { gap: 24px; padding: 20px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-wash); outline-offset: 4px; }
.contracts-page .contracts-panel[hidden] { display: none; }
.contracts-page .contracts-panel .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.contracts-page .contracts-panel .fact { min-width: 0; }
.contracts-page .contracts-panel .fact > .label { font-size: 13px; font-weight: 500; color: var(--rc-meta); }
.contracts-page .contracts-panel .fact-value { font-size: 17px; font-weight: 600; }
.contracts-page .contracts-panel .section-title { font-size: 21px; }
.contracts-page .contracts-panel details > summary { width: fit-content; cursor: pointer; }
.contracts-page .contracts-panel details[open] > summary { margin-bottom: 16px; }
.contracts-page .contracts-history-item { padding: 18px 0; border-bottom: 1px solid var(--rc-rule); }
.contracts-page .contracts-history-item:first-of-type { padding-top: 8px; }
.contracts-page .contracts-history-item > p { white-space: pre-wrap; overflow-wrap: anywhere; }
.contracts-page .contracts-document-row { padding: 16px 0; border-bottom: 1px solid var(--rc-rule); }
.contracts-page .contracts-create { padding: 24px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); }
.contracts-page .contracts-create > .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.contracts-page .contracts-create #c-days { gap: 8px; }
.contracts-page .contracts-create #c-sites > label { min-height: 40px; }
.contracts-page .contracts-create #connecteam-date-picker { padding: 16px 0; border-top: 1px solid var(--rc-line); border-bottom: 1px solid var(--rc-line); }
.contracts-page .contracts-create #connecteam-date-picker > summary { cursor: pointer; font-weight: 500; }
.contracts-page .contracts-create #connecteam-date-picker[open] > summary { margin-bottom: 12px; }
.contracts-page #retry-load { margin-top: 12px; }
@media (max-width: 1099px) {
  .contracts-page .contracts-workspace { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .contracts-page .contracts-list { padding-right: 0; }
  .contracts-page #list { max-height: 420px; overflow-y: auto; }
  .contracts-page .contracts-detail { padding: 24px; min-height: 0; }
}
@media (max-width: 600px) {
  .contracts-page .contracts-detail-title { font-size: 24px; }
  .contracts-page .contracts-panel .facts,
  .contracts-page .contracts-create > .facts { grid-template-columns: minmax(0, 1fr); }
  .contracts-page .contracts-row { padding-inline: 12px; }
  .contracts-page .contracts-row-title { flex-basis: 160px; }
  .contracts-page .contracts-next-action { padding: 16px; }
}

/* Integrate into tokens.css after the shared workspace rules. */
.settings-page .settings-workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 28px; }
.settings-categories { display: flex; flex-direction: column; gap: 6px; }
.settings-category { width: 100%; padding: 13px 16px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); color: var(--rc-body); text-align: left; cursor: pointer; line-height: 1.5; }
.settings-category:hover { background: var(--rc-wash); }
.settings-category[aria-pressed="true"] { background: var(--rc-mint); border-color: var(--rc-forest); box-shadow: inset 3px 0 var(--rc-forest); color: var(--rc-pine); font-weight: 600; }
.settings-detail { min-width: 0; padding: 24px; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); background: var(--rc-surface); }
.settings-page .settings-detail .section-title { font-size: 25px; }
.settings-page .settings-detail .subtitle { font-size: 16px; }
.settings-page .settings-preferences-group { min-width: 0; border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); padding: 0; }
.settings-group-title { float: left; width: 100%; padding: 14px 20px; background: var(--rc-wash); color: var(--rc-ink); font-size: 16px; font-weight: 600; border-radius: var(--rc-r-card) var(--rc-r-card) 0 0; }
.settings-group-title + .settings-preference-row { clear: both; }
.settings-preference-row { padding: 18px 20px; border-top: 1px solid var(--rc-rule); gap: 20px; }
.settings-preference-label { display: flex; align-items: flex-start; gap: 16px; cursor: pointer; }
.settings-preference-label > input { width: 20px; height: 20px; margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--rc-primary-bg); }
.settings-preference-copy { display: flex; flex-direction: column; gap: 5px; }
.settings-preference-name { color: var(--rc-ink); font-size: 16px; font-weight: 600; line-height: 1.5; }
.settings-preference-copy .hint { line-height: 1.5; }
.settings-preference-moves { flex-shrink: 0; gap: 8px; }
.settings-preference-moves .btn { min-width: 94px; }
.settings-preference-disclosure { border: 1px solid var(--rc-line); border-radius: var(--rc-r-card); }
.settings-group-summary { padding: 18px 20px; color: var(--rc-ink); font-size: 16px; font-weight: 600; cursor: pointer; }
.settings-preference-disclosure > .settings-preferences-group { border: 0; border-radius: 0; }
.settings-preference-disclosure .settings-group-title { font-size: 14px; }
.settings-preference-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding-top: 18px; border-top: 1px solid var(--rc-line); }
.settings-preference-actions .settings-reset { margin-right: auto; color: var(--rc-forest); text-decoration: underline; }
.settings-destinations { border-top: 1px solid var(--rc-line); }
.settings-destination { display: flex; flex-direction: column; gap: 5px; padding: 22px 0; border-bottom: 1px solid var(--rc-line); }
.settings-destination:hover .settings-destination-title { text-decoration: underline; }
.settings-destination-title { font-size: 17px; font-weight: 600; }

/* Live walkthrough: part of the real page, with no modal or scrim. */
.rail-foot .app-guide-launch { justify-content: flex-start; width: 100%; padding: 10px 12px; border: 1px solid var(--rc-line-strong); background: var(--rc-surface); color: var(--rc-forest); font-weight: 600; }
.crm-tour { position: sticky; top: var(--rc-header-height); z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 18px 20px; margin: 0 0 24px; border: 1px solid var(--rc-primary-hover); border-left: 6px solid var(--rc-guide-accent); border-radius: 8px; background: var(--rc-primary-hover); color: var(--rc-on-dark); box-shadow: var(--rc-pop); }
.crm-tour-copy { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.crm-tour-copy > .row { gap: 12px; flex-wrap: wrap; }
.crm-tour-label { font-size: 12px; font-weight: 700; color: var(--rc-guide-accent); text-transform: uppercase; letter-spacing: .06em; }
.crm-tour-position { font-size: 12px; font-weight: 600; color: var(--rc-on-dark); padding: 3px 9px; border: 1px solid var(--rc-white-35); border-radius: 4px; }
.crm-tour-title { font-size: 20px; line-height: 1.35; font-weight: 700; color: var(--rc-on-dark); }
.crm-tour-instruction { font-size: 15px; line-height: 1.65; color: var(--rc-on-dark); }
.crm-tour-copy .hint { font-size: 12px; line-height: 1.5; color: var(--rc-on-pine-dim); }
.crm-tour-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.crm-tour-controls .btn { min-height: 44px; background: var(--rc-white-12); border-color: var(--rc-white-35); color: var(--rc-on-dark); }
.crm-tour-controls .btn:hover:not(:disabled) { background: var(--rc-white-35); border-color: var(--rc-on-dark); color: var(--rc-on-dark); }
.crm-tour-controls .btn-primary:not(:disabled) { background: var(--rc-guide-accent); border-color: var(--rc-guide-accent); color: var(--rc-ink); font-weight: 700; }
.crm-tour-controls .btn-primary:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--rc-on-dark); }
.crm-tour-controls .btn-ghost { background: transparent; border-color: transparent; text-decoration: underline; }
.crm-tour-controls .btn:disabled { background: var(--rc-white-12); border-color: var(--rc-white-12); color: var(--rc-white-35); box-shadow: none; cursor: not-allowed; }
.crm-tour-target { outline: 2px solid var(--rc-guide-edge) !important; outline-offset: -2px; box-shadow: inset 0 0 0 3px var(--rc-guide-accent) !important; scroll-margin-top: calc(var(--rc-header-height) + var(--crm-tour-height, 180px) + 56px); scroll-margin-bottom: 56px; }
.crm-tour-pointer { position: fixed; inset: 0; z-index: 170; pointer-events: none; }
.crm-tour-frame { position: absolute; border: 4px solid var(--rc-guide-edge); border-radius: 9px; box-shadow: 0 0 0 3px var(--rc-guide-accent), 0 0 0 7px var(--rc-surface), var(--rc-pop); }
.crm-tour-marker { position: absolute; display: flex; align-items: center; justify-content: center; background: var(--rc-guide-accent); color: var(--rc-ink); border: 2px solid var(--rc-guide-edge); border-radius: 6px; box-shadow: 0 0 0 3px var(--rc-surface), var(--rc-lift); font-size: 13px; font-weight: 700; white-space: nowrap; }
.crm-tour-marker::after { content: ''; position: absolute; width: 0; height: 0; border: 8px solid transparent; }
.crm-tour-marker[data-side="above"]::after { top: 100%; left: calc(50% - 8px); border-bottom: 0; border-top-color: var(--rc-guide-edge); }
.crm-tour-marker[data-side="below"]::after { bottom: 100%; left: calc(50% - 8px); border-top: 0; border-bottom-color: var(--rc-guide-edge); }
.crm-tour-marker[data-side="left"]::after { left: 100%; top: calc(50% - 8px); border-right: 0; border-left-color: var(--rc-guide-edge); }
.crm-tour-marker[data-side="right"]::after { right: 100%; top: calc(50% - 8px); border-left: 0; border-right-color: var(--rc-guide-edge); }
.drawer-panel > .crm-tour { position: static; flex-shrink: 0; margin: 0; padding: 12px 18px; }
.drawer-panel > .crm-tour .crm-tour-controls { max-width: 210px; }
.crm-tour:not([hidden]) + .drawer-body { min-height: 0; }
.crm-tour:not([hidden]) + .drawer-body > * { flex-shrink: 0; }
.crm-tour-link { font-size: 14px; font-weight: 600; color: var(--rc-guide-accent); text-decoration: underline; width: fit-content; }
@media (max-width: 900px) {
  .crm-tour { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; }
  .crm-tour-controls { max-width: none; justify-content: flex-start; }
  .drawer-panel > .crm-tour .crm-tour-controls { max-width: none; }
}
@media (max-width: 1100px) {
  .settings-page .settings-workspace { grid-template-columns: 210px minmax(0, 1fr); gap: 18px; }
  .settings-detail { padding: 20px; }
  .settings-preference-row { flex-wrap: wrap; }
  .settings-preference-row > label { flex-basis: 100%; }
  .settings-preference-moves { margin-left: 36px; }
}
@media (max-width: 760px) {
  .settings-page .settings-workspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .settings-categories { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .settings-category { width: auto; padding: 10px 12px; }
  .settings-detail { padding: 20px 16px; }
  .settings-preference-row { padding: 16px; }
  .settings-preference-actions .settings-reset { flex-basis: 100%; text-align: left; }
}
