/* ============================================================================
   ProveWise — design system (v3 / Pharma Consultant Redesign)
   One canonical token system for both light (default) and dark themes.
   Components MUST read CSS custom properties — never hard-code colour — so
   a single attribute swap [data-theme] repaints the whole app instantly.
   Source of truth: design_handoff_edms/README.md.
   ============================================================================ */

/* ── LIGHT (default) ────────────────────────────────────────────────────── */
:root,
:root[data-theme="light"] {
  /* App canvas */
  --bg-0: #F4F7FC;
  --bg-1: #EAF1FB;
  --surface:   #FFFFFF;     /* cards, panels */
  --surface-2: #FBFDFF;     /* insets, rails */

  /* Glass (top bar, palette, overlays) */
  --glass:     rgba(255, 255, 255, 0.78);
  --glass-brd: rgba(207, 220, 239, 0.70);

  /* Hairlines */
  --hair:   #E2EAF6;
  --hair-2: #CFDCEF;

  /* Text */
  --t1: #0F2744;   /* primary */
  --t2: #4A5A75;   /* secondary */
  --t3: #8696B0;   /* tertiary */

  /* Primary (clinical blue) */
  --primary:       #4A90E2;
  --primary-hover: #2F75CC;
  --primary-soft:  #CBDDFB;
  --primary-tint:  rgba(74, 144, 226, 0.10);
  --navy:          #0F2744;

  /* Status (used for documents AND change requests) */
  --st-draft:     #94A3B8;
  --st-pending:   #E5A100;
  --st-review:    #0E8C9B;
  --st-approved:  #1B5AE2;
  --st-effective: #2C7A4B;
  --st-archived:  #6B7A93;
  --st-rejected:  #E5503C;
  --st-hold:      #8B5CF6;

  /* Semantic */
  --success: #2C7A4B;
  --warning: #E5A100;
  --danger:  #E5503C;
  --info:    #0E8C9B;

  /* Hero (navy with aerial wash) */
  --hero-0:     #0F2744;
  --hero-1:     #1B3A66;
  --hero-ink:   #EAF2FF;
  --hero-ink-2: #A9C2E6;
  --hero-wash:  rgba(74, 144, 226, 0.50);
  --dot:        rgba(15, 39, 68, 0.05);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 39, 68, 0.05), 0 1px 2px rgba(15, 39, 68, 0.04);
  --shadow-md: 0 6px 18px rgba(15, 39, 68, 0.09), 0 2px 6px rgba(15, 39, 68, 0.05);
  --shadow-lg: 0 22px 60px rgba(15, 39, 68, 0.16), 0 6px 16px rgba(15, 39, 68, 0.08);
  --shadow-glow: 0 0 0 3px rgba(74, 144, 226, 0.16);

  /* Glass blur (shared) */
  --glass-blur: blur(14px) saturate(140%);
}

/* ── DARK (selectable) ──────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  --bg-0: #0A1428;
  --bg-1: #0E1B38;
  --surface:   #122144;
  --surface-2: #16264C;

  --glass:     rgba(18, 33, 68, 0.62);
  --glass-brd: rgba(143, 165, 207, 0.26);

  --hair:   rgba(143, 165, 207, 0.16);
  --hair-2: rgba(143, 165, 207, 0.26);

  --t1: #F4F8FF;
  --t2: #A9B8D6;
  --t3: #8FA5CF;

  --primary:       #4A90E2;
  --primary-hover: #6BA6E8;
  --primary-soft:  rgba(74, 144, 226, 0.24);
  --primary-tint:  rgba(74, 144, 226, 0.16);
  --navy:          #0A1428;

  --st-draft:     #9FB0C6;
  --st-pending:   #F0B62E;
  --st-review:    #19A7B8;
  --st-approved:  #6B9BF2;
  --st-effective: #46A877;
  --st-archived:  #9AAAC2;
  --st-rejected:  #F47A66;
  --st-hold:      #AC92F7;

  --success: #46A877;
  --warning: #F0B62E;
  --danger:  #F47A66;
  --info:    #19A7B8;

  --hero-0:     #0C1A38;
  --hero-1:     #17305C;
  --hero-ink:   #F4F8FF;
  --hero-ink-2: #A9C2E6;
  --hero-wash:  rgba(74, 144, 226, 0.34);
  --dot:        rgba(143, 165, 207, 0.07);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.58);
  --shadow-glow: 0 0 0 3px rgba(74, 144, 226, 0.28);
}

/* ── Shape / motion (theme-independent) ─────────────────────────────────── */
:root {
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ── Backwards-compatibility aliases ─────────────────────────────────────
   Existing CSS across ~3000 lines uses these older names. Map them to the
   new canonical tokens so a single token swap repaints the whole app and
   we do not have to rewrite every component in this phase. */
:root,
:root[data-theme="light"],
:root[data-theme="dark"] {
  --bg:           var(--bg-0);
  --surface-alt:  var(--surface-2);
  --border:       var(--hair);
  --border-soft:  var(--hair-2);
  --border-hover: var(--hair-2);
  --text:         var(--t1);
  --text-muted:   var(--t2);
  --text-subtle:  var(--t3);
  --deep-navy:    var(--navy);
  --clinical-blue: var(--primary);
  --pharma-tint:  var(--primary-soft);
  --primary-softer: var(--primary-tint);
  --glass-bg:     var(--glass);
  --glass-border: var(--glass-brd);
  --card:         var(--surface);
  --muted:        var(--t2);
  --ok:           var(--success);
  --warn:         var(--warning);
  --shadow-xs: var(--shadow-sm);

  /* Blue ramp aliases — older components still reference these. */
  --blue-50:  var(--primary-tint);
  --blue-100: var(--primary-soft);
  --blue-200: var(--primary-soft);
  --blue-300: var(--primary);
  --blue-400: var(--primary);
  --blue-500: var(--primary);
  --blue-600: var(--primary-hover);
  --blue-700: var(--navy);
  --blue-800: var(--navy);
  --blue-900: var(--navy);

  --slate-50:  var(--surface-2);
  --slate-100: var(--bg-1);
  --slate-200: var(--hair);
  --slate-300: var(--hair-2);
  --slate-400: var(--t3);
  --slate-500: var(--t2);
  --slate-600: var(--t2);
  --slate-700: var(--t1);
  --slate-800: var(--t1);
  --slate-900: var(--t1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--t1);
  font: 14px/1.55 "IBM Plex Sans", "Inter", -apple-system, BlinkMacSystemFont,
        "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Inspection-grade ambient background — gradient from --bg-0 to --bg-1 with
   a soft primary wash in one corner and a faint clinical tint in the other.
   Token-driven so the same recipe works in both themes. */
body {
  background-image:
    radial-gradient(circle at -10% -10%, var(--primary-tint) 0px, transparent 520px),
    radial-gradient(circle at 110% -10%, var(--primary-soft) 0px, transparent 600px),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 380px);
  min-height: 100vh;
}

/* Mono machine fields — document numbers, versions, hash digests, UTC
   timestamps, uppercase micro-labels. Never translated. */
.mono, code, .doc-num, .hash-chip, .utc {
  font-family: "IBM Plex Mono", "SF Mono", "Menlo", "Consolas",
               "Liberation Mono", monospace;
}

/* Premium typography — tight, executive. */
h1, h2, h3, h4 {
  font-family: "IBM Plex Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--t1);
}
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 18px; line-height: 1.3; }
h3 { font-size: 15px; line-height: 1.35; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.12s ease;
}
a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

code {
  font: 12px/1.4 "IBM Plex Mono", "SF Mono", "Menlo", "Consolas",
        "Liberation Mono", monospace;
  background: var(--primary-tint);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
code.hash {
  background: transparent;
  color: var(--t2);
  font-weight: 400;
}

/* ──────────────────────────────────────────────────────────────────────────
   Topbar
   ────────────────────────────────────────────────────────────────────────── */
/* Glassmorphic enterprise topbar — sticky and translucent over the gradient
   so the brand colour shows through softly. */
.topbar {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 rgba(15, 39, 68, 0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar .brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "IBM Plex Sans", "Inter", sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--t1);
  letter-spacing: -0.02em;
}
.topbar .brand a::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(135deg, var(--clinical-blue) 0%, var(--blue-700) 100%);
  box-shadow: 0 4px 10px rgba(74, 144, 226, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar nav a {
  color: var(--slate-700);
  font-weight: 500;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease, color 0.12s ease;
}
.topbar nav a:hover {
  background: var(--primary-softer);
  color: var(--primary);
  text-decoration: none;
}
.user-chip {
  color: var(--text-muted);
  font-size: 13px;
}
.topbar-search {
  display: flex;
  margin: 0 6px 0 0;
}
.topbar-search input {
  width: 240px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, width 0.16s ease;
}
.topbar-search input::placeholder { color: var(--text-subtle); }
.topbar-search input:focus {
  outline: none;
  width: 320px;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}

.search-form { max-width: 720px; }
.matched-pill {
  display: inline-block;
  padding: 2px 9px;
  background: var(--primary-softer);
  color: var(--blue-700);
  border: 1px solid var(--blue-200);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.matched-number { background: #fdf4ff; color: #86198f; border-color: #f5d0fe; }
.matched-title { background: var(--primary-softer); color: var(--blue-700); border-color: var(--blue-200); }
.matched-filename { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }
.matched-type { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.matched-owner { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.matched-body { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-200); }

.body-snippet {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--bg);
  border-left: 3px solid var(--blue-300);
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.body-snippet mark {
  background: var(--blue-100);
  color: var(--blue-800);
  font-weight: 600;
  padding: 0 2px;
  border-radius: 3px;
}
/* Tenant badge — multi-tenant visibility requirement (README guardrail).
   Always visible in the top bar; shows which client tenant the user is
   acting inside. Mono + uppercase + leading dot reads as a "you are here"
   signal, not decorative. */
.tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-tint);
  color: var(--navy);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 10.5px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
}
:root[data-theme="dark"] .tenant-chip { color: var(--t1); }
.tenant-chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

/* ──────────────────────────────────────────────────────────────────────────
   Layout
   ────────────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 28px;
}
/* Three-pane docs layout — push the container almost flush with the viewport
   edges so the folders sidebar hugs the left, the recent-docs sidebar hugs
   the right, and the central documents table gets the maximum horizontal
   space. URS-301 (Information density on /documents). */
.container:has(.docs-layout) {
  max-width: min(100% - 24px, 1880px);
  padding: 0 12px;
}
.footer {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 24px 40px;
  font-size: 12px;
}

/* ──────────────────────────────────────────────────────────────────────────
   Cards
   ────────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue-200);
}
.card.narrow { max-width: 480px; }
.card.elevated { box-shadow: var(--shadow-md); }
.card.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-color: var(--glass-border);
}

/* ──────────────────────────────────────────────────────────────────────────
   Typography & helpers
   ────────────────────────────────────────────────────────────────────────── */
h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 8px 0;
  color: var(--slate-900);
}
h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 14px;
  color: var(--slate-800);
}
.row { display: flex; align-items: center; gap: 16px; }
.row.split { justify-content: space-between; flex-wrap: wrap; }
/* On a phone a `.row` of four or five controls cannot fit, and the default
   `nowrap` pushed the whole PAGE wider than the viewport rather than the row
   itself — /audit scrolled sideways at 375px because of its Apply / Clear /
   Export CSV / Export PDF group. `.row.split` already wrapped; this is the
   same fix for the plain variant, scoped to small screens so desktop layout
   is untouched. */
@media (max-width: 720px) {
  .row { flex-wrap: wrap; }
}
.meta {
  display: flex;
  gap: 18px;
  color: var(--text-muted);
  margin-top: 6px;
  flex-wrap: wrap;
  font-size: 13px;
}
.meta strong { color: var(--text); font-weight: 600; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }

/* ──────────────────────────────────────────────────────────────────────────
   Buttons
   ────────────────────────────────────────────────────────────────────────── */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 500;
  background: var(--surface);
  color: var(--slate-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.14s ease;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}
button:hover,
.button:hover {
  background: var(--primary-softer);
  border-color: var(--blue-300);
  color: var(--primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
button.primary,
.button.primary {
  background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
  color: #fff;
  border-color: var(--blue-500);
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
button.primary:hover,
.button.primary:hover {
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  border-color: var(--blue-600);
  color: #fff;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}
button.link {
  background: transparent;
  border: 0;
  color: var(--primary);
  padding: 0;
  cursor: pointer;
  box-shadow: none;
}
button.link:hover {
  background: transparent;
  text-decoration: underline;
  box-shadow: none;
}
.button.small {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}
form.inline { display: inline; margin: 0; }

/* ──────────────────────────────────────────────────────────────────────────
   Forms
   ────────────────────────────────────────────────────────────────────────── */
form.stacked label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-700);
}
form.stacked input,
form.stacked select,
form.stacked textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 5px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
form.stacked input:focus,
form.stacked select:focus,
form.stacked textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
form.stacked input::placeholder {
  color: var(--text-subtle);
}

/* ──────────────────────────────────────────────────────────────────────────
   Tables
   ────────────────────────────────────────────────────────────────────────── */
.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data thead { background: var(--primary-softer); }
.data th,
.data td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: var(--primary-softer); }
.data th {
  font-weight: 600;
  color: var(--blue-700);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--blue-200);
}
.data.small th,
.data.small td {
  padding: 8px 12px;
  font-size: 12px;
}

/* ──────────────────────────────────────────────────────────────────────────
   Status & priority pills — v3 design-system recipe
   Each pill class sets --pill-c to a status token; the recipe below uses
   color-mix() to derive a 14% background, ~65% text colour, and a 32% border
   so contrast lands AA in both light and dark themes. A 6px coloured dot
   carries the signal independent of colour. Add aria-label="Status: …" on
   the element for SR users.
   ────────────────────────────────────────────────────────────────────────── */
.status {
  --pill-c: var(--t2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-full);
  font: 500 11.5px "IBM Plex Sans", sans-serif;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  background: color-mix(in srgb, var(--pill-c) 14%, transparent);
  color: color-mix(in srgb, var(--pill-c) 66%, var(--t1));
  border: 1px solid color-mix(in srgb, var(--pill-c) 32%, transparent);
  vertical-align: middle;
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pill-c);
  flex-shrink: 0;
}

/* Document statuses */
.status-draft     { --pill-c: var(--st-pending); }
.status-in_review { --pill-c: var(--st-review); }
.status-approved  { --pill-c: var(--st-approved); }
.status-effective { --pill-c: var(--st-effective); }
.status-obsolete  { --pill-c: var(--st-archived); }
.status-archived  { --pill-c: var(--st-archived); }

/* DCR statuses (workflow states) */
.status-submitted     { --pill-c: var(--st-review); }
.status-under-review  { --pill-c: var(--st-review); }
.status-rejected      { --pill-c: var(--st-rejected); }
.status-on-hold       { --pill-c: var(--st-hold); }
.status-implemented   { --pill-c: var(--st-approved); }
.status-verified      { --pill-c: var(--st-effective); }
.status-closed        { --pill-c: var(--st-archived); }

/* DCR priority — same recipe, semantic colours */
.status-priority-low    { --pill-c: var(--st-archived); }
.status-priority-normal { --pill-c: var(--info); }
.status-priority-high   { --pill-c: var(--warning); }
.status-priority-urgent { --pill-c: var(--danger); }

.pill {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.03em;
}
/* ──────────────────────────────────────────────────────────────────────────
   Inline document preview on the doc-detail page
   ────────────────────────────────────────────────────────────────────────── */
.doc-preview-card { position: relative; }
.doc-preview {
  position: relative;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  max-height: 70vh;
  overflow: auto;
}
.doc-preview-text {
  margin: 0;
  padding: 22px 26px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font: 13px/1.6 "SF Mono", Menlo, Consolas, monospace;
  color: var(--slate-900);
  background: var(--bg);
}
.doc-preview-docx {
  padding: 28px 44px;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--slate-900);
}
.doc-preview-docx h1, .doc-preview-docx h2, .doc-preview-docx h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--blue-700);
  margin: 1.2em 0 0.4em;
  font-weight: 600;
}
.doc-preview-docx h1 { font-size: 22px; }
.doc-preview-docx h2 { font-size: 18px; }
.doc-preview-docx h3 { font-size: 16px; }
.doc-preview-docx p { margin: 0 0 0.9em; }
.doc-preview-docx table {
  border-collapse: collapse; margin: 0.9em 0;
}
.doc-preview-docx table td, .doc-preview-docx table th {
  border: 1px solid var(--border); padding: 7px 11px;
}
.doc-preview-frame {
  display: block;
  width: 100%;
  height: 70vh;
  border: 0;
}
.doc-preview-image-wrap {
  display: flex;
  justify-content: center;
  padding: 18px;
}
.doc-preview-image {
  max-width: 100%;
  height: auto;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
}
.doc-preview-fallback {
  padding: 36px 24px;
  text-align: center;
  font-size: 13px;
}

/* Selection-to-quote carve-out: even when the tenant has copy-protection
   on, the preview surface itself must allow text-selection so the
   approver can highlight a span and quote it into a correction. The
   `.copy-protected` JS still blocks copy/cut/dragstart/contextmenu, so
   selecting doesn't let content out via the clipboard — it only enables
   the in-page "Quote in correction" shortcut. */
.copy-protected .doc-preview,
.copy-protected .doc-preview * {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Floating action that appears above a selection inside the preview. */
.quote-action-btn {
  position: absolute;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--blue-700);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
  letter-spacing: 0.02em;
}
.quote-action-btn:hover { background: var(--blue-700); transform: translateY(-1px); }
.quote-action-btn:active { transform: translateY(0); }

/* ──────────────────────────────────────────────────────────────────────────
   Three-pane documents layout
   ────────────────────────────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  /* Narrow sidebars + a wider middle. The left & right tracks hug the
     viewport edges (the parent .container only adds 12px of inset). */
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 1280px) {
  .docs-layout {
    grid-template-columns: 200px minmax(0, 1fr) 200px;
    gap: 12px;
  }
}
@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    gap: 10px;
  }
}
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: 1fr; }
}
.docs-main {
  min-width: 0;  /* let tables shrink instead of overflowing the grid track */
}
.docs-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  position: sticky;
  top: 78px;            /* clear the topbar */
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 13px;
}
.sidebar-section + .sidebar-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sidebar-heading {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-600);
}

/* Folder tree */
.ft-list { list-style: none; padding: 0; margin: 0; }
.ft-root { margin: 0; }
.ft-item { padding: 0; margin: 0; }
.ft-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--slate-900);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
}
.ft-link:hover { background: var(--primary-softer); }
.ft-active > .ft-link,
.ft-active > .ft-disclosure > summary > .ft-link {
  background: var(--primary-soft);
  font-weight: 600;
  color: var(--blue-700);
}
.ft-disclosure { padding-left: 0; }
.ft-disclosure > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.ft-disclosure > summary::-webkit-details-marker { display: none; }
.ft-twisty {
  display: inline-block;
  width: 14px;
  text-align: center;
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 700;
}
.ft-twisty-blank { color: transparent; }
.ft-twisty-root { color: var(--blue-700); }

/* ── Classic [+] / [−] square boxes for collapsible folders (URS-316).
   The macro emits a text glyph (▸) inside .ft-twisty; we hide it and
   draw a 12px bordered box via ::before. Closed → "+", open → "−".
   Leaf folders use .ft-twisty-blank (no box). Root home uses
   .ft-twisty-root (kept as the ⌂ glyph). ─────────────────────────────── */
.ft-disclosure > summary > .ft-twisty {
  position: relative;
  width: 14px; height: 14px;
  font-size: 0;                /* hide the original text glyph */
  color: transparent;
  transition: none;
  transform: none !important;  /* override any inherited rotation */
}
.ft-disclosure > summary > .ft-twisty::before {
  content: "+";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 11px; height: 11px;
  display: grid; place-items: center;
  border: 1px solid var(--slate-400, #94a3b8);
  border-radius: 2px;
  background: var(--surface, #fff);
  color: var(--deep-navy, #0F2744);
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 0 1px 1px rgba(15, 39, 68, 0.04);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ft-disclosure[open] > summary > .ft-twisty::before {
  content: "−";
  background: var(--clinical-blue, #4A90E2);
  border-color: var(--clinical-blue, #4A90E2);
  color: #fff;
}
.ft-disclosure > summary:hover > .ft-twisty::before {
  border-color: var(--clinical-blue, #4A90E2);
}
.ft-disclosure ul.ft-list {
  margin-left: 14px;
  border-left: 1px dashed var(--border);
  padding-left: 4px;
}
/* Pinned-roots (Production / Client) get a sharper visual cue. */
.ft-root > .ft-item > .ft-disclosure > summary {
  font-weight: 600;
  color: var(--deep-navy, #0F2744);
}
.ft-root > .ft-item > .ft-disclosure[open] > summary {
  background: rgba(74, 144, 226, 0.06);
  border-radius: 6px;
}
/* "More folders" group — softer, secondary */
.ft-more > .ft-disclosure > summary {
  font-style: italic;
  opacity: 0.85;
}
.ft-more-label { display: inline-flex; gap: 4px; align-items: baseline; }

/* Document list inside the sidebar */
.sidebar-doc-list { list-style: none; padding: 0; margin: 0; }
.sidebar-doc { margin: 0; }
.sidebar-doc a {
  display: block;
  padding: 6px 8px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--slate-900);
  border: 1px solid transparent;
}
.sidebar-doc a:hover {
  background: var(--primary-softer);
  border-color: var(--border);
}
.sidebar-doc-active > a {
  background: var(--primary-soft);
  border-color: var(--blue-200);
}
.sidebar-doc-num {
  display: block;
  font-size: 11px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: var(--blue-700);
}
.sidebar-doc-title {
  display: block;
  font-size: 12.5px;
  line-height: 1.35;
  margin: 1px 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sidebar-doc-status {
  font-size: 10px;
  padding: 1px 6px;
}
.sidebar-doc-meta {
  display: block;
  font-size: 10.5px;
  margin-top: 2px;
}

/* Quick-action column on the documents listing. Keeps multiple buttons
   on one row, wrapping on narrow screens, with no awkward inline-form
   margins. */
.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.actions-cell form.inline {
  display: inline;
  margin: 0;
}
.actions-cell .button.small {
  padding: 3px 9px;
  font-size: 11.5px;
}

/* Sign form card on the detail page. Same spacing as other cards but
   with a tighter heading and a discoverable border-left accent so the
   user's eye lands on it after clicking a quick-action link from the
   listing. */
.sign-form-card {
  border-left: 3px solid var(--primary);
  scroll-margin-top: 80px;  /* lands cleanly below the topbar on deep-link */
}
.sign-form-card .sign-heading {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--blue-700);
}
.sign-form-card .divider {
  margin: 14px 0;
  text-align: center;
  position: relative;
  color: var(--slate-600);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sign-form-card .divider::before,
.sign-form-card .divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 90px);
  height: 1px;
  background: var(--border);
}
.sign-form-card .divider::before { left: 0; }
.sign-form-card .divider::after  { right: 0; }

/* "Signed" pill: green for compliance affirmative. */
.pill.pill-signed { background: #15803d; }
/* "Superseded" pill: muted to avoid drawing attention away from current. */
.pill.pill-superseded {
  background: transparent;
  color: var(--slate-600);
  border: 1px solid var(--border);
}
/* "Open comments" pill: amber, draws the eye on the doc heading. */
.pill.pill-open { background: #b45309; }

/* ──────────────────────────────────────────────────────────────────────────
   Correction comments (Word-style margin notes)
   ────────────────────────────────────────────────────────────────────────── */
.comments-card { border-left: 3px solid #f59e0b; }
.comments-subhead {
  margin: 12px 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-600);
  font-weight: 600;
}
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.comment-resolved {
  background: var(--bg);
  border-color: var(--border);
  opacity: 0.78;
}
.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.comment-author { font-weight: 600; color: var(--slate-900); font-size: 13px; }
.comment-anchor {
  margin: 0 0 8px;
  padding: 6px 12px;
  border-left: 3px solid #f59e0b;
  background: #fff;
  font-style: italic;
  color: var(--slate-800);
  font-size: 13px;
}
.comment-text {
  font-size: 13.5px;
  color: var(--slate-900);
  line-height: 1.55;
  white-space: pre-wrap;
}
.resolved-comments {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.resolved-comments > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--slate-600);
  font-weight: 500;
}
.resolved-comments > summary:hover { color: var(--slate-900); }
.send-back-form .correction-row {
  border-left: 2px solid #fde68a;
  padding: 8px 14px 4px;
  margin-bottom: 10px;
  background: #fffbeb;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ──────────────────────────────────────────────────────────────────────────
   Banners
   ────────────────────────────────────────────────────────────────────────── */
.banner {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 14px 0;
  font-size: 13.5px;
}
.banner-error {
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.banner-ok {
  background: #d1fae5;
  color: var(--success);
  border: 1px solid #a7f3d0;
}
.banner-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ──────────────────────────────────────────────────────────────────────────
   Verify badge (audit page)
   ────────────────────────────────────────────────────────────────────────── */
.verify-badge {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.verify-badge.ok {
  background: var(--success);
  color: #fff;
}
.verify-badge.bad {
  background: var(--danger);
  color: #fff;
}

/* ──────────────────────────────────────────────────────────────────────────
   Workflow bar (document detail)
   ────────────────────────────────────────────────────────────────────────── */
.workflow-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.workflow-bar .step {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.workflow-bar .step.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.workflow-bar .arrow {
  color: var(--text-subtle);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.sign-form summary { list-style: none; cursor: pointer; }
.sign-form summary::-webkit-details-marker { display: none; }
.inline-create > summary { list-style: none; cursor: pointer; }
.inline-create > summary::-webkit-details-marker { display: none; }

/* ──────────────────────────────────────────────────────────────────────────
   Document viewer + protection chrome
   ────────────────────────────────────────────────────────────────────────── */
.viewer { padding: 0; overflow: hidden; position: relative; }
.watermark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}
.viewer-frame {
  display: block;
  width: 100%;
  height: 82vh;
  border: 0;
  background: var(--bg);
}
.viewer-image-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--bg);
  padding: 28px;
  max-height: 85vh;
  overflow: auto;
}
.viewer-image {
  max-width: 100%;
  height: auto;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
}
.viewer-text {
  margin: 0;
  padding: 24px 28px;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 80vh;
  overflow: auto;
  font: 13px/1.6 "SF Mono", Menlo, Consolas, monospace;
  background: var(--surface);
  color: var(--slate-800);
}
.viewer-fallback {
  padding: 56px 24px;
  text-align: center;
}
.viewer-fallback p { margin-bottom: 18px; }

.copy-protected,
.copy-protected * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.copy-protected img {
  pointer-events: none;
  -webkit-user-drag: none;
}
.copy-disabled-banner {
  background: var(--primary-softer);
  color: var(--blue-700);
  border: 1px solid var(--blue-200);
  padding: 9px 14px;
  border-radius: var(--radius);
  margin: 14px 0;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* ──────────────────────────────────────────────────────────────────────────
   DOCX rendition styling
   ────────────────────────────────────────────────────────────────────────── */
.docx-render-wrap {
  max-height: 80vh;
  overflow: auto;
  padding: 36px 56px;
  background: var(--surface);
}
.docx-render {
  max-width: 780px;
  margin: 0 auto;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--slate-900);
}
.docx-render h1, .docx-render h2, .docx-render h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--blue-700);
  margin: 1.4em 0 0.5em;
  font-weight: 600;
}
.docx-render h1 { font-size: 22px; }
.docx-render h2 { font-size: 18px; }
.docx-render h3 { font-size: 16px; }
.docx-render p { margin: 0 0 1em; }
.docx-render table {
  border-collapse: collapse;
  margin: 1em 0;
  width: auto;
}
.docx-render table td, .docx-render table th {
  border: 1px solid var(--border);
  padding: 7px 11px;
}
.docx-render ul, .docx-render ol { margin: 0 0 1em 1.5em; }
.docx-render img { max-width: 100%; height: auto; }
.docx-render a { color: var(--primary); }

/* ──────────────────────────────────────────────────────────────────────────
   Inline editor
   ────────────────────────────────────────────────────────────────────────── */
.editor-textarea {
  display: block;
  width: 100%;
  min-height: 62vh;
  padding: 16px 18px;
  font: 13px/1.6 "SF Mono", Menlo, Consolas, monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  white-space: pre;
  tab-size: 2;
  color: var(--slate-900);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.editor-textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* The editor card wraps a textarea + watermark overlay. `position: relative`
   anchors the absolutely-positioned watermark; `position` defaults to static
   on <form>, so set it explicitly. */
.editor-card {
  position: relative;
}

/* ──────────────────────────────────────────────────────────────────────────
   Changes & justification log on the document detail page
   ────────────────────────────────────────────────────────────────────────── */
.change-log {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.change-entry {
  border-left: 3px solid var(--blue-200);
  padding: 10px 14px 12px;
  margin-bottom: 14px;
  background: var(--primary-softer);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.change-entry:last-child { margin-bottom: 0; }
.change-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.change-version { font-size: 14px; color: var(--blue-700); }
.change-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .change-body { grid-template-columns: 1fr; }
}
.change-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-600);
  margin-bottom: 4px;
}
.change-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--slate-900);
  white-space: pre-wrap;
}
/* Override .copy-protected's blanket user-select:none for form inputs in
   the editor. Without this, the textarea won't accept cursor placement and
   editing is impossible. Copy-out is still blocked by the JS copy/cut
   listeners on the surrounding container. */
.copy-protected textarea,
.copy-protected input[type="text"],
.copy-protected input:not([type]),
.copy-protected [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* ──────────────────────────────────────────────────────────────────────────
   WYSIWYG editor (DOCX in-browser editing)
   ────────────────────────────────────────────────────────────────────────── */
.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  background: var(--primary-softer);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  align-items: center;
}
.wysiwyg-toolbar button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 13px;
  cursor: pointer;
  color: var(--slate-800);
  line-height: 1.2;
  min-width: 30px;
}
.wysiwyg-toolbar button:hover {
  border-color: var(--blue-400);
  background: var(--bg);
}
.wysiwyg-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}
.wysiwyg-surface {
  display: block;
  width: 100%;
  min-height: 60vh;
  padding: 22px 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--slate-900);
  outline: none;
  overflow-y: auto;
}
.wysiwyg-surface:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.wysiwyg-surface h1 { font-size: 22px; color: var(--blue-700); margin: 1em 0 0.4em; font-weight: 600; }
.wysiwyg-surface h2 { font-size: 18px; color: var(--blue-700); margin: 1em 0 0.4em; font-weight: 600; }
.wysiwyg-surface h3 { font-size: 16px; color: var(--blue-700); margin: 1em 0 0.3em; font-weight: 600; }
.wysiwyg-surface p { margin: 0 0 0.8em; }
.wysiwyg-surface ul, .wysiwyg-surface ol { margin: 0 0 0.8em 1.5em; }
.wysiwyg-surface li { margin: 0.2em 0; }

/* ──────────────────────────────────────────────────────────────────────────
   Login page
   ────────────────────────────────────────────────────────────────────────── */
.login-shell {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.login-hero {
  width: 100%;
  max-width: 440px;
  text-align: center;
  margin-bottom: 22px;
}
.login-hero .login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  box-shadow:
    0 8px 28px rgba(59, 130, 246, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
  margin-bottom: 16px;
}
.login-hero h1 {
  font-size: 26px;
  margin: 4px 0 6px;
  letter-spacing: -0.015em;
}
.login-hero p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 30px 32px;
  box-shadow: var(--shadow-lg);
}
.login-card h2 {
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--slate-900);
  font-weight: 600;
}
.login-help {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--primary-softer);
  border-radius: var(--radius);
  color: var(--blue-700);
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid var(--blue-100);
}
.login-help code {
  background: rgba(255, 255, 255, 0.6);
  color: var(--blue-800);
}
.sso-form { margin-bottom: 0; }
.sso-form button.primary {
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
}
.divider {
  display: flex;
  align-items: center;
  margin: 22px 0;
  color: var(--text-subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.divider span { padding: 0 14px; }
.password-form button {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
}

/* ──────────────────────────────────────────────────────────────────────────
   Breadcrumbs + folder tiles
   ────────────────────────────────────────────────────────────────────────── */
.breadcrumbs {
  padding: 12px 0 8px;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.breadcrumbs a {
  color: var(--primary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease;
}
.breadcrumbs a:hover {
  background: var(--primary-softer);
  text-decoration: none;
}
.breadcrumbs .crumb-sep {
  margin: 0 4px;
  color: var(--text-subtle);
}
.breadcrumbs .crumb-current {
  color: var(--slate-800);
  font-weight: 600;
  padding: 4px 8px;
}

/* Folders are now rendered exclusively in the left sidebar tree
   (`.ft-list`). The old `.folder-grid` / `.folder-tile` middle-pane
   layout has been removed. Keeping `.link-button` here for the small
   "+ New" disclosure in the sidebar header. */
.link-button {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue-700);
  padding: 2px 6px;
  border-radius: 4px;
  user-select: none;
}
.link-button::-webkit-details-marker { display: none; }
.link-button:hover { background: var(--primary-softer); }
.sidebar-new-folder-form {
  margin-top: 8px;
  padding: 10px;
  background: var(--primary-softer);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sidebar-new-folder-form input[name="name"] {
  width: 100%;
  margin-top: 4px;
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.sidebar-new-folder-form button.primary.small {
  margin-top: 8px;
  width: 100%;
  padding: 6px 8px;
  font-size: 11.5px;
}

/* ──────────────────────────────────────────────────────────────────────────
   Misc / accessibility
   ────────────────────────────────────────────────────────────────────────── */
::selection {
  background: var(--blue-200);
  color: var(--blue-900);
}
:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

@media (max-width: 720px) {
  .container { margin: 18px auto; padding: 0 18px; }
  .topbar { padding: 12px 18px; }
  .topbar nav { gap: 10px; }
  .card { padding: 18px 18px; }
  .login-card { padding: 24px 22px; }
  .meta { gap: 12px; font-size: 12.5px; }
}

/* Compliance report filters (audit trail + signature history) */
.filters { margin-bottom: 18px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
  margin-bottom: 14px;
}
.filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--slate-600);
  font-weight: 600;
}
.filter-grid input,
.filter-grid select {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-weight: 400;
  color: var(--slate-900);
}
.row .spacer { flex: 1 1 auto; }

/* Stripe billing — plan cards */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 14px;
}
.plan-card { text-align: center; }
.plan-card h3 { margin: 0 0 8px; }
.plan-price { font-size: 28px; margin: 8px 0 12px; }
.plan-price strong { font-size: 32px; color: var(--blue-700); }
.plan-card button[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ── Per-seat billing: interval toggle + storage meter ──────────────────── */
.interval-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-full);
  margin-top: 12px;
}
.interval-option { cursor: pointer; }
.interval-option input { position: absolute; opacity: 0; pointer-events: none; }
.interval-option span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font: 600 13px "IBM Plex Sans", sans-serif;
  color: var(--t2);
  transition: background 0.15s, color 0.15s;
}
.interval-option input:checked + span {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}
.interval-option input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.interval-save {
  font-style: normal;
  font-size: 10.5px;
  font-family: "IBM Plex Mono", monospace;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--success) 18%, transparent);
  color: var(--success);
}
.interval-option input:checked + span .interval-save {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.storage-meter {
  height: 10px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 10px;
}
.storage-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-out);
}
.storage-meter-fill.storage-meter-warn {
  background: linear-gradient(90deg, var(--warning), var(--danger));
}

/* Top-right language picker (URS-142) */
.lang-picker {
  display: inline-flex;
  margin-left: 6px;
}
.lang-picker select {
  padding: 5px 26px 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  color: var(--slate-700);
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--slate-500) 50%), linear-gradient(135deg, var(--slate-500) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.lang-picker select:hover { background-color: var(--blue-50); }
.lang-picker select:focus { outline: 2px solid var(--blue-300); outline-offset: 1px; }

/* Notifications (URS-048 / URS-070) */
.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--blue-600);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
}
tr.unread td { background: var(--blue-50); font-weight: 500; }
.sev {
  --pill-c: var(--info);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-full);
  font: 500 11.5px "IBM Plex Sans", sans-serif;
  background: color-mix(in srgb, var(--pill-c) 14%, transparent);
  color: color-mix(in srgb, var(--pill-c) 66%, var(--t1));
  border: 1px solid color-mix(in srgb, var(--pill-c) 32%, transparent);
  text-transform: capitalize;
}
.sev::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pill-c);
}
.sev-info    { --pill-c: var(--info); }
.sev-warning { --pill-c: var(--warning); }
.sev-overdue { --pill-c: var(--danger); }
.sev-error   { --pill-c: var(--danger); }
.btn-link {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid var(--blue-200);
  border-radius: 8px;
  color: var(--blue-700);
  background: var(--blue-50);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.btn-link:hover { background: var(--blue-100); }
.pager { margin-top: 14px; gap: 10px; }

/* ──────────────────────────────────────────────────────────────────────────
   Dashboard — KPI cards, audit-readiness ring, activity timeline, status mix
   ────────────────────────────────────────────────────────────────────────── */

/* Hero card — deep-navy with aerial-blue wash + faint dot-grid per the
   pharma-consultant design system. Used by every major page (dashboard,
   documents, document detail, DCR list, audit packs). The hero ink is
   intentionally light in both themes — the navy is the constant. */
.dash-hero {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin: 22px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: var(--hero-ink);
  background:
    radial-gradient(circle at 88% 18%, var(--hero-wash) 0px, transparent 360px),
    linear-gradient(135deg, var(--hero-0) 0%, var(--hero-1) 100%);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.dash-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.45;
  pointer-events: none;
}
.dash-hero > * { position: relative; }
.dash-hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  color: var(--hero-ink);
  font-family: "IBM Plex Sans", sans-serif;
}
.dash-hero h1 .muted { color: var(--hero-ink-2); }
.dash-hero .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-full);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hero-ink-2);
}
.dash-hero .hero-eyebrow::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
}
.dash-hero p { margin: 0; color: var(--hero-ink-2); }
.dash-hero p .muted { color: var(--hero-ink-2); opacity: 0.65; }
.dash-hero .hero-actions { display: flex; gap: 12px; flex-shrink: 0; }
.dash-hero .button {
  background: rgba(255,255,255,0.10);
  color: var(--hero-ink);
  border-color: rgba(255,255,255,0.18);
}
.dash-hero .button:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.32);
  color: var(--hero-ink);
}
.dash-hero .button.primary {
  background: var(--primary);
  border-color: var(--primary);
}
/* Status pills sitting on the navy hero — keep them legible by giving
   their background a brighter mix so they read against the dark surface. */
.dash-hero .status {
  background: color-mix(in srgb, var(--pill-c) 28%, rgba(255,255,255,0.08));
  color: color-mix(in srgb, var(--pill-c) 14%, #ffffff);
  border-color: color-mix(in srgb, var(--pill-c) 48%, transparent);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 18px 0 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--clinical-blue), var(--blue-700));
  opacity: 0.85;
}
.kpi-card.kpi-success::before { background: linear-gradient(180deg, var(--success), #047857); }
.kpi-card.kpi-warning::before { background: linear-gradient(180deg, var(--warning), #b45309); }
.kpi-card.kpi-danger::before  { background: linear-gradient(180deg, var(--danger), #991b1b); }
.kpi-label {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 8px;
}
.kpi-value {
  font-family: "IBM Plex Mono", "SF Mono", monospace;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--t1);
  line-height: 1.05;
}
.kpi-sub {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
}
.kpi-trend.up   { color: #065f46; background: #d1fae5; }
.kpi-trend.down { color: #991b1b; background: #fee2e2; }
.kpi-trend.flat { color: var(--slate-700); background: var(--slate-100); }

/* Audit-readiness ring (CSS-only doughnut using conic-gradient) */
.readiness-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 22px;
}
.score-ring {
  --score: 0;
  --ring-color: var(--clinical-blue);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  flex-shrink: 0;
  background:
    conic-gradient(var(--ring-color) calc(var(--score) * 1%), var(--surface-alt) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.score-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: inset 0 1px 3px rgba(15, 39, 68, 0.05);
}
.score-ring .score-value {
  position: relative;
  font-family: "Inter", sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--deep-navy);
  letter-spacing: -0.02em;
}
.score-ring .score-pct {
  position: relative;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -2px;
}
.readiness-meta { flex: 1; }
.readiness-meta h2 { margin: 0 0 4px; font-size: 18px; }
.readiness-meta p { margin: 0 0 10px; color: var(--text-muted); font-size: 13px; }
.readiness-bullets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.readiness-bullets li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--slate-700);
}
.readiness-bullets li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--slate-300);
}
.readiness-bullets li.ok::before  { background: var(--success); }
.readiness-bullets li.warn::before { background: var(--warning); }
.readiness-bullets li.bad::before  { background: var(--danger); }

/* Activity timeline */
.activity-timeline {
  position: relative;
  padding: 4px 0 4px 22px;
  margin: 0;
  list-style: none;
}
.activity-timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--blue-200), transparent);
}
.activity-timeline li {
  position: relative;
  padding: 10px 0;
  border-bottom: 1px dashed transparent;
}
.activity-timeline li + li { border-top: 1px dashed var(--border); }
.activity-timeline li::before {
  content: "";
  position: absolute;
  left: -22px; top: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--clinical-blue);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.14);
}
.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.activity-when {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.activity-action {
  font-family: "Inter", monospace;
  font-size: 11.5px;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* Document lifecycle mix — horizontal stacked bar */
.lifecycle-mix {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.lifecycle-bar {
  display: flex;
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--surface-alt);
  box-shadow: inset 0 1px 2px rgba(15, 39, 68, 0.04);
}
.lifecycle-bar .seg { transition: flex 0.3s var(--ease-out); }
.lifecycle-bar .seg.draft     { background: var(--blue-400); }
.lifecycle-bar .seg.in_review { background: var(--warning); }
.lifecycle-bar .seg.approved  { background: #6366f1; }
.lifecycle-bar .seg.effective { background: var(--success); }
.lifecycle-bar .seg.obsolete  { background: var(--slate-400); }
.lifecycle-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  font-size: 12.5px;
  color: var(--slate-700);
}
.lifecycle-legend .swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.lifecycle-legend .swatch.draft     { background: var(--blue-400); }
.lifecycle-legend .swatch.in_review { background: var(--warning); }
.lifecycle-legend .swatch.approved  { background: #6366f1; }
.lifecycle-legend .swatch.effective { background: var(--success); }
.lifecycle-legend .swatch.obsolete  { background: var(--slate-400); }

/* Two-column layout used by the dashboard for "main + side" widget rows */
.dash-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin: 18px 0;
}
@media (max-width: 980px) {
  .dash-row { grid-template-columns: 1fr; }
}

/* Subtle reveal animation for cards on page mount */
@keyframes dashReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dash-hero, .kpi-card, .readiness-card, .dash-row > .card { animation: dashReveal 0.4s var(--ease-out) both; }
.kpi-card:nth-child(1) { animation-delay: 0.02s; }
.kpi-card:nth-child(2) { animation-delay: 0.06s; }
.kpi-card:nth-child(3) { animation-delay: 0.10s; }
.kpi-card:nth-child(4) { animation-delay: 0.14s; }

/* Loading skeleton — used for empty/pending widgets */
@keyframes skel { 0% { background-position: -200px 0; } 100% { background-position: calc(200px + 100%) 0; } }
.skel {
  display: inline-block;
  height: 1em;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-alt) 0%, #f8fbff 50%, var(--surface-alt) 100%);
  background-size: 200px 100%;
  animation: skel 1.4s ease-in-out infinite;
}

/* Login page hero — premium biotech-SaaS feel */
.login-shell { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 40px 18px; }
.login-hero {
  text-align: center;
  margin-bottom: 28px;
}
.login-hero h1 {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 32px;
  margin-bottom: 6px;
  color: var(--t1);
}
.login-hero p { color: var(--t2); max-width: 540px; margin: 0 auto; }
.login-hero .login-compliance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 4px 12px;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
  border-radius: var(--radius-full);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.login-hero .login-compliance::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
}
.login-mark {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background:
    radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.5), transparent 60%),
    linear-gradient(135deg, var(--clinical-blue), var(--blue-700));
  box-shadow:
    0 14px 30px rgba(74, 144, 226, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: floatMark 4s ease-in-out infinite;
}
@keyframes floatMark {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.login-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 30px 30px 26px;
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: 100%;
}
.login-card h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 10px;
}
.divider {
  text-align: center;
  margin: 18px 0 14px;
  position: relative;
}
.divider::before, .divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }
.divider span {
  font-size: 12px;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--surface);
  padding: 0 8px;
  position: relative;
}
.login-help {
  margin-top: 22px;
  padding: 14px 16px;
  background: var(--blue-50);
  border: 1px dashed var(--blue-200);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--slate-700);
  line-height: 1.6;
}

/* ── Info boxes (URS-203: prominent surface for last-viewer, etc.) ───── */
.info-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 8px;
  padding: 14px 18px;
  background: var(--blue-50, #DCEEFF);
  border: 1px solid var(--blue-200, #BFD9F2);
  border-left: 4px solid var(--clinical-blue, #4A90E2);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(15, 39, 68, 0.06);
}
.info-box-icon {
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
  color: var(--clinical-blue, #4A90E2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}
.info-box-body {
  flex: 1 1 auto;
  min-width: 0;
}
.info-box-headline {
  font-size: 14px;
  color: var(--deep-navy, #0F2744);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.info-box-headline strong {
  font-weight: 600;
  margin-left: 4px;
  color: var(--deep-navy, #0F2744);
}
.info-box-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-muted, #475569);
  line-height: 1.55;
}
.info-box-sub code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.55);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--deep-navy, #0F2744);
}
.info-box-divider {
  margin: 0 6px;
  opacity: 0.55;
}
/* View-specific accent — slightly cooler tint. */
.info-box-view {
  background: linear-gradient(135deg, #DCEEFF 0%, #EAF4FF 100%);
}

/* ── Top-nav Settings dropdown (URS-307) ─────────────────────────────── */
.nav-menu {
  position: relative;
  display: inline-block;
}
.nav-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius, 8px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--slate-700, #475569);
  transition: background 0.15s var(--ease-out);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary:hover {
  background: rgba(74, 144, 226, 0.08);
  color: var(--deep-navy, #0F2744);
}
.nav-menu[open] summary {
  background: rgba(74, 144, 226, 0.12);
  color: var(--deep-navy, #0F2744);
}
.nav-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 260px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 12px 28px rgba(15, 39, 68, 0.12);
  padding: 14px 8px;
  z-index: 200;
  display: grid;
  gap: 8px;
}
.nav-menu-group h4 {
  margin: 6px 14px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted, #64748B);
}
.nav-menu-group + .nav-menu-group {
  border-top: 1px solid var(--border, #E5E7EB);
  padding-top: 8px;
}
.nav-menu-group a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--slate-700, #475569);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.12s var(--ease-out), color 0.12s var(--ease-out);
}
.nav-menu-group a:hover {
  background: rgba(74, 144, 226, 0.08);
  color: var(--deep-navy, #0F2744);
}
.nav-menu-group .nav-badge {
  margin-left: auto;
}

/* ── Inline document reader pane (URS-306) ───────────────────────────── */
.inline-reader {
  max-height: 78vh;
  overflow: auto;
  background: var(--surface, #fff);
}
.inline-reader pre,
.inline-reader .docx-body {
  color: var(--deep-navy, #0F2744);
}
.inline-reader.copy-protected {
  user-select: none;
}

/* ── Reader shell + TrackWise-style toolbar (URS-308) ────────────────── */
.reader-shell {
  position: relative;
  /* Make room on the right edge for the vertical status banner. */
  padding-right: 36px !important;
}
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border, #E5E7EB);
  background: linear-gradient(180deg, #F3F8FF 0%, #FFFFFF 100%);
  border-top-left-radius: var(--radius-lg, 12px);
  border-top-right-radius: var(--radius-lg, 12px);
  flex-wrap: wrap;
}
.reader-toolbar-left,
.reader-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.reader-toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border, #E5E7EB);
  margin: 0 4px;
}
.reader-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--slate-700, #475569);
}
.reader-zoom select {
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--border, #E5E7EB);
  background: var(--surface, #fff);
}
.reader-print-btn { font-weight: 500; }

/* Vertical status banner running down the right edge of the reader card. */
.reader-status-banner {
  position: absolute;
  top: 70px;
  right: 4px;
  width: 28px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--slate-700, #475569);
  background: linear-gradient(180deg, rgba(220, 238, 255, 0.65), rgba(220, 238, 255, 0.25));
  border-left: 2px solid var(--clinical-blue, #4A90E2);
  padding: 12px 6px;
  border-radius: 4px;
  pointer-events: none;
}
.reader-status-banner code {
  background: rgba(255, 255, 255, 0.7);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}
.reader-status-banner .status {
  font-size: 10.5px !important;
  padding: 1px 5px;
}

/* Reader body — wraps the rendered content so Zoom can scale only that. */
.reader-body {
  zoom: 1.0;
}

/* Left-rail tab strip at the bottom of the sidebar (URS-308). */
.sidebar-tabs {
  /* Vertical stack at the TOP of the sidebar (URS-314) — first thing the
     user sees so navigating between Documents / Change requests / Packages
     is obvious. */
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  padding: 8px 6px;
  background: var(--surface, #fff);
  border: 1px solid var(--blue-200, #BFD9F2);
  border-radius: var(--radius, 8px);
  box-shadow: 0 1px 3px rgba(15, 39, 68, 0.04);
}
/* Bottom variant kept as a fallback if anyone wants it again later */
.sidebar-tabs-bottom {
  margin-top: 16px;
  margin-bottom: 0;
  border-top: 1px solid var(--border, #E5E7EB);
  border-bottom-left-radius: var(--radius, 8px);
  border-bottom-right-radius: var(--radius, 8px);
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.sidebar-tab {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--slate-700, #475569);
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
  text-align: left;
}
.sidebar-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-tab-label { flex: 1; min-width: 0; }
.sidebar-tab:hover {
  background: rgba(74, 144, 226, 0.08);
  color: var(--deep-navy, #0F2744);
  border-color: rgba(74, 144, 226, 0.18);
}
.sidebar-tab-active {
  background: var(--surface, #fff);
  color: var(--deep-navy, #0F2744);
  border-color: var(--blue-200, #BFD9F2);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 39, 68, 0.05);
}

/* Print-only elements — rendered by base.html on every page but hidden
   on-screen; only visible when printing. */
.print-only { display: none; }

/* ─── G33: Inspection-grade print stylesheet ────────────────────────────
   Force light theme for print (dark navy panels look terrible on paper),
   hide every piece of interactive chrome, show a proper letterhead + a
   per-page footer with page n/N, UTC, content-hash, and the "uncontrolled
   when printed" warning. Keeps the attestation block prominent and
   page-breaks it cleanly.
   ─────────────────────────────────────────────────────────────────────── */
@page {
  size: A4;
  margin: 20mm 18mm 24mm;
}

@media print {
  /* Force light-mode tokens on print regardless of the on-screen theme. */
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    --bg-0: #ffffff; --bg-1: #ffffff;
    --surface: #ffffff; --surface-2: #ffffff;
    --glass: #ffffff; --glass-brd: transparent;
    --hair: #d4d9e0; --hair-2: #b4bcc7;
    --t1: #000000; --t2: #333333; --t3: #666666;
    --hero-0: #ffffff; --hero-1: #ffffff;
    --hero-ink: #000000; --hero-ink-2: #444444;
    --hero-wash: transparent;
    --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  }
  body { background: #ffffff !important; color: #000 !important; }
  html, body { min-height: 0; }

  /* Show print-only elements (letterhead + footer). */
  .print-only { display: block !important; }

  /* Hide every interactive / decorative chrome element. */
  .topbar, .part11-footer, .footer, .docs-sidebar, .breadcrumbs,
  .reader-toolbar, .reader-status-banner, .nav-menu,
  .cmdk-trigger, .cmdk-overlay, .theme-toggle, .lang-picker,
  .hero-actions, .dcr-sticky-bar, .dcr-audit-drawer,
  .banner, .info-box, .no-print,
  .dcr-page-v2 .dcr-sticky-bar,
  .dcr-page-v2 .dcr-right,
  .cmdk-kbd, .part11-footer .utc,
  form.filters, .filter-grid, .pager {
    display: none !important;
  }

  /* Collapse 3-pane layouts to a single flowing document. */
  .docs-layout,
  .dcr-page-v2 .dcr-grid,
  .container {
    display: block !important;
    grid-template-columns: 1fr !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .reader-shell, .inline-reader {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Neutralise the navy hero — on paper it becomes a compact letterhead. */
  .dash-hero, .hero-v3 {
    background: none !important;
    color: #000 !important;
    padding: 0 0 8pt !important;
    margin: 0 0 12pt !important;
    border: 0 !important;
    border-bottom: 1px solid #000 !important;
    box-shadow: none !important;
  }
  .dash-hero::before, .hero-v3::before { display: none !important; }
  .dash-hero h1, .dash-hero p,
  .hero-v3 h1, .hero-v3 p { color: #000 !important; }
  .dash-hero .hero-eyebrow, .login-compliance {
    background: transparent !important;
    border: 1px solid #000 !important;
    color: #000 !important;
  }

  /* Cards → paper */
  .card, .glass-card, .kpi-card,
  .dcr-header-card, .dcr-card, .dcr-sla-card,
  .attest-block {
    background: #fff !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .attest-block {
    border: 1px solid #000 !important;
    break-before: auto;
    page-break-before: auto;
  }
  .attest-block::before, .attest-block::after,
  .attest-block > .br-bl, .attest-block > .br-br {
    border-color: #000 !important;
  }

  /* Print letterhead — rendered by base.html at top of the printed page. */
  .print-letterhead {
    display: block !important;
    padding-bottom: 8pt;
    margin-bottom: 12pt;
    border-bottom: 2px solid #000;
  }
  .print-letterhead .lh-tenant {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 16pt;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.01em;
  }
  .print-letterhead .lh-tag {
    font-family: "IBM Plex Mono", monospace;
    font-size: 8pt;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #333;
    margin-top: 2pt;
  }
  .print-letterhead .lh-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-family: "IBM Plex Mono", monospace;
    font-size: 8.5pt;
    color: #333;
    margin-top: 4pt;
  }

  /* Per-page footer — positioned by @page top+bottom margin; content
     rendered by a small print footer div inside base.html that CSS
     absolute-positions to the bottom of every printed page. This is the
     "uncontrolled when printed" warning + page n/N + hash-chain UTC. */
  .print-page-footer {
    display: block !important;
    position: fixed;
    bottom: 8mm;
    left: 18mm;
    right: 18mm;
    border-top: 1px solid #999;
    padding-top: 4pt;
    font-family: "IBM Plex Mono", monospace;
    font-size: 8pt;
    color: #333;
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
  }
  .print-page-footer .pf-warn {
    color: #b91c1c;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .print-page-footer .pf-pages::after {
    content: " · Page " counter(page) " / " counter(pages);
  }

  /* Force pill/chip printing (they use color-mix which some engines drop). */
  .status, .dcr-status-pill, .dcr-priority-pill,
  .hash-chip, .audit-action, .rbac-role-pill {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
    border: 1px solid #666 !important;
  }
  .status::before, .dcr-status-pill::before,
  .dcr-priority-pill::before { display: inline-block !important; }

  /* Links printed with URL suffix for auditor traceability. */
  a[href^="/"]::after {
    content: " (" attr(href) ")";
    font-family: "IBM Plex Mono", monospace;
    font-size: 8pt;
    color: #666;
  }
  /* Suppress URL suffix on ⌘K item icons + nav-only links to avoid noise. */
  .cmdk-item a::after, .sidebar-tab a::after, .brand a::after { content: ""; }

  /* Page-break hints so long docs paginate sanely. */
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  .kpi-grid, .rbac-matrix-wrap, .posture-grid { break-inside: auto; }
  .attest-block, .dcr-header-card, .posture-card { break-inside: avoid; page-break-inside: avoid; }
}

/* ──────────────────────────────────────────────────────────────────────────
   DCR redesign — scoped under .dcr-page-v2 (URS-311 port of React prototype).
   Palette: matches the React mock exactly.
   Stays scoped so nothing leaks into other pages.
   ────────────────────────────────────────────────────────────────────────── */
.dcr-page-v2 {
  /* Remapped to the v3 design-system tokens so the DCR page also flips
     correctly when the user toggles dark mode. */
  --dcr-bg:        var(--bg-1);
  --dcr-card:      var(--surface);
  --dcr-line:      var(--hair);
  --dcr-ink:       var(--t1);
  --dcr-ink-muted: var(--t2);
  --dcr-ink-subtle:var(--t3);
  --dcr-primary:   var(--primary);
  --dcr-secondary: var(--primary-hover);
  --dcr-success:   var(--success);
  --dcr-warning:   var(--warning);
  --dcr-critical:  var(--danger);
  --dcr-shadow-soft: var(--shadow-sm);
  --dcr-shadow-lift: var(--shadow-lg);

  background: var(--dcr-bg);
  color: var(--dcr-ink);
  margin: -8px -28px 0; /* break out of the .container padding */
  min-height: calc(100vh - 80px);
  letter-spacing: -0.005em;
}
.dcr-page-v2 * { font-family: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif; }

/* Sticky action bar */
.dcr-action-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid var(--dcr-line);
  box-shadow: var(--dcr-shadow-soft);
}
.dcr-action-bar-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 28px; gap: 14px; flex-wrap: wrap;
}
.dcr-action-context {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--dcr-ink-muted);
}
.dcr-action-context strong { color: var(--dcr-ink); }
.dcr-action-context-chip {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  background: rgba(37, 99, 235, 0.1); color: var(--dcr-primary);
  border-radius: 6px; font-size: 11px; font-weight: 700;
}
.dcr-action-buttons {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.dcr-action-divider {
  width: 1px; height: 20px; background: var(--dcr-line); margin: 0 4px;
}
.dcr-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px;
  font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--dcr-line); border-radius: 8px;
  background: #fff; color: var(--dcr-ink);
  text-decoration: none; cursor: pointer;
  transition: all 0.15s;
}
.dcr-btn:hover { background: var(--dcr-bg); border-color: rgba(37, 99, 235, 0.25); }
.dcr-btn-primary {
  background: var(--dcr-primary); color: #fff; border-color: var(--dcr-primary);
  box-shadow: var(--dcr-shadow-soft);
}
.dcr-btn-primary:hover { background: #1e4cb8; border-color: #1e4cb8; color: #fff; }
.dcr-btn-subtle { border-color: transparent; color: var(--dcr-ink-muted); }
.dcr-btn-subtle:hover { background: var(--dcr-bg); color: var(--dcr-ink); }
.dcr-btn-sm { padding: 4px 8px; font-size: 11.5px; }
.dcr-action-dropdown { position: relative; }
.dcr-action-dropdown summary { list-style: none; cursor: pointer; }
.dcr-action-dropdown summary::-webkit-details-marker { display: none; }
.dcr-action-form {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--dcr-line); border-radius: 10px;
  padding: 12px; width: 280px;
  box-shadow: var(--dcr-shadow-lift); z-index: 40;
  display: flex; flex-direction: column; gap: 8px;
}
.dcr-action-form label { font-size: 11.5px; font-weight: 600; color: var(--dcr-ink-muted); }
.dcr-action-form textarea {
  width: 100%; margin-top: 4px; padding: 8px;
  border: 1px solid var(--dcr-line); border-radius: 8px;
  font-size: 13px; font-family: inherit; resize: vertical;
}

/* Main + breadcrumb */
.dcr-main { padding: 14px 28px 40px; }
.dcr-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--dcr-ink-muted);
  margin-bottom: 12px;
}
.dcr-breadcrumb a { color: var(--dcr-ink-muted); text-decoration: none; }
.dcr-breadcrumb a:hover { color: var(--dcr-primary); }
.dcr-breadcrumb strong { color: var(--dcr-ink); }
.dcr-crumb-sep { color: var(--dcr-ink-subtle); }

/* Header card */
.dcr-header-card {
  background: #fff; border: 1px solid var(--dcr-line);
  border-radius: 18px; padding: 22px 24px;
  box-shadow: var(--dcr-shadow-soft);
}
.dcr-header-row { display: flex; gap: 16px; align-items: flex-start; }
.dcr-header-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.dcr-pills-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dcr-header-id { display: flex; align-items: baseline; gap: 10px; }
.dcr-header-id h1 {
  font-size: 24px; font-weight: 800; letter-spacing: -0.025em;
  color: var(--dcr-ink); margin: 0;
}
.dcr-version-code {
  background: #f1f5f9; color: var(--dcr-ink-muted);
  padding: 2px 7px; border-radius: 4px;
  font-size: 11.5px; font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.dcr-header-title {
  font-size: 15.5px; font-weight: 500; line-height: 1.45;
  color: var(--dcr-ink); margin: 0;
}
.dcr-header-stamps {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 12px; color: var(--dcr-ink-muted);
  margin-top: 2px;
}
.dcr-header-stamps strong { color: var(--dcr-ink); }
.dcr-header-stamps > span { display: inline-flex; align-items: center; gap: 6px; }

/* DCR-namespaced pills — same v3 recipe, driven by --pill-c. */
.dcr-status-pill, .dcr-priority-pill, .dcr-meta-pill {
  --pill-c: var(--t2);
  display: inline-flex; align-items: center; gap: 6px;
  height: 23px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-full);
  font: 500 11.5px "IBM Plex Sans", sans-serif;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  background: color-mix(in srgb, var(--pill-c) 14%, transparent);
  color: color-mix(in srgb, var(--pill-c) 66%, var(--t1));
  border: 1px solid color-mix(in srgb, var(--pill-c) 32%, transparent);
}
.dcr-status-pill::before,
.dcr-priority-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pill-c);
  flex-shrink: 0;
}
.dcr-meta-pill { --pill-c: var(--t3); }

.dcr-status-draft        { --pill-c: var(--st-draft); }
.dcr-status-submitted    { --pill-c: var(--st-review); }
.dcr-status-under-review { --pill-c: var(--st-review); }
.dcr-status-approved     { --pill-c: var(--st-approved); }
.dcr-status-rejected     { --pill-c: var(--st-rejected); }
.dcr-status-on-hold      { --pill-c: var(--st-hold); }
.dcr-status-implemented  { --pill-c: var(--st-approved); }
.dcr-status-verified     { --pill-c: var(--st-effective); }
.dcr-status-closed       { --pill-c: var(--st-archived); }

/* Pulse animation on active workflow states. Replaces the inline pulse-dot
   so the pill's own ::before dot pulses without a wrapper element. */
.dcr-status-under-review::before,
.dcr-status-submitted::before {
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--pill-c) 55%, transparent);
  animation: dcrPillPulse 1.8s infinite ease-out;
}
@keyframes dcrPillPulse {
  0%   { box-shadow: 0 0 0 0   color-mix(in srgb, var(--pill-c) 55%, transparent); }
  100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--pill-c) 0%,  transparent); }
}
/* Keep the legacy .dcr-pulse-dot working for templates that still wrap a
   dot manually (no-op now — the pill carries the dot). */
.dcr-pulse-dot { display: none; }

.dcr-priority-low    { --pill-c: var(--st-archived); }
.dcr-priority-normal { --pill-c: var(--info); }
.dcr-priority-high   { --pill-c: var(--warning); }
.dcr-priority-urgent { --pill-c: var(--danger); }

/* Workflow progress */
.dcr-workflow { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.dcr-workflow-head {
  display: flex; justify-content: space-between; font-size: 11px;
}
.dcr-workflow-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dcr-ink-muted); }
.dcr-workflow-step { color: var(--dcr-ink-muted); }
.dcr-workflow-step strong { color: var(--dcr-ink); }
.dcr-workflow-bar {
  position: relative; height: 8px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 999px; overflow: hidden;
}
.dcr-workflow-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dcr-secondary), var(--dcr-primary));
  border-radius: 999px; transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.dcr-workflow-tick { position: absolute; top: 0; width: 1px; height: 100%; background: rgba(255,255,255,0.7); }
.dcr-workflow-stages { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dcr-ink-muted); }
.dcr-workflow-stages .active { font-weight: 700; color: var(--dcr-ink); }

/* 2-column grid */
.dcr-grid {
  margin-top: 20px;
  display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}
@media (max-width: 1100px) { .dcr-grid { grid-template-columns: 1fr; } }
.dcr-left { display: flex; flex-direction: column; gap: 18px; }
.dcr-right {
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 64px;
  max-height: calc(100vh - 100px); overflow-y: auto;
}

/* Cards */
.dcr-card {
  background: #fff; border: 1px solid var(--dcr-line);
  border-radius: 14px;
  box-shadow: var(--dcr-shadow-soft);
  overflow: hidden;
}
.dcr-card-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 22px 10px;
}
.dcr-card-head h3 {
  margin: 0; font-size: 15px; font-weight: 700; color: var(--dcr-ink);
}
.dcr-card-head p {
  margin: 3px 0 0; font-size: 13px; color: var(--dcr-ink-muted);
}
.dcr-card-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  background: rgba(37, 99, 235, 0.1); color: var(--dcr-primary);
  border-radius: 10px; font-size: 16px;
  flex-shrink: 0;
}
.dcr-card-icon-warn { background: rgba(220, 38, 38, 0.08); color: var(--dcr-critical); }
.dcr-card-body { padding: 6px 22px 22px; }
.dcr-card-head > div:not(.dcr-card-icon) { flex: 1; }

/* Fields */
.dcr-field-grid { display: grid; gap: 14px 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .dcr-field-grid { grid-template-columns: 1fr; } }
.dcr-field { display: flex; flex-direction: column; gap: 4px; }
.dcr-field-wide { grid-column: span 2; }
.dcr-field label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--dcr-ink-muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.dcr-field-value { font-size: 14px; color: var(--dcr-ink); padding: 8px 0 0; line-height: 1.5; }
.dcr-field-sub { font-size: 11.5px; color: var(--dcr-ink-muted); margin-top: 2px; }
.dcr-prose { font-size: 14px; line-height: 1.65; color: var(--dcr-ink); white-space: pre-wrap; }
.dcr-prose-small { font-size: 12.5px; line-height: 1.55; color: var(--dcr-ink); margin: 0; }

/* Part 11 markers */
.dcr-pt11 {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px;
  background: rgba(37, 99, 235, 0.08); color: var(--dcr-primary);
  border-radius: 4px; font-size: 10px;
  cursor: help;
}
.dcr-pt11-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fee2e2; color: #991b1b;
  padding: 2px 7px; border-radius: 6px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: help;
}

/* Affected docs table */
.dcr-table-wrap { border: 1px solid var(--dcr-line); border-radius: 10px; overflow: hidden; }
.dcr-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.dcr-table thead {
  background: var(--dcr-bg);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--dcr-ink-muted);
}
.dcr-table th { text-align: left; padding: 10px 14px; font-weight: 700; }
.dcr-table td { padding: 12px 14px; border-top: 1px solid var(--dcr-line); vertical-align: top; }
.dcr-table tbody tr:hover { background: rgba(37, 99, 235, 0.03); }
.dcr-table code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--dcr-primary); font-weight: 600;
}
.dcr-table a { color: var(--dcr-primary); text-decoration: none; font-weight: 600; }
.dcr-table a:hover { text-decoration: underline; }
.dcr-type-chip {
  display: inline-flex;
  background: rgba(37, 99, 235, 0.1); color: var(--dcr-primary);
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 1px 7px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.dcr-status-mini {
  display: inline-flex; padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.dcr-status-mini.dcr-status-effective { background: #d1fae5; color: #065f46; }
.dcr-status-mini.dcr-status-draft { background: #fef3c7; color: #78350f; }
.dcr-status-mini.dcr-status-in_review { background: rgba(37, 99, 235, 0.1); color: var(--dcr-primary); }
.dcr-status-mini.dcr-status-approved { background: #ede9fe; color: #5b21b6; }
.dcr-status-mini.dcr-status-obsolete { background: #f1f5f9; color: #475569; }

/* Impact tiles */
.dcr-impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dcr-impact-tile {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(220, 38, 38, 0.04); border: 1px solid rgba(220, 38, 38, 0.18);
}
.dcr-impact-check {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  background: var(--dcr-critical); color: #fff;
  border-radius: 6px; font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.dcr-impact-tile strong { font-size: 13.5px; color: var(--dcr-ink); }

/* Workflow timeline */
.dcr-timeline { position: relative; display: grid; gap: 14px; }
.dcr-timeline-rail {
  position: absolute; left: 14px; top: 18px; bottom: 18px; width: 2px;
  background: linear-gradient(180deg, var(--dcr-line), var(--dcr-line));
  z-index: 0;
}
.dcr-timeline-step { position: relative; display: flex; gap: 14px; align-items: flex-start; }
.dcr-timeline-dot {
  position: relative; z-index: 1; flex-shrink: 0;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%; font-size: 14px; font-weight: 700;
  background: #f1f5f9; color: #94a3b8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--dcr-line);
}
.dcr-step-done .dcr-timeline-dot { background: var(--dcr-success); color: #fff; box-shadow: 0 0 0 1px var(--dcr-success); }
.dcr-step-active .dcr-timeline-dot { background: var(--dcr-primary); color: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18); animation: dcrSpin 6s linear infinite; }
@keyframes dcrSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.dcr-timeline-card {
  flex: 1; display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  background: #fff; border: 1px solid var(--dcr-line);
  border-radius: 10px; padding: 11px 14px;
  box-shadow: var(--dcr-shadow-soft);
}
.dcr-step-active .dcr-timeline-card {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}
.dcr-timeline-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--dcr-ink-muted);
  grid-column: 1 / -1;
}
.dcr-timeline-who { display: flex; align-items: center; gap: 8px; }
.dcr-timeline-who strong { font-size: 13px; color: var(--dcr-ink); }
.dcr-timeline-when { font-size: 11.5px; color: var(--dcr-ink-muted); align-self: end; }

/* Avatars */
.dcr-avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--dcr-secondary), var(--dcr-primary));
  flex-shrink: 0;
  text-transform: uppercase;
}
.dcr-avatar-xs { width: 22px; height: 22px; font-size: 9.5px; }
.dcr-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.dcr-avatar-md { width: 36px; height: 36px; font-size: 12.5px; }

/* Related records grid */
.dcr-related-text {
  padding: 10px 12px; background: var(--dcr-bg);
  border-radius: 8px; font-size: 13px;
  color: var(--dcr-ink); margin-bottom: 12px;
}
.dcr-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .dcr-related-grid { grid-template-columns: 1fr; } }
.dcr-related-card {
  display: flex; flex-direction: column; gap: 6px;
  background: #fff; border: 1px solid var(--dcr-line);
  border-radius: 10px; padding: 12px 14px;
  text-decoration: none; color: inherit;
  box-shadow: var(--dcr-shadow-soft);
  transition: all 0.15s;
}
.dcr-related-card:hover { border-color: rgba(37, 99, 235, 0.25); transform: translateY(-1px); box-shadow: var(--dcr-shadow-lift); }
.dcr-related-kind {
  display: inline-flex; align-self: flex-start; gap: 4px;
  background: rgba(37, 99, 235, 0.08); color: var(--dcr-primary);
  padding: 2px 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.dcr-related-num { font-size: 13.5px; font-weight: 700; color: var(--dcr-primary); font-family: ui-monospace, SFMono-Regular, monospace; }
.dcr-related-title { font-size: 13px; color: var(--dcr-ink); line-height: 1.4; }
.dcr-related-meta { font-size: 11px; color: var(--dcr-ink-muted); }
.dcr-related-meta code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }

/* SLA card */
.dcr-sla-card {
  background: #fff; border: 1px solid var(--dcr-line);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--dcr-shadow-soft);
}
.dcr-sla-head { display: flex; align-items: center; gap: 8px; }
.dcr-sla-icon { display: grid; place-items: center; width: 26px; height: 26px; background: rgba(245, 158, 11, 0.12); color: var(--dcr-warning); border-radius: 7px; }
.dcr-sla-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dcr-ink-muted); }
.dcr-sla-window { margin-top: 8px; font-size: 22px; font-weight: 800; color: var(--dcr-ink); letter-spacing: -0.02em; }
.dcr-sla-bar { margin-top: 10px; height: 7px; background: rgba(37, 99, 235, 0.08); border-radius: 999px; overflow: hidden; }
.dcr-sla-fill { height: 100%; background: linear-gradient(90deg, #34d399, var(--dcr-success)); border-radius: 999px; }
.dcr-sla-meta { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dcr-ink-muted); margin-top: 6px; }

/* Compliance accordion */
.dcr-accordion { display: flex; flex-direction: column; gap: 8px; }
.dcr-acc-item {
  background: #fff; border: 1px solid var(--dcr-line);
  border-radius: 10px; box-shadow: var(--dcr-shadow-soft);
  overflow: hidden;
}
.dcr-acc-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  font-size: 12.5px; font-weight: 600;
  color: var(--dcr-ink);
}
.dcr-acc-item summary::-webkit-details-marker { display: none; }
.dcr-acc-item summary:hover { background: rgba(37, 99, 235, 0.03); }
.dcr-acc-item summary > span:first-child { color: var(--dcr-primary); }
.dcr-acc-badge {
  margin-left: auto;
  background: rgba(37, 99, 235, 0.1); color: var(--dcr-primary);
  padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
}
.dcr-acc-body { padding: 4px 14px 14px; border-top: 1px solid rgba(220, 227, 238, 0.6); }
.dcr-mini-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dcr-mini-timeline li { display: flex; gap: 8px; align-items: flex-start; }
.dcr-mini-timeline strong { font-size: 12px; color: var(--dcr-ink); }
.dcr-tiny { display: flex; gap: 6px; font-size: 10.5px; color: var(--dcr-ink-subtle); margin-top: 2px; }
.dcr-tiny code { background: #f1f5f9; padding: 1px 4px; border-radius: 3px; font-size: 9.5px; }
.dcr-mini-list { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.dcr-mini-list li { padding: 4px 0; border-bottom: 1px dashed rgba(220, 227, 238, 0.6); }
.dcr-mini-list li:last-child { border-bottom: 0; }
.dcr-history { list-style: none; padding: 0; margin: 0; }
.dcr-history li {
  font-size: 12px; color: var(--dcr-ink); padding: 5px 0; padding-left: 14px;
  position: relative;
}
.dcr-history li::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--dcr-primary);
}
.dcr-chip-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.dcr-chip-cloud span {
  background: #fff; border: 1px solid var(--dcr-line);
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; color: var(--dcr-ink);
}
.dcr-muted { color: var(--dcr-ink-muted); font-style: italic; font-size: 13px; }

/* Footer ribbon */
.dcr-footer-ribbon {
  margin-top: 28px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--dcr-line);
  border-radius: 12px; padding: 12px 18px;
  font-size: 11.5px; color: var(--dcr-ink-muted);
}
.dcr-footer-ribbon strong { color: var(--dcr-ink); }

/* Audit trail drawer */
.dcr-drawer {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
}
.dcr-drawer.open { pointer-events: auto; }
.dcr-drawer-backdrop {
  position: absolute; inset: 0; background: rgba(15, 39, 68, 0.3);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 0.2s;
}
.dcr-drawer.open .dcr-drawer-backdrop { opacity: 1; }
.dcr-drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 540px; max-width: 95vw;
  background: #fff; border-left: 1px solid var(--dcr-line);
  box-shadow: var(--dcr-shadow-lift);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.dcr-drawer.open .dcr-drawer-panel { transform: translateX(0); }
.dcr-drawer-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 20px; border-bottom: 1px solid var(--dcr-line);
}
.dcr-drawer-title { font-size: 15px; font-weight: 700; color: var(--dcr-ink); }
.dcr-drawer-subtitle { font-size: 12px; color: var(--dcr-ink-muted); margin-top: 2px; }
.dcr-drawer-head button {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px; border-radius: 6px; color: var(--dcr-ink-muted); font-size: 14px;
}
.dcr-drawer-head button:hover { background: var(--dcr-bg); color: var(--dcr-ink); }
.dcr-drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; position: relative; }
.dcr-drawer-footer {
  border-top: 1px solid var(--dcr-line);
  padding: 10px 20px;
  background: var(--dcr-bg);
  font-size: 11.5px; color: var(--dcr-ink-muted);
}
.dcr-full-timeline { list-style: none; padding: 0; margin: 0; position: relative; display: flex; flex-direction: column; gap: 16px; }
.dcr-full-rail { position: absolute; left: 14px; top: 0; bottom: 0; width: 1px; background: var(--dcr-line); }
.dcr-full-timeline li { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.dcr-full-card {
  flex: 1; background: #fff; border: 1px solid var(--dcr-line);
  border-radius: 10px; padding: 10px 12px;
  box-shadow: var(--dcr-shadow-soft);
}
.dcr-full-head { display: flex; justify-content: space-between; gap: 8px; }
.dcr-full-head strong { font-size: 12.5px; color: var(--dcr-ink); }
.dcr-full-head code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; }
.dcr-full-detail { font-size: 11.5px; color: var(--dcr-ink-muted); margin-top: 4px; line-height: 1.45; }

/* ── New-DCR form (URS-312) ─────────────────────────────────────────── */
.dcr-page-v2 .dcr-grid-single {
  display: grid; grid-template-columns: 1fr; gap: 18px;
  margin-top: 20px;
}
.dcr-page-v2 .dcr-input {
  width: 100%; padding: 10px 12px;
  background: #fff; border: 1px solid var(--dcr-line); border-radius: 10px;
  font-size: 14px; color: var(--dcr-ink);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dcr-page-v2 .dcr-input:focus {
  outline: none;
  border-color: var(--dcr-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.dcr-page-v2 .dcr-input::placeholder { color: var(--dcr-ink-subtle); }
.dcr-page-v2 .dcr-textarea { resize: vertical; min-height: 120px; line-height: 1.55; }

.dcr-page-v2 select.dcr-input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 5l3 3 3-3' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}

.dcr-page-v2 .dcr-required-asterisk {
  color: var(--dcr-critical); font-weight: 700; margin-left: 2px;
}

/* Priority picker — radio buttons styled as cards */
.dcr-page-v2 .dcr-priority-picker {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
@media (max-width: 700px) { .dcr-page-v2 .dcr-priority-picker { grid-template-columns: repeat(2, 1fr); } }
.dcr-page-v2 .dcr-priority-option {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px;
  background: #fff;
  border: 1.5px solid var(--dcr-line); border-radius: 10px;
  font-size: 12.5px; font-weight: 600;
  color: var(--dcr-ink-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.dcr-page-v2 .dcr-priority-option input { position: absolute; opacity: 0; pointer-events: none; }
.dcr-page-v2 .dcr-priority-option:hover { border-color: rgba(37, 99, 235, 0.4); }
.dcr-page-v2 .dcr-priority-option:has(input:checked) {
  border-color: var(--dcr-primary);
  background: rgba(37, 99, 235, 0.06);
  color: var(--dcr-ink);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}
.dcr-page-v2 .dcr-priority-glyph {
  display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--dcr-bg); color: var(--dcr-ink-muted);
  font-size: 11px; font-weight: 700;
}
.dcr-page-v2 .dcr-priority-option:has(input:checked) .dcr-priority-glyph {
  background: var(--dcr-primary); color: #fff;
}
.dcr-page-v2 .dcr-priority-low:has(input:checked)    .dcr-priority-glyph { background: #64748b; }
.dcr-page-v2 .dcr-priority-normal:has(input:checked) .dcr-priority-glyph { background: var(--dcr-primary); }
.dcr-page-v2 .dcr-priority-high:has(input:checked)   .dcr-priority-glyph { background: var(--dcr-warning); }
.dcr-page-v2 .dcr-priority-urgent:has(input:checked) .dcr-priority-glyph { background: var(--dcr-critical); }
.dcr-page-v2 .dcr-priority-urgent:has(input:checked) { border-color: var(--dcr-critical); background: rgba(220, 38, 38, 0.05); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10); }
.dcr-page-v2 .dcr-priority-high:has(input:checked)   { border-color: var(--dcr-warning); background: rgba(245, 158, 11, 0.05); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.10); }

/* Affected-doc picker */
.dcr-page-v2 .dcr-doc-picker { display: flex; flex-direction: column; gap: 10px; }
.dcr-page-v2 .dcr-doc-search { font-size: 13.5px; }
.dcr-page-v2 .dcr-doc-list {
  max-height: 340px; overflow-y: auto;
  border: 1px solid var(--dcr-line); border-radius: 10px;
  background: var(--dcr-bg);
  padding: 6px;
}
.dcr-page-v2 .dcr-doc-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
  margin-bottom: 4px;
}
.dcr-page-v2 .dcr-doc-option:last-child { margin-bottom: 0; }
.dcr-page-v2 .dcr-doc-option:hover { border-color: var(--dcr-line); }
.dcr-page-v2 .dcr-doc-option:has(input:checked) {
  border-color: var(--dcr-primary);
  background: rgba(37, 99, 235, 0.04);
}
.dcr-page-v2 .dcr-doc-option input[type="checkbox"] {
  margin-top: 2px;
  width: 16px; height: 16px;
  accent-color: var(--dcr-primary);
  cursor: pointer;
}
.dcr-page-v2 .dcr-doc-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dcr-page-v2 .dcr-doc-num code {
  font-size: 12.5px; font-weight: 700; color: var(--dcr-primary);
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.dcr-page-v2 .dcr-doc-title {
  font-size: 12.5px; color: var(--dcr-ink); line-height: 1.4;
}
.dcr-page-v2 .dcr-doc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.dcr-page-v2 .dcr-doc-count { font-weight: 600; color: var(--dcr-ink); }

/* Impact toggle cards */
.dcr-page-v2 .dcr-impact-toggle-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.dcr-page-v2 .dcr-impact-toggle {
  position: relative;
  display: block; cursor: pointer;
}
.dcr-page-v2 .dcr-impact-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.dcr-page-v2 .dcr-impact-toggle-body {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid var(--dcr-line);
  border-radius: 12px;
  transition: all 0.15s;
}
.dcr-page-v2 .dcr-impact-toggle:hover .dcr-impact-toggle-body {
  border-color: rgba(220, 38, 38, 0.3);
  transform: translateY(-1px);
}
.dcr-page-v2 .dcr-impact-toggle:has(input:checked) .dcr-impact-toggle-body {
  border-color: var(--dcr-critical);
  background: rgba(220, 38, 38, 0.04);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.dcr-page-v2 .dcr-impact-toggle-mark {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  background: #f1f5f9; color: #cbd5e1;
  border-radius: 6px;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  transition: all 0.15s;
}
.dcr-page-v2 .dcr-impact-toggle:has(input:checked) .dcr-impact-toggle-mark {
  background: var(--dcr-critical); color: #fff;
}
.dcr-page-v2 .dcr-impact-toggle strong {
  font-size: 13.5px; color: var(--dcr-ink); display: block;
}

/* Form-completion progress (chip in the sticky bar) */
.dcr-page-v2 .dcr-form-progress {
  display: inline-flex; align-items: center;
  margin-left: 12px;
  padding: 3px 9px;
  background: rgba(37, 99, 235, 0.08); color: var(--dcr-primary);
  border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Final CTA card — extra emphasis */
.dcr-page-v2 .dcr-cta-card {
  background: linear-gradient(180deg, #fff 0%, var(--dcr-bg) 100%);
  border-color: rgba(37, 99, 235, 0.18);
}

/* ============================================================================
   v3 — Pharma Consultant Redesign primitives
   New components introduced by the design handoff. Existing components above
   repaint automatically from the new --bg-*/--t*/--st-*/--primary tokens.
   ============================================================================ */

/* Uppercase mono micro-label (eyebrow tags, KPI captions, .12em tracking). */
.micro-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--t3);
  display: inline-block;
}

/* Hash-suffix chip — short content-hash, mono, primary tint background. */
.hash-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: var(--radius-full);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
.hash-chip::before {
  content: "#";
  opacity: 0.55;
}

/* Hero card (deep-navy + aerial-blue wash + faint dot-grid). */
.hero-v3 {
  position: relative;
  border-radius: 16px;
  padding: 28px 32px;
  color: var(--hero-ink);
  background:
    radial-gradient(circle at 88% 18%, var(--hero-wash) 0px, transparent 360px),
    linear-gradient(135deg, var(--hero-0) 0%, var(--hero-1) 100%);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.hero-v3::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.45;
  pointer-events: none;
}
.hero-v3 > * { position: relative; }
.hero-v3 h1, .hero-v3 h2, .hero-v3 h3 { color: var(--hero-ink); }
.hero-v3 .hero-sub { color: var(--hero-ink-2); }

/* Theme toggle button (top bar). */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  color: var(--t2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.theme-toggle:hover {
  background: var(--primary-tint);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Sticky Part 11 attestation footer. */
.part11-footer {
  position: sticky;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 24px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--hair);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--t2);
  letter-spacing: 0.04em;
}
.part11-footer .p11-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.part11-footer .p11-badge::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
}

/* Attestation block (§11.50 / §11.70 manifestation card with corner brackets). */
.attest-block {
  position: relative;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  color: var(--t1);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
}
.attest-block::before,
.attest-block::after,
.attest-block > .br-bl,
.attest-block > .br-br {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid var(--primary);
}
.attest-block::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.attest-block::after  { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.attest-block > .br-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.attest-block > .br-br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.attest-block .attest-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
  display: block;
  margin-bottom: 6px;
}
.attest-block .attest-signer {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
}

/* ============================================================================
   ⌘K Command palette — deterministic search · NO AI
   Indexes the in-page nav at load time. Keyboard-first (Cmd/Ctrl+K open,
   Esc close, arrow/enter navigate). Modal, focus-trapped via inert.
   ============================================================================ */
.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  color: var(--t2);
  font: 500 12.5px "IBM Plex Sans", sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cmdk-trigger:hover {
  background: var(--primary-tint);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
}
.cmdk-trigger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.cmdk-trigger .cmdk-icon {
  flex-shrink: 0;
  opacity: 0.7;
}
.cmdk-trigger .cmdk-kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 5px;
  color: var(--t3);
  font: 500 10.5px "IBM Plex Mono", monospace;
  letter-spacing: 0.04em;
}

.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--navy) 60%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  animation: cmdkFadeIn 180ms var(--ease-out);
}
.cmdk-overlay[data-open="true"] { display: flex; }
@keyframes cmdkFadeIn { from { opacity: 0; } to { opacity: 1; } }

.cmdk-dialog {
  width: min(640px, 92vw);
  background: var(--surface);
  border: 1px solid var(--hair-2);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cmdkRise 220ms var(--ease-out);
}
@keyframes cmdkRise {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hair);
}
.cmdk-input-row .cmdk-icon { color: var(--t3); }
.cmdk-input {
  flex: 1;
  border: 0;
  background: transparent;
  font: 500 15px "IBM Plex Sans", sans-serif;
  color: var(--t1);
  outline: none;
}
.cmdk-input::placeholder { color: var(--t3); }
.cmdk-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 6px;
}
.cmdk-empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--t3);
  font-size: 13px;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--t1);
  font-size: 13.5px;
  border: 1px solid transparent;
}
.cmdk-item .cmdk-item-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-tint);
  color: var(--primary);
  border-radius: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  flex-shrink: 0;
}
.cmdk-item .cmdk-item-label { flex: 1; }
.cmdk-item .cmdk-item-hint  { color: var(--t3); font-size: 11.5px; font-family: "IBM Plex Mono", monospace; }
.cmdk-item[aria-selected="true"],
.cmdk-item:hover {
  background: var(--primary-tint);
  border-color: color-mix(in srgb, var(--primary) 24%, transparent);
}
.cmdk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--hair);
  background: var(--surface-2);
  font: 500 10px "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--t3);
}
.cmdk-footer .cmdk-no-ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
}
.cmdk-footer .cmdk-no-ai::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
}

/* ============================================================================
   v3 — Phase 5 dark-mode overrides (long-tail sweep)
   The bulk of the app repaints from the token system. This block catches the
   remaining hardcoded #fff card backgrounds in the DCR pages and remaps the
   banner backgrounds (which were authored with custom warmth) to dark-mode-
   compatible mixes derived from semantic tokens.
   ============================================================================ */
:root[data-theme="dark"] .dcr-header-card,
:root[data-theme="dark"] .dcr-card,
:root[data-theme="dark"] .dcr-sla-card,
:root[data-theme="dark"] .dcr-acc-item,
:root[data-theme="dark"] .dcr-full-card,
:root[data-theme="dark"] .dcr-chip-cloud span,
:root[data-theme="dark"] .comment-card {
  background: var(--surface) !important;
  border-color: var(--hair) !important;
  color: var(--t1);
}
:root[data-theme="dark"] .dcr-version-code,
:root[data-theme="dark"] .dcr-tiny,
:root[data-theme="dark"] .dcr-status-mini,
:root[data-theme="dark"] .dcr-related-meta,
:root[data-theme="dark"] .dcr-full-head {
  background: var(--surface-2) !important;
  color: var(--t2);
  border-color: var(--hair);
}

/* Banners — same recipe as the status pill, derived from semantic tokens. */
.banner {
  --banner-c: var(--info);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--banner-c) 14%, transparent);
  color: color-mix(in srgb, var(--banner-c) 66%, var(--t1));
  border: 1px solid color-mix(in srgb, var(--banner-c) 30%, transparent);
}
.banner-ok    { --banner-c: var(--success); }
.banner-warn  { --banner-c: var(--warning); }
.banner-error { --banner-c: var(--danger); }
.banner-info  { --banner-c: var(--info); }

/* Visually-hidden helper (used for SR-only labels in cmdk + attest blocks). */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Match utility (used by the search-results page) — repaint in dark. */
:root[data-theme="dark"] .matched-pill,
:root[data-theme="dark"] .matched-title,
:root[data-theme="dark"] .matched-number,
:root[data-theme="dark"] .matched-filename,
:root[data-theme="dark"] .matched-type,
:root[data-theme="dark"] .matched-owner,
:root[data-theme="dark"] .matched-body {
  background: var(--primary-tint);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
}
:root[data-theme="dark"] .body-snippet {
  background: var(--surface-2);
  border-left-color: var(--primary);
  color: var(--t2);
}
:root[data-theme="dark"] .body-snippet mark {
  background: var(--primary-tint);
  color: var(--primary);
}

/* Folder-tree disclosure squares — same recipe as light, just retuned for
   the dark surface so the [+] / [−] glyphs still pop on a navy background. */
:root[data-theme="dark"] .ft-disclosure > summary > .ft-twisty::before {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--t3) 60%, transparent);
  color: var(--t1);
}
:root[data-theme="dark"] .ft-disclosure[open] > summary > .ft-twisty::before {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Topbar dark-mode tightening — the search input and brand mark are
   still authored with light-mode assumptions in places. */
:root[data-theme="dark"] .topbar-search input {
  background: var(--surface-2);
  color: var(--t1);
  border-color: var(--hair-2);
}
:root[data-theme="dark"] .topbar-search input::placeholder { color: var(--t3); }
:root[data-theme="dark"] .topbar-search input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
:root[data-theme="dark"] .topbar nav a:hover {
  background: var(--primary-tint);
  color: var(--primary);
}

/* Hero card on a dark page — keep the same navy gradient (it's the
   constant), but lift the inner border-glass slightly so it doesn't
   melt into the canvas. */
:root[data-theme="dark"] .dash-hero {
  border: 1px solid var(--hair-2);
}

/* ── Compliance posture page (D19) ────────────────────────────────────────
   Read-only checklist across Part 11 / Annex 11 / GAMP 5 / EU GMP Annex 15.
   Designed for screen-share with an inspector — dense, legible, honest.
   ──────────────────────────────────────────────────────────────────────── */
.compliance-hero .hero-actions { gap: 10px; }
.compliance-hero .score-ring {
  flex-shrink: 0;
}

.posture-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 14px;
  margin: 0 0 18px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  font: 500 12px "IBM Plex Sans", sans-serif;
  color: var(--t2);
}
.posture-legend > span { display: inline-flex; align-items: center; gap: 8px; }

.posture-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.posture-dot-ok   { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); }
.posture-dot-warn { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 22%, transparent); }
.posture-dot-bad  { background: var(--danger);  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger)  22%, transparent); }

.posture-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.posture-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px 12px;
}
.posture-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 6px;
}
.posture-card-head h2 {
  margin: 4px 0 0;
  font-size: 17px;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--t1);
}
.posture-summary .hash-chip { font-family: "IBM Plex Mono", monospace; }

.posture-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.posture-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--hair);
  color: var(--t1);
  text-decoration: none;
  transition: background 0.12s;
  border-radius: 6px;
}
.posture-item:last-child a { border-bottom: 0; }
.posture-item a:hover {
  background: var(--primary-tint);
  color: var(--primary);
  text-decoration: none;
  padding-left: 8px;
}
.posture-label { flex: 1; font-size: 13.5px; }
.posture-hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t3);
}

.posture-kpi {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}

/* ── Tenant settings (F27) — branding + IP allow-list + locales ───────────
   Additive sections that surface the roadmap tenant-config affordances
   without misrepresenting current state. Each roadmap section wears its
   own "Roadmap" status pill so a consultant demoing the platform doesn't
   promise what isn't shipped.
   ─────────────────────────────────────────────────────────────────────── */
.settings-brand-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-brand-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}
.settings-brand-item p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--t2);
}
.settings-cidr-list {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-top: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--hair-2);
  border-radius: var(--radius);
}
.settings-locale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.locale-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  color: var(--t2);
  font-size: 12.5px;
}
.locale-chip-active {
  background: var(--primary-tint);
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
  color: var(--primary);
}

/* ── Catalog editor (E22) — DCR reasons / impacts / doc-types ─────────────
   Row-based layout with reorder handles, hash-chip code, in-use count.
   Same visual pattern reused across all three catalogs so consultants
   configuring a tenant learn one surface.
   ─────────────────────────────────────────────────────────────────────── */
.catalog-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.catalog-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 140px auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.catalog-row:hover {
  border-color: color-mix(in srgb, var(--primary) 26%, transparent);
  background: color-mix(in srgb, var(--primary) 3%, var(--surface));
}
.catalog-row-inactive {
  background: var(--surface-2);
  opacity: 0.72;
}
.catalog-rank {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.catalog-move {
  width: 26px;
  height: 16px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 4px;
  color: var(--t3);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.catalog-move:hover:not(:disabled) {
  background: var(--primary-tint);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
}
.catalog-move:disabled { opacity: 0.55; cursor: not-allowed; }

.catalog-main { min-width: 0; }
.catalog-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.catalog-title-row strong {
  color: var(--t1);
  font-size: 14px;
  font-family: "IBM Plex Sans", sans-serif;
}
.catalog-desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--t2);
  line-height: 1.5;
}
.catalog-usage {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.catalog-usage-chip {
  background: color-mix(in srgb, var(--st-effective) 12%, transparent);
  color: color-mix(in srgb, var(--st-effective) 68%, var(--t1));
  border-color: color-mix(in srgb, var(--st-effective) 28%, transparent);
}
.catalog-actions {
  display: flex;
  gap: 6px;
}

/* ── Account / profile (F29) ──────────────────────────────────────────────
   Two-column grid with identity + factors + sessions + activity. Roadmap
   factors are visibly labelled so we don't overpromise MFA at MVP.
   ─────────────────────────────────────────────────────────────────────── */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 18px;
}
.account-card { margin: 0; }
.account-card h2 { margin-top: 0; }
.account-dl {
  margin: 0;
  display: grid;
  gap: 10px 16px;
  grid-template-columns: 140px 1fr;
}
.account-dl > div { display: contents; }
.account-dl dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
  padding-top: 3px;
}
.account-dl dd { margin: 0; color: var(--t1); font-size: 13.5px; }
.account-dl dd.utc, .account-dl dd.mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
}

.account-factors {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.account-factor {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}
.account-factor-on { border-color: color-mix(in srgb, var(--success) 24%, var(--hair)); }
.account-factor-roadmap {
  border-color: var(--hair);
  background: color-mix(in srgb, var(--warning) 4%, var(--surface));
}
.factor-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.factor-head > div { flex: 1; }
.factor-head strong {
  display: block;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--t1);
  font-size: 14px;
}
.factor-head p { margin: 2px 0 0; color: var(--t2); font-size: 12.5px; }
.factor-icon {
  font-size: 20px;
  line-height: 1;
  padding-top: 2px;
}
.factor-actions {
  padding-top: 10px;
  border-top: 1px dashed var(--hair);
  margin-top: 12px;
}
.account-factor button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Notification cadence editor (E25) ────────────────────────────────────
   Dense preference matrix: events × roles × channels. Chain-break row is
   locked ALWAYS (regulatory reason). Cadence list uses hash-chips for event
   keys and mono chips for scheduled slots.
   ─────────────────────────────────────────────────────────────────────── */
.notif-matrix th,
.notif-matrix td { vertical-align: middle; }
.notif-role-group {
  text-align: center !important;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--t1);
  border-left: 1px solid var(--hair);
  border-right: 1px solid var(--hair);
  background: var(--surface-2);
}
.notif-channel-head {
  text-align: center !important;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  color: var(--t3);
  border-bottom: 1px solid var(--hair);
  background: var(--surface-2);
}
.notif-cell {
  text-align: center;
  min-width: 48px;
}
.notif-event-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--t1);
}
.notif-event-hint {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--t2);
}
.notif-row-locked td { background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }
.notif-row-locked .notif-cell .posture-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); background: var(--danger); }

.notif-cadence-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notif-cadence-row {
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}
.notif-cadence-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.notif-cadence-schedule {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.notif-cadence-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-radius: var(--radius-full);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
}

/* ── DCR inspector-preview modal (C15) ────────────────────────────────────
   Full-screen framed viewer that renders the DCR audit pack PDF exactly
   as a regulator sees it. The frame chrome is intentionally minimal —
   "this is what the inspector sees" — with a Part 11 attest strip at the
   bottom, an "uncontrolled when printed" reminder at the top, and a
   sticky content-hash chip so provenance stays on-screen throughout.
   ─────────────────────────────────────────────────────────────────────── */
.inspector-modal {
  border: 0;
  padding: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--t1);
  max-width: min(1080px, 96vw);
  width: 100%;
  height: min(88vh, 900px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.inspector-modal::backdrop {
  background: color-mix(in srgb, var(--navy) 68%, transparent);
  backdrop-filter: blur(6px);
}
.inspector-frame {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
}
.inspector-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--hair);
}
.inspector-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--t1);
}
.inspector-head-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inspector-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--hair);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--t2);
}
.inspector-strip .micro-label { color: var(--t3); }
.inspector-strip .mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--danger);
}
.inspector-viewport {
  position: relative;
  background: color-mix(in srgb, var(--navy) 4%, var(--surface-2));
  overflow: hidden;
}
.inspector-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.inspector-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  border-top: 1px solid var(--hair);
  background: var(--glass);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--t2);
}

/* ── Background tasks queue (G31) ─────────────────────────────────────────
   Dense inspection-grade job list. State-tinted rows so an operator sees
   the queue's health at a glance without reading each state pill.
   ─────────────────────────────────────────────────────────────────────── */
.tasks-table th {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
}
.tasks-table .utc { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--t2); }
.tasks-row {
  transition: background 0.12s;
  position: relative;
}
.tasks-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
}
.tasks-state-failed::before   { background: var(--danger); }
.tasks-state-retrying::before { background: var(--warning); }
.tasks-state-running::before  { background: var(--info); }
.tasks-state-done::before     { background: var(--success); }
.tasks-state-pending::before  { background: var(--t3); }

.tasks-error {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface-2));
  color: var(--danger);
  border-radius: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
}

/* ── Platform console (A4 + G30) — break-glass tenant switcher ────────────
   Read-only cross-tenant view. Big READ-ONLY banner + justification +
   expiry countdown. Tenant directory rendered as branded cards with
   compliance posture chips.
   ─────────────────────────────────────────────────────────────────────── */
.platform-bg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-full);
  font: 700 10.5px "IBM Plex Mono", monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 3px 8px color-mix(in srgb, var(--danger) 30%, transparent);
}

.platform-banner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
  border-top: 1px solid var(--hair);
  border-bottom: 3px solid var(--danger);
  color: var(--t1);
}
.platform-banner-left { display: flex; align-items: center; gap: 16px; max-width: 60%; }
.platform-banner-left strong { font-size: 14px; color: var(--t1); }
.platform-banner-left .small { margin: 2px 0 0; color: var(--t2); font-size: 12.5px; }
.platform-banner-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius);
  font: 700 12px "IBM Plex Mono", monospace;
  letter-spacing: 0.18em;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--danger) 30%, transparent);
}
.platform-banner-right {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.platform-just { display: flex; flex-direction: column; gap: 2px; }
.platform-just .micro-label { color: var(--t3); }
.platform-just .mono { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--t1); }

.platform-tenants-card {
  margin-top: 22px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tenant-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  margin-top: 14px;
}
.tenant-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.tenant-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  box-shadow: var(--shadow-md);
}
.tenant-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.tenant-card-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 24%, transparent);
}
.tenant-card-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tenant-card-title strong {
  font-size: 15px;
  color: var(--t1);
  font-family: "IBM Plex Sans", sans-serif;
}
.tenant-card-posture {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.posture-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-full);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: var(--t2);
}
.tenant-card-kpis {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  padding: 12px 0;
  border-top: 1px dashed var(--hair);
  border-bottom: 1px dashed var(--hair);
}
.tenant-card-kpis li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tenant-card-kpis .mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  color: var(--t1);
}
.tenant-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
}

/* ── Watermark proof modal (B10) ──────────────────────────────────────────
   Small explainer that opens over the document preview and decomposes the
   watermark string into its components. Uses the native <dialog> element
   with a matching backdrop.
   ─────────────────────────────────────────────────────────────────────── */
.wm-proof-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  margin: 6px 0 8px;
  background: var(--primary-tint);
  border: 1px dashed color-mix(in srgb, var(--primary) 32%, transparent);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--t2);
}
.wm-proof-strip .micro-label { color: var(--primary); }
.wm-proof-btn {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  color: var(--primary);
}

.wm-modal {
  border: 0;
  padding: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--t1);
  max-width: 560px;
  width: 92vw;
  box-shadow: var(--shadow-lg);
}
.wm-modal::backdrop {
  background: color-mix(in srgb, var(--navy) 60%, transparent);
  backdrop-filter: blur(4px);
}
.wm-modal-inner { padding: 24px 26px 20px; }
.wm-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.wm-modal-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--t1);
}
.wm-modal-close {
  background: transparent;
  border: 0;
  color: var(--t3);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.wm-modal-close:hover { color: var(--t1); }
.wm-modal-lead {
  color: var(--t2);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 6px 0 16px;
}
.wm-attest .attest-signer { font-size: 13px; }
.wm-decompose {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  padding-top: 8px;
  border-top: 1px dashed var(--hair);
}
.wm-decompose > div .mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--t1);
  display: block;
  word-break: break-all;
  margin-top: 2px;
}
.wm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}

/* ── Upload wizard (B7) — live SHA-256 content-hash compute ───────────────
   The hash strip is the visual proof of the content-hash binding story.
   States: empty → busy → ready → error. The hex renders in mono so it
   reads as machine truth, not decorative UI. */
.upload-wizard { position: relative; }
.upload-wizard .uw-header {
  padding: 10px 14px;
  background: var(--primary-tint);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.uw-header .micro-label { color: var(--primary); }
.uw-hash {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.uw-hash[data-state="ready"] {
  background: color-mix(in srgb, var(--success) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}
.uw-hash[data-state="busy"] {
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
.uw-hash[data-state="error"] {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}
.uw-hash-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.uw-hash-state {
  font: 500 11px "IBM Plex Sans", sans-serif;
  color: var(--t2);
}
.uw-hash[data-state="ready"] .uw-hash-state { color: var(--success); }
.uw-hash[data-state="busy"] .uw-hash-state { color: var(--primary); }
.uw-hash[data-state="error"] .uw-hash-state { color: var(--danger); }
.uw-hash-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--t1);
  word-break: break-all;
  line-height: 1.45;
  min-height: 1.45em;
}
.uw-hash-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: var(--t3);
  margin-top: 6px;
}
.uw-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px dashed var(--hair-2);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--t2);
}
.uw-summary strong { color: var(--st-pending); }

/* ── Retention policy editor (E24) ────────────────────────────────────────
   Per-entity retention rows. The §11.10(c) audit row is a locked/immutable
   row — the lock chip carries the regulatory reason, no slider.
   ─────────────────────────────────────────────────────────────────────── */
.retention-policy-card { margin-bottom: 20px; }
.retention-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ret-row {
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.ret-row:hover { border-color: var(--hair-2); }
.ret-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.ret-row strong {
  display: block;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 14px;
  color: var(--t1);
  margin-top: 4px;
}
.ret-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--t2);
  max-width: 460px;
}
.ret-value {
  flex-shrink: 0;
  padding-top: 4px;
}
.ret-slider {
  margin-top: 10px;
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}
.ret-slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: var(--radius-full);
}
.ret-slider-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font: 500 10px "IBM Plex Mono", monospace;
  color: var(--t3);
  letter-spacing: 0.06em;
}

/* §11.10(c) LOCK row — audit trail never deleted. Visibly locked. */
.ret-row-locked {
  border: 1.5px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
  position: relative;
}
.ret-row-locked::before {
  content: "";
  position: absolute;
  left: -1.5px; top: -1.5px; bottom: -1.5px;
  width: 4px;
  background: var(--danger);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.ret-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-full);
  font: 700 11px "IBM Plex Mono", monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--danger) 22%, transparent);
}
.ret-lock svg { display: block; }

/* ── Version history timeline rail (B9) ───────────────────────────────────
   Vertical lineage rail with a glass card per version. Current Effective
   version wears the "current" marker; superseded versions still show their
   signature count and full content hash so the lineage is auditor-ready.
   ─────────────────────────────────────────────────────────────────────── */
.version-timeline {
  position: relative;
  padding-left: 8px;
}
.vtl-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 0 0 14px;
}
.vtl-item:last-child { padding-bottom: 0; }
.vtl-rail {
  position: relative;
  padding-top: 14px;
}
/* The rail line connecting all dots. */
.vtl-rail::after {
  content: "";
  position: absolute;
  top: 0; bottom: -14px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--hair);
}
.vtl-item:last-child .vtl-rail::after { bottom: 50%; }
.vtl-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--hair-2);
  margin: 0 auto;
}
.vtl-dot-current {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}
.vtl-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 12px 16px 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.vtl-item-current .vtl-card {
  border-color: color-mix(in srgb, var(--primary) 34%, transparent);
  box-shadow: var(--shadow-md);
}
.vtl-card:hover { box-shadow: var(--shadow-md); }
.vtl-head { margin-bottom: 8px; }
.vtl-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.vtl-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: 0;
}
.vtl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  color: var(--t2);
}
.vtl-meta .utc {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--t2);
}
.vtl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--hair);
}

/* ── Validation pack navigator (D20) ──────────────────────────────────────
   Two-column layout: artifact rail on the left, URS traceability table on
   the right. Row counts + last-sync timestamps read off the on-disk files
   so the page stays honest with the shipped pack.
   ─────────────────────────────────────────────────────────────────────── */
.vp-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1000px) { .vp-grid { grid-template-columns: 1fr; } }

.vp-nav {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 18px 18px 12px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.vp-nav h2 {
  font-size: 14px;
  font-family: "IBM Plex Sans", sans-serif;
  letter-spacing: 0.02em;
  color: var(--t1);
  margin-bottom: 12px;
}
.vp-artifact-list { list-style: none; padding: 0; margin: 0; }
.vp-artifact {
  padding: 10px 0;
  border-bottom: 1px dashed var(--hair);
}
.vp-artifact:last-child { border-bottom: 0; }
.vp-artifact-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.vp-artifact-head strong {
  font-size: 12.5px;
  color: var(--t1);
  font-family: "IBM Plex Sans", sans-serif;
}
.vp-artifact-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.vp-artifact-rows {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: var(--primary);
}
.vp-artifact-sync {
  font-size: 10px;
  color: var(--t3);
  margin-top: 4px;
  letter-spacing: 0;
}

.vp-main {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 18px 20px 12px;
  box-shadow: var(--shadow-sm);
}
.vp-urs-table {
  width: 100%;
  border-collapse: collapse;
}
.vp-urs-table th {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
}
.vp-urs-table td { vertical-align: top; }
.vp-purpose { font-size: 13px; color: var(--t1); }
.vp-row:hover { background: var(--primary-tint); }
.vp-row-pending { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.vp-row-partial { background: color-mix(in srgb, var(--warning) 6%, transparent); }

/* ── RBAC matrix (F26 — Users & roles) ────────────────────────────────────
   Dense inspection-grade RBAC view. Rows = permissions, columns = roles.
   Green dot = granted. Per-user cards below expand to show the union of
   granted permissions. ─────────────────────────────────────────────────── */
.rbac-matrix-wrap { margin-top: 4px; }
.rbac-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--hair);
}
.rbac-matrix { margin: 0; }
.rbac-matrix th, .rbac-matrix td { vertical-align: middle; }
.rbac-role-col {
  text-align: center !important;
  min-width: 92px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: var(--t2);
}
.rbac-cell {
  text-align: center;
  width: 92px;
}
.rbac-empty {
  color: var(--t3);
  font-size: 12px;
  opacity: 0.5;
}
.rbac-group-row td {
  background: var(--surface-2);
  border-top: 1px solid var(--hair);
  padding-top: 10px !important;
  padding-bottom: 4px !important;
}
.rbac-group-row .micro-label { color: var(--t2); }

/* Per-user cards */
.rbac-users {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
.rbac-user-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 4px 12px;
}
.rbac-user-card > summary {
  cursor: pointer;
  padding: 10px 4px;
  list-style: none;
}
.rbac-user-card > summary::-webkit-details-marker { display: none; }
.rbac-user-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr auto;
  gap: 14px;
  align-items: center;
}
.rbac-user-ident { display: flex; align-items: center; gap: 8px; }
.rbac-user-ident strong { color: var(--t1); font-size: 13.5px; }
.rbac-user-roles { display: flex; gap: 6px; flex-wrap: wrap; }
.rbac-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: var(--radius-full);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: lowercase;
}
.rbac-user-count { justify-self: end; }
.rbac-effective {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 4px 14px;
  border-top: 1px dashed var(--hair);
}
.rbac-effective-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-full);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: var(--t1);
}

/* Screen-share mode — bumps type up, hides chrome so the page reads on a
   projector or a screen-shared window. Toggled by a class on <html>. */
html.screen-share .topbar,
html.screen-share .part11-footer,
html.screen-share .compliance-hero .hero-actions {
  display: none;
}
html.screen-share .posture-card { padding: 26px 28px 16px; }
html.screen-share .posture-label { font-size: 15px; }

/* ── Audit log — dense inspection-grade timeline ──────────────────────────
   Mono UTC + hash chips + action mini-pills. Tighter row height so an
   inspector can scan many events. The whole table reads at a glance as
   "machine truth", not "decorated UI". */
.audit-table { border-radius: var(--radius); overflow: hidden; }
.audit-table th {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
}
.audit-table .utc {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--t1);
  white-space: nowrap;
  letter-spacing: 0;
}
.audit-table .audit-action {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: var(--radius-full);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 500;
}
.audit-table .audit-entity-type {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--t2);
  margin-right: 6px;
  text-transform: uppercase;
}
.audit-table tbody tr {
  position: relative;
  transition: background 0.15s;
}
.audit-table tbody tr:hover {
  background: var(--primary-tint);
}
/* On hover, surface a faint left rail = the chain link indicator. */
.audit-table tbody tr::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.15s;
}
.audit-table tbody tr:hover::before {
  background: var(--primary);
}

/* ============================================================================
   RESPONSIVE — phone & tablet (ProveWise)
   Consolidated mobile pass. The topbar collapses into a hamburger drawer
   ≤900px; heroes stack, wide tables scroll, and grids single-column ≤720px.
   Appended last so these rules win over the scattered legacy media blocks.
   ============================================================================ */

/* Hamburger toggle — hidden on desktop, shown in the ≤900 drawer block. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  margin-left: auto;               /* push to the right of the brand */
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  color: var(--t1);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nav-toggle .nav-toggle-close { display: none; }
.topbar.nav-open .nav-toggle .nav-toggle-open { display: none; }
.topbar.nav-open .nav-toggle .nav-toggle-close { display: block; }

/* ── Nav drawer: phone + tablet-portrait (≤900px) ───────────────────────── */
@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 0;
    padding: 12px 18px;
    position: sticky;              /* keep it while the drawer is open */
  }
  .nav-toggle { display: inline-flex; }

  /* The whole nav becomes a full-width vertical drawer, collapsed by default. */
  header.topbar > nav#primary-nav {
    flex-basis: 100%;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.28s ease, opacity 0.2s ease, margin 0.28s ease;
    margin-top: 0;
  }
  header.topbar.nav-open > nav#primary-nav {
    max-height: 90vh;
    overflow-y: auto;
    opacity: 1;
    pointer-events: auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--hair);
  }

  /* Drawer items: full width, comfortable tap targets. */
  header.topbar > nav#primary-nav > a,
  header.topbar > nav#primary-nav .nav-menu {
    width: 100%;
    padding: 11px 12px;
    border-radius: var(--radius);
    font-size: 15px;
  }
  header.topbar > nav#primary-nav > a:hover { background: var(--primary-tint); }

  /* Search fills the drawer width. */
  .topbar-search { width: 100%; margin: 0 0 4px; }
  .topbar-search input,
  .topbar-search input:focus { width: 100%; }

  /* Settings dropdown: render inline inside the drawer (not a floating panel). */
  .nav-menu { width: 100%; }
  .nav-menu .nav-menu-panel {
    position: static;
    box-shadow: none;
    border: 0;
    padding: 4px 0 4px 10px;
    min-width: 0;
    background: transparent;
  }
  .nav-menu[open] .nav-menu-panel { animation: none; }

  /* Language picker + theme toggle span the drawer; tenant + user chips wrap. */
  .lang-picker { width: 100%; }
  .lang-picker select { width: 100%; }
  .theme-toggle { align-self: flex-start; }
  .tenant-chip, .user-chip { align-self: flex-start; }
  .user-chip { padding: 8px 4px; }

  /* ⌘K is a desktop-keyboard affordance — hide it on touch layouts. */
  .cmdk-trigger { display: none; }
}

/* ── Phone (≤720px): stack heroes, scroll wide tables, wrap action bars ──── */
@media (max-width: 720px) {
  /* Hero: text over actions, actions full-width so CTAs never overflow. */
  .dash-hero,
  .compliance-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 20px;
  }
  .dash-hero .hero-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .dash-hero .hero-actions .button,
  .dash-hero .hero-actions form { flex: 1 1 auto; }
  .dash-hero .hero-actions .button { text-align: center; }
  .dash-hero h1 { font-size: 22px; }

  /* Any dense table becomes horizontally scrollable instead of pushing the
     page wide. Works for bare .data tables not already inside .rbac-scroll. */
  .data {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* DCR sticky action bar: let the state-machine buttons wrap. */
  .dcr-action-bar-inner { flex-wrap: wrap; gap: 8px; }

  /* Single-column the remaining multi-col grids on the smallest screens. */
  .account-grid,
  .posture-grid,
  .tenant-grid,
  .kpi-grid { grid-template-columns: 1fr; }

  /* The per-user cards under the RBAC matrix carried
     `minmax(220px, 1fr) 2fr auto`. That 220px floor plus two further columns
     and their gaps cannot fit the ~300px a 375px phone actually leaves inside
     the card, so /admin/roles scrolled sideways — the permission matrix itself
     was innocent, it already scrolls inside .rbac-scroll. */
  .rbac-user-head { grid-template-columns: 1fr; gap: 6px; }
  .rbac-user-count { justify-self: start; }

  /* Tighten hero KPI numbers so they don't crowd. */
  .kpi-value { font-size: 28px; }

  /* Compliance-posture hero: let the ring + copy stack. */
  .compliance-hero > div { flex-wrap: wrap; }

  /* Dashboard recent-activity: stack action over timestamp so the mono
     "when" string never pushes the page wide. */
  .activity-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .activity-when { white-space: normal; }

  /* Account user-agent cell: the raw UA string is one long unbreakable
     token — let it wrap on phones so it can't blow the page width.
     td.* specificity so it wins over the desktop base rule below. */
  td.account-ua-cell { max-width: 100%; white-space: normal; word-break: break-all; }

  /* Auth-factor rows: let the flex children shrink + wrap so long labels
     never force the card wide. (min-width:0 is the classic flex overflow fix.) */
  .factor-head { flex-wrap: wrap; }
  .factor-head > div { min-width: 0; flex: 1 1 100%; }
  .account-card, .account-factor, .posture-card, .tenant-card { min-width: 0; }
}

/* Account user-agent cell — desktop truncates with an ellipsis. */
.account-ua-cell {
  font-size: 11.5px;
  color: var(--t2);
  max-width: 460px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Tablet (721–1024px): give grids two columns, keep drawer nav ───────── */
@media (min-width: 721px) and (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-grid,
  .posture-grid,
  .tenant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Workflow legibility ────────────────────────────────────────────────
   The bar used to show only WHICH state a document was in. It never said who
   was responsible for moving it on, what happened next, or — when a control
   simply did not render because the viewer lacked a permission — why nothing
   was there. Users read that silence as "the workflow makes no sense", which
   was a fair reading of what they were shown. */
.wf-annotated { flex-wrap: wrap; gap: 6px; align-items: stretch; }
.wf-step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--hair);
  background: var(--surface);
  min-width: 0;
}
.wf-step-label { font-weight: 600; font-size: 13px; }
.wf-step-who {
  font-size: 11px;
  color: var(--t3);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.wf-done    { opacity: 0.62; }
.wf-current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-tint); }
.wf-current .wf-step-label { color: var(--primary-hover); }
.wf-upcoming { background: var(--surface-2); color: var(--t3); }

.wf-explain {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--hair);
}
.wf-explain p { margin: 0 0 6px; }
.wf-explain p:last-child { margin-bottom: 0; }
.wf-headline { font-size: 14px; }
/* When the document is waiting on the person reading the page, say so loudly —
   the commonest question is "is this mine to move?" */
.wf-your-turn { border-color: var(--success); background: rgba(44, 122, 75, 0.06); }

@media (max-width: 720px) {
  .wf-annotated { flex-direction: column; }
  .wf-annotated .arrow { display: none; }
}

/* ── Setup checklist ────────────────────────────────────────────────────
   Shown on the dashboard only while the workspace cannot complete an approval.
   Approval needs three distinct people and signup provides one; before this,
   nothing said so until the moment approval was refused — after the work was
   already done. */
.setup-card { border-left: 3px solid var(--primary); }
.setup-steps { list-style: none; margin: 12px 0 0; padding: 0; }
.setup-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--hair);
}
.setup-step:first-child { border-top: none; }
.setup-mark {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--hair-2);
  background: var(--surface-2);
  font-size: 12px; font-weight: 600; color: var(--t2);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.setup-done .setup-mark {
  background: var(--success); border-color: var(--success); color: #fff;
}
.setup-body { flex: 1 1 auto; min-width: 0; }
.setup-title { font-weight: 600; font-size: 14px; }
/* Completed steps stay visible — seeing what you already finished is the point
   of a checklist — but recede so the eye lands on what is still outstanding. */
.setup-done .setup-title { color: var(--t3); text-decoration: line-through; }
.setup-done .setup-detail { display: none; }

@media (max-width: 720px) {
  .setup-step { flex-wrap: wrap; }
  /* Keep the number and its text on one row — without this the body wraps
     below the badge and each step costs an extra line of scrolling. Only the
     action button drops to its own line. */
  .setup-body { flex: 1 1 calc(100% - 36px); }
  .setup-step .button { margin-left: 36px; }
}
