/**
 * Sprint 5 — Executive Reading Modes
 * Presentation-layer only. Zackgo Premium Orange branding.
 */

:root {
  --rm-orange: #F97316;
  --rm-orange-hover: #FB923C;
  --rm-orange-grad: linear-gradient(135deg, #F97316 0%, #FFB347 100%);
  --rm-orange-soft: rgba(249, 115, 22, 0.12);
  --rm-orange-glow: 0 0 0 3px rgba(249, 115, 22, 0.22), 0 8px 24px rgba(249, 115, 22, 0.18);
}

/* ── Toolbar — lives inside #rv-toolbar-center (single chrome row) ──────── */
.rm-toolbar-bar { display: none !important; }

.rm-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.rv-toolbar--has-reading-modes {
  flex-wrap: nowrap;
}

.rm-mode-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2, rgba(0,0,0,.04));
  border: 1px solid var(--border, rgba(0,0,0,.08));
  gap: 2px;
}

.rm-mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim, #64748b);
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 36px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}

.rm-mode-btn .rm-mode-label {
  font-size: 12.5px;
  font-weight: 700;
}

.rm-mode-btn .rm-mode-sub {
  display: none !important;
}

.rm-mode-btn:hover {
  color: var(--text-strong, #0f172a);
  background: rgba(249, 115, 22, 0.08);
}

.rm-mode-btn:focus-visible {
  outline: 2px solid var(--rm-orange);
  outline-offset: 2px;
}

.rm-mode-btn.is-active {
  color: #fff;
  background: var(--rm-orange);
  box-shadow: none;
}

.rm-role-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(0,0,0,.08));
  background: transparent;
}

.rm-role-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute, #94a3b8);
  padding: 0 6px;
}

.rm-role-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim, #64748b);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  min-height: 32px;
  border-radius: 8px;
  cursor: pointer;
}

.rm-role-btn:focus-visible {
  outline: 2px solid var(--rm-orange);
  outline-offset: 1px;
}

.rm-role-btn.is-active {
  background: var(--rm-orange-soft);
  color: var(--rm-orange);
}

.rm-jump-menu {
  position: relative;
}

.rm-jump-summary {
  list-style: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.rm-jump-summary::-webkit-details-marker { display: none; }

.rm-jump-menu[open] .rm-jump-nav {
  display: flex;
}

.rm-jump-nav {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  flex-direction: column;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid, #fff);
  box-shadow: var(--shadow-md, 0 12px 32px rgba(0,0,0,.18));
}

:root[data-theme="dark"] .rm-jump-nav {
  background: #161616;
}

.rm-jump-btn {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 8px 10px;
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
}

.rm-jump-btn:hover,
.rm-jump-btn.is-active {
  background: var(--rm-orange-soft);
  color: var(--rm-orange);
}

.rm-jump-roles {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border, rgba(0,0,0,.08));
}

.rm-jump-roles-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute, #94a3b8);
  padding: 4px 10px 2px;
}

.rm-jump-roles .rm-role-btn {
  width: 100%;
  text-align: left;
  min-height: 36px;
}

body.rm-view-snapshot .rv-doc-nav {
  display: none;
}
body.rm-view-snapshot .rm-role-switch {
  display: none;
}
body.rm-view-snapshot .rm-jump-roles {
  display: flex;
}

#rv-print-btn .rm-print-label {
  font-weight: 700;
}

/* ── Visibility helpers ─────────────────────────────────────────────────── */
.rm-hidden {
  display: none !important;
}

.rm-jump-flash {
  outline: 2px solid var(--rm-orange);
  outline-offset: 4px;
  border-radius: 12px;
  transition: outline-color .8s ease;
}

.rm-role-ordered {
  display: flex;
  flex-direction: column;
}

.rm-role-priority > .rv-section-header .rv-section-title::after,
[data-rm-section].rm-role-priority .rm-brief-panel h3::after {
  content: ' · Priority';
  color: var(--rm-orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* ── Confidence badges ──────────────────────────────────────────────────── */
.rm-conf-badge {
  position: relative;
  appearance: none;
  border: 1px solid var(--border, rgba(0,0,0,.1));
  background: var(--surface-2, rgba(0,0,0,.03));
  border-radius: 999px;
  padding: 3px 8px 3px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-dim, #64748b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.rm-conf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.rm-conf-high { color: #EA580C; border-color: rgba(249,115,22,.25); background: rgba(249,115,22,.08); }
.rm-conf-medium { color: var(--rm-orange); border-color: rgba(249,115,22,.25); background: var(--rm-orange-soft); }
.rm-conf-low { color: #dc2626; border-color: rgba(248,113,113,.25); background: rgba(248,113,113,.08); }

.rm-conf-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 5;
  min-width: 180px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-solid, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  color: var(--text-dim, #475569);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  text-align: left;
}

.rm-conf-badge.is-open .rm-conf-tip { display: block; }

/* ── Collapse / Read more ───────────────────────────────────────────────── */
.rm-collapse-btn,
.rm-readmore-btn {
  appearance: none;
  border: 1px solid rgba(249,115,22,.28);
  background: var(--rm-orange-soft);
  color: var(--rm-orange);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: auto;
}

.rm-is-collapsed > .rv-section-body {
  max-height: 160px;
  overflow: hidden;
  position: relative;
}

.rm-is-collapsed > .rv-section-body::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 72px;
  background: linear-gradient(180deg, transparent, var(--bg, #fff));
  pointer-events: none;
}

.rm-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rm-readmore-btn { margin: 8px 0 0; }

/* ── 30-Second Snapshot / 1-page Executive Brief ─────────────────────────── */
body.rm-view-snapshot #rv-content {
  display: block !important;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 24px;
  width: 100%;
  box-sizing: border-box;
}

body.rm-view-snapshot .rv-doc-nav {
  display: none !important;
}

body.rm-view-snapshot .rv-document {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 24px 0 48px !important;
  box-sizing: border-box;
}

body.rm-view-snapshot #rm-snapshot-view,
body.rm-view-snapshot .rm-snapshot {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.rm-snapshot-brief {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rm-snapshot {
  --rm-snap-gap: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 24px;
  min-height: 0;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
  border-radius: 18px;
  border: 1px solid var(--border, rgba(0,0,0,.08));
  background: var(--surface-solid, #fff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06));
}

:root[data-theme="dark"] .rm-snapshot {
  background:
    radial-gradient(900px 320px at 0% 0%, rgba(249,115,22,.12), transparent 60%),
    var(--surface-solid, #0f172a);
}

.rm-snapshot-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}

.rm-snapshot-eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rm-orange);
  margin-bottom: 2px;
}

.rm-snapshot-company {
  margin: 0;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text-strong, #0f172a);
  line-height: 1.15;
}

.rm-snapshot-period {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-mute, #64748b);
}

.rm-snapshot-grid {
  flex: none;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: none;
  gap: var(--rm-snap-gap);
  align-items: start;
}

.rm-snap-block {
  background: var(--surface-solid, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

:root[data-theme="dark"] .rm-snap-block {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.08);
}

.rm-snap-block h3 {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute, #64748b);
  flex-shrink: 0;
}

.rm-snap-block > :not(h3) {
  flex: none;
  min-height: 0;
  overflow: visible;
}

.rm-snap-health { grid-column: span 3; }
.rm-snap-kpis {
  grid-column: span 6;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--rm-snap-gap);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.rm-snap-alerts { grid-column: span 3; }
.rm-snap-opps { grid-column: span 3; }
.rm-snap-risks { grid-column: span 3; }
.rm-snap-decisions { grid-column: span 3; }
.rm-snap-depts { grid-column: span 6; }
.rm-snap-takeaway { grid-column: span 3; }
.rm-snap-timeline {
  grid-column: 1 / -1;
  min-height: 96px;
  max-height: none;
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, var(--surface-solid, #fff) 0%, rgba(249,115,22,.04) 100%);
}

:root[data-theme="dark"] .rm-snap-timeline {
  background: linear-gradient(180deg, rgba(255,255,255,.03) 0%, rgba(249,115,22,.06) 100%);
}

.rm-kpi-card {
  background: var(--surface-solid, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 88px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

:root[data-theme="dark"] .rm-kpi-card {
  background: rgba(255,255,255,.03);
}

.rm-kpi-card span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-mute, #64748b);
}

.rm-kpi-card strong {
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 800;
  color: var(--text-strong, #0f172a);
  letter-spacing: -.02em;
  line-height: 1.1;
}

.rm-snap-takeaway > :not(h3) {
  overflow: auto;
}

.rm-takeaway-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.rm-takeaway-line {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-strong, #0f172a);
}

.rm-takeaway-action {
  margin-top: auto;
  padding: 8px 10px;
  border-radius: 10px;
  border-left: 3px solid var(--rm-orange);
  background: var(--rm-orange-soft, rgba(249,115,22,.08));
}

.rm-takeaway-action-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rm-orange);
  margin-bottom: 4px;
}

.rm-takeaway-action p {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-strong, #0f172a);
}

.rm-takeaway-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-mute, #64748b);
  line-height: 1.45;
}

.rm-takeaway {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-strong, #0f172a);
}

/* Compact snapshot list items */
.rm-snap-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rm-snap-mini-item {
  border-left: 3px solid var(--rm-orange);
  padding: 6px 8px;
  border-radius: 0 8px 8px 0;
  background: var(--surface-2, rgba(0,0,0,.03));
  cursor: pointer;
  transition: background .15s ease;
}

.rm-snap-mini-item:hover {
  background: var(--rm-orange-soft);
}

.rm-snap-mini-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong, #0f172a);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-snap-mini-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-dim, #64748b);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-snap-empty {
  font-size: 12px;
  color: var(--text-mute, #94a3b8);
  padding: 8px 0;
  line-height: 1.4;
}

/* Health snapshot */
.rm-health-snapshot { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.rm-health-hero { display: flex; gap: 12px; align-items: center; }
.rm-health-score {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  background: var(--rm-orange-grad);
  box-shadow: var(--rm-orange-glow);
  flex-shrink: 0;
}
.rm-health-label { font-size: 15px; font-weight: 800; color: var(--text-strong, #0f172a); }
.rm-health-trend { font-size: 11px; color: var(--text-mute, #64748b); margin: 2px 0 6px; }
.rm-health-dims {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
}
.rm-health-dim {
  background: var(--surface-2, rgba(0,0,0,.04));
  border-radius: 10px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rm-health-dim-label { font-size: 9px; font-weight: 700; color: var(--text-mute, #64748b); text-transform: uppercase; letter-spacing: .05em; }
.rm-health-dim-val { font-size: 11px; font-weight: 800; color: var(--text-strong, #0f172a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Cards shared */
.rm-decision-grid,
.rm-risk-grid,
.rm-opp-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}

.rm-decision-card,
.rm-risk-card,
.rm-opp-card {
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-2, rgba(0,0,0,.12));
  cursor: pointer;
}

.rm-decision-card-head,
.rm-risk-card > header,
.rm-opp-card > header {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 4px;
}

.rm-decision-title,
.rm-risk-card h4,
.rm-opp-card h4 {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.3;
}

.rm-decision-meta {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.rm-decision-meta dt {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-mute, #94a3b8);
}

.rm-decision-meta dd {
  margin: 0;
  font-size: 11px;
  color: var(--text-dim, #cbd5e1);
  line-height: 1.3;
}

.rm-card-line {
  margin: 0 0 2px;
  font-size: 11px;
  color: var(--text-dim, #cbd5e1);
  line-height: 1.35;
}

.rm-card-line strong {
  color: var(--text-mute, #94a3b8);
  font-weight: 700;
  margin-right: 4px;
}

.rm-pill,
.rm-sev {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255,255,255,.1));
}

.rm-priority-critical,
.rm-priority-high,
.rm-sev-critical,
.rm-sev-high { color: #ef4444; background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.25); }
.rm-priority-medium,
.rm-sev-medium { color: var(--rm-orange); background: var(--rm-orange-soft); border-color: rgba(249,115,22,.25); }
.rm-priority-low,
.rm-sev-low { color: #F97316; background: rgba(249,115,22,.1); border-color: rgba(249,115,22,.25); }

.rm-pill-type { color: #60a5fa; background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.25); }
.rm-pill-urgency { color: var(--text-dim, #94a3b8); }

.rm-alert-list { display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.rm-alert-item {
  border-left: 3px solid var(--rm-orange);
  padding: 6px 8px;
  border-radius: 0 8px 8px 0;
  background: var(--surface-2, rgba(0,0,0,.03));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rm-alert-item.rm-sev-critical,
.rm-alert-item.rm-sev-high { border-left-color: #ef4444; }
.rm-alert-item strong { font-size: 12px; color: var(--text-strong, #0f172a); line-height: 1.3; }
.rm-alert-item span { font-size: 11px; color: var(--text-dim, #64748b); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.rm-dept-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}

.rm-dept-chip {
  appearance: none;
  border: 1px solid var(--border, rgba(0,0,0,.08));
  background: var(--surface-2, rgba(0,0,0,.03));
  border-radius: 10px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: inherit;
  min-width: 0;
  max-width: 100%;
}

.rm-dept-name { font-size: 11px; font-weight: 700; color: var(--text-strong, #0f172a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-dept-score {
  font-size: 12px;
  font-weight: 800;
  color: var(--rm-orange);
  min-width: 22px;
}
.rm-dept-status { font-size: 10px; color: var(--text-mute, #94a3b8); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rm-empty { font-size: 12px; color: var(--text-mute, #94a3b8); }
.rm-empty-ok { color: #F97316; font-weight: 600; }

/* Timeline — aligned executive stepper */
.rm-timeline-track {
  position: relative;
  padding: 4px 0 0;
  --rm-timeline-steps: 5;
}

.rm-timeline-rail {
  position: absolute;
  top: 11px;
  left: calc(50% / var(--rm-timeline-steps));
  right: calc(50% / var(--rm-timeline-steps));
  height: 2px;
  background: linear-gradient(90deg, var(--rm-orange) 0%, rgba(249,115,22,.25) 100%);
  border-radius: 2px;
  pointer-events: none;
}

.rm-timeline-steps {
  display: grid;
  grid-template-columns: repeat(var(--rm-timeline-steps), minmax(0, 1fr));
  gap: 6px;
  position: relative;
  z-index: 1;
}

.rm-timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  padding: 0 4px;
}

.rm-timeline-node-wrap {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.rm-timeline-node {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rm-orange);
  box-shadow: 0 0 0 3px rgba(249,115,22,.18);
  flex-shrink: 0;
}

.rm-timeline-step.rm-timeline-now .rm-timeline-node {
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 4px rgba(249,115,22,.22), 0 0 10px rgba(249,115,22,.35);
}

.rm-timeline-step.rm-timeline-warn .rm-timeline-node {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18);
}

.rm-timeline-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-strong, #0f172a);
  line-height: 1.2;
  width: 100%;
}

.rm-timeline-detail {
  font-size: 10px;
  color: var(--text-mute, #64748b);
  margin-top: 3px;
  line-height: 1.35;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rm-timeline-step.rm-timeline-now .rm-timeline-label { color: var(--rm-orange); }

/* Legacy brief timeline (vertical) */
.rm-timeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.rm-timeline-item {
  position: relative;
  flex: 1;
  min-width: 120px;
  padding: 0 10px 0 18px;
}

.rm-timeline-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 0;
  width: 2px;
  background: var(--border, rgba(255,255,255,.12));
}

.rm-timeline-item:last-child::before { display: none; }

.rm-brief-timeline .rm-timeline-track {
  padding-top: 8px;
}

.rm-brief-timeline .rm-timeline-detail {
  -webkit-line-clamp: 3;
}

/* ── Brief chrome ───────────────────────────────────────────────────────── */
.rm-brief-chrome {
  margin: 16px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rm-brief-narrative {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.rm-narrative-act {
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-solid, #fff);
}

.rm-act-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rm-orange);
  margin-bottom: 4px;
}

.rm-narrative-act p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim, #475569);
}

.rm-brief-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.rm-brief-panel {
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-solid, #fff);
}

.rm-brief-panel h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-strong, #0f172a);
}

.rm-brief-timeline { grid-column: 1 / -1; }

/* Brief vs Full — distinct density, same JSON */
body.rm-view-review .rv-section-title {
  font-size: clamp(18px, 2vw, 22px);
  letter-spacing: -.02em;
  font-weight: 700;
}
body.rm-view-review .rv-section {
  margin-bottom: 40px;
}
body.rm-view-review .rv-card,
body.rm-view-review .rv-exec-block {
  padding: 28px 32px;
  border-radius: 16px;
}

body.rm-view-full .rv-section-title {
  font-size: 16px;
  letter-spacing: -.015em;
  font-weight: 700;
}
body.rm-view-full .rv-section {
  margin-bottom: 28px;
}
body.rm-view-full .rv-card,
body.rm-view-full .rv-exec-block {
  padding: 20px 24px;
  border-radius: 12px;
}

/* Hide generation-time density overrides fighting Sprint 5 live switch —
   Sprint 5 owns visibility via .rm-hidden */
[data-rm-view="snapshot"] .rv-document > :not(#rm-snapshot-view):not(.rv-print-header):not(.rv-print-footer):not(.rv-print-watermark) {
  /* snapshot visibility handled by JS .rm-hidden */
}

/* Presentation slide filter */
.rm-slide-hidden {
  display: none !important;
}

.rm-pres-mode-bar {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: none;
  gap: 4px;
  padding: 5px;
  border-radius: 100px;
  background: rgba(10, 10, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

html.rv-presentation .rm-pres-mode-bar {
  display: inline-flex;
}

.rm-pres-mode-bar .rm-mode-btn {
  color: rgba(255, 255, 255, 0.75);
  border-radius: 100px;
  padding: 7px 12px;
  min-height: 32px;
}

.rm-pres-mode-bar .rm-mode-btn.is-active {
  color: #fff;
}

@media (max-width: 900px) {
  .rm-pres-mode-bar {
    top: auto;
    bottom: 88px;
  }
}

/* Dashboard preview */
.rm-dash-preview {
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--surface-solid, #fff);
}

.rm-dash-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.rm-dash-preview-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong, #0f172a);
}

.rm-dash-preview-sub {
  font-size: 11px;
  color: var(--text-mute, #94a3b8);
  margin-top: 2px;
}

.rm-dash-mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2, rgba(0,0,0,.04));
}

.rm-dash-mode-tabs .rm-mode-btn {
  padding: 6px 10px;
  flex-direction: row;
}

.rm-dash-preview-body {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 72px;
}

.rm-dash-score {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  background: var(--rm-orange-grad);
  box-shadow: var(--rm-orange-glow);
  flex-shrink: 0;
}

.rm-dash-copy { flex: 1; min-width: 0; font-size: 13px; color: var(--text-dim, #475569); }
.rm-dash-mini { margin-top: 4px; font-size: 12px; color: var(--text-mute, #94a3b8); }
.rm-dash-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rm-dash-open {
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--rm-orange-grad);
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: var(--rm-orange-glow);
}
.rm-dash-open:nth-child(2),
.rm-dash-open:nth-child(3) {
  background: transparent;
  color: var(--rm-orange);
  border: 1px solid rgba(249,115,22,.35);
  box-shadow: none;
}

/* Snapshot scrolls with the page — never clip */
@media (min-width: 1280px) {
  body.rm-view-snapshot,
  body.rm-view-snapshot #rv-root,
  body.rm-view-snapshot .rv-document {
    overflow: visible;
    height: auto;
    max-height: none;
  }
}

@media (max-width: 1279px) {
  .rm-snapshot {
    max-height: none;
    overflow: visible;
    min-height: auto;
  }
  .rm-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rm-snap-health,
  .rm-snap-kpis,
  .rm-snap-alerts,
  .rm-snap-opps,
  .rm-snap-risks,
  .rm-snap-decisions,
  .rm-snap-depts,
  .rm-snap-takeaway,
  .rm-snap-timeline {
    grid-column: auto;
    grid-row: auto;
  }
  .rm-snap-kpis { grid-column: 1 / -1; }
  .rm-snap-timeline { grid-column: 1 / -1; max-height: none; }
  .rm-brief-narrative,
  .rm-brief-panels { grid-template-columns: 1fr; }

  .rm-snap-block {
    overflow: visible;
  }
  .rm-snap-block > :not(h3) {
    overflow: visible;
    flex: none;
    min-height: auto;
  }

  .rm-role-switch { display: none; }
  .rm-jump-roles { display: flex; }
}

@media (max-width: 767px) {
  .rm-snapshot-grid {
    grid-template-columns: 1fr;
  }
  .rm-snap-kpis {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rm-mode-btn { min-height: 44px; box-sizing: border-box; }
  .rm-role-btn { min-height: 44px; padding: 8px 10px; box-sizing: border-box; }
  .rm-jump-btn,
  .rm-jump-summary { min-height: 44px; padding: 8px 12px; box-sizing: border-box; }
}

/* ── Print / PDF by reading mode ────────────────────────────────────────── */
@media print {
  .rm-toolbar-bar,
  .rm-toolbar,
  .rm-jump-menu,
  .rm-collapse-btn,
  .rm-readmore-btn,
  .rm-jump-nav,
  #rv-toolbar,
  #rv-chrome-stack,
  #rv-slide-deck {
    display: none !important;
  }

  .rm-is-collapsed > .rv-section-body {
    max-height: none !important;
    overflow: visible !important;
  }
  .rm-is-collapsed > .rv-section-body::after { display: none !important; }
  .rm-clamp {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
  }

  .rm-hidden { display: none !important; }

  /* 30-Second PDF — tight single-page intent */
  html.rm-print-snapshot .rm-snapshot {
    max-height: none;
    min-height: auto;
    overflow: visible;
    page-break-after: avoid;
    padding: 8pt;
  }
  html.rm-print-snapshot .rm-snapshot-grid {
    gap: 6pt;
  }
  html.rm-print-snapshot .rm-snap-block {
    break-inside: avoid;
    padding: 8pt;
  }
  html.rm-print-snapshot .rm-decision-meta { grid-template-columns: 1fr; }
  html.rm-print-snapshot .rv-doc-footer,
  html.rm-print-snapshot .rv-cover { display: none !important; }

  /* 5-Minute Brief — cover + brief sections, same break policy as Full */
  html.rm-print-brief .rm-brief-chrome { break-inside: avoid; }
  html.rm-print-brief .rv-section { break-inside: auto; margin-bottom: 10pt; }
  html.rm-print-brief .rv-section-desc { display: none; }
  html.rm-print-brief .rv-evidence,
  html.rm-print-brief .rv-section-evidence-trail,
  html.rm-print-brief .ew-narrative-structured { display: none !important; }

  /* Full Board — no section clipping */
  html.rm-print-full .rv-section { break-inside: auto; }
  html.rm-print-full .rm-snapshot,
  html.rm-print-full .rm-brief-chrome { display: none !important; }

  .rm-health-score,
  .rm-dash-score,
  .rm-mode-btn.is-active {
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Light / dark text harmonization */
:root[data-theme="light"] .rm-snapshot-company,
:root[data-theme="light"] .rm-health-label,
:root[data-theme="light"] .rm-kpi-card strong,
:root[data-theme="light"] .rm-takeaway,
:root[data-theme="light"] .rm-dept-name,
:root[data-theme="light"] .rm-timeline-label,
:root[data-theme="light"] .rm-snap-mini-title,
:root[data-theme="light"] .rm-alert-item strong,
:root[data-theme="light"] .rm-health-dim-val {
  color: var(--text-strong, #0f172a);
}

:root[data-theme="dark"] .rm-snapshot-company,
:root[data-theme="dark"] .rm-health-label,
:root[data-theme="dark"] .rm-kpi-card strong,
:root[data-theme="dark"] .rm-takeaway,
:root[data-theme="dark"] .rm-dept-name,
:root[data-theme="dark"] .rm-timeline-label,
:root[data-theme="dark"] .rm-snap-mini-title,
:root[data-theme="dark"] .rm-alert-item strong,
:root[data-theme="dark"] .rm-health-dim-val {
  color: var(--text-strong, #f8fafc);
}

/* ── One-page executive brief (default Snapshot view) ── */
.rm-one-page-brief {
  margin: 0;
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid var(--border, rgba(0,0,0,.08));
  background: var(--surface, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  width: 100%;
  box-sizing: border-box;
}
.rm-opb-header {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.08));
}
.rm-opb-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-mute, #64748b);
  margin-bottom: 6px;
}
.rm-opb-score {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}
.rm-opb-score span {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-mute);
}
.rm-opb-health-label { font-size: 14px; font-weight: 600; color: var(--text-dim); }
.rm-opb-attn-count { font-size: 28px; font-weight: 800; color: var(--text-strong); }
.rm-opb-attn-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rm-opb-attn-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2, rgba(0,0,0,.02));
}
.rm-opb-attn-item strong { display: block; font-size: 13.5px; line-height: 1.4; color: var(--text-strong); }
.rm-opb-attn-ev { display: block; font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.rm-attn-good { border-left: 3px solid #22C55E; }
.rm-attn-watch { border-left: 3px solid #3B82F6; }
.rm-attn-critical { border-left: 3px solid #EF4444; }
.rm-opb-action {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(59,130,246,.06);
  border: 1px solid rgba(59,130,246,.15);
}
.rm-opb-action p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-strong); font-weight: 600; }
.rm-opb-confidence { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.rm-opb-conf-score { font-size: 13px; font-weight: 700; color: var(--text-strong); }
.rm-opb-conf-def { margin: 6px 0 0; font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.rm-opb-conf-lowers { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-dim); }

/* Semantic health — green high, blue neutral, red low */
.rm-health-score { font-weight: 800; }
.rm-timeline-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Compact KPI row under one-page brief */
.rm-brief-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.rm-brief-kpi {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(0,0,0,.08));
  background: var(--surface-solid, #fff);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.rm-brief-kpi-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-mute, #64748b);
}

.rm-brief-kpi-val {
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-strong, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-brief-drilldown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px dashed var(--border, rgba(0,0,0,.12));
  background: var(--surface-2, rgba(0,0,0,.02));
}

.rm-brief-drill-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim, #64748b);
  flex: 1;
  min-width: 200px;
}

.rm-brief-drill-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: var(--rm-orange, #F97316);
  transition: background .15s ease, transform .15s ease;
}

.rm-brief-drill-btn:hover {
  background: var(--rm-orange-hover, #FB923C);
}

@media (max-width: 767px) {
  .rm-brief-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.rm-view-snapshot #rv-content {
    padding: 0 12px 20px;
  }
}

/* ── ONE-PAGE EXECUTIVE BRIEF v2 (classified, interactive) ── */
.rm-eb-v2 {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rm-eb-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.rm-eb-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-mute, #64748b);
}

.rm-eb-health-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
}

.rm-eb-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.rm-eb-stat {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(0,0,0,.08));
  background: var(--surface-solid, #fff);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  text-align: left;
}

.rm-eb-stat.is-clickable {
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.rm-eb-stat.is-clickable:hover {
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08);
}

.rm-eb-stat.is-clickable.is-active {
  border-color: var(--rm-orange, #F97316);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.rm-eb-stat-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-mute, #64748b);
  line-height: 1.25;
}

.rm-eb-stat-val {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 800;
  line-height: 1;
  color: var(--eb-stat-color, var(--text-strong, #0f172a));
}

.rm-eb-panels {
  width: 100%;
}

.rm-eb-panel {
  display: none;
  animation: rmEbFade .2s ease;
}

.rm-eb-panel.is-active {
  display: block;
}

@keyframes rmEbFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.rm-eb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rm-eb-panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong, #0f172a);
}

.rm-eb-panel-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mute, #64748b);
}

.rm-eb-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rm-eb-card {
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 12px;
  background: var(--surface-solid, #fff);
  overflow: hidden;
}

.rm-eb-card.is-open {
  border-color: rgba(59, 130, 246, 0.25);
}

.rm-eb-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
}

.rm-eb-card-title {
  margin: 0;
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-strong, #0f172a);
}

.rm-eb-expand {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2, rgba(0,0,0,.03));
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
}

.rm-eb-expand-icon {
  font-size: 9px;
  transition: transform .15s ease;
}

.rm-eb-card.is-open .rm-eb-expand-icon {
  transform: rotate(180deg);
}

.rm-eb-jump {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--rm-orange, #F97316);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.rm-eb-card-body {
  padding: 0 16px 14px;
  border-top: 1px solid var(--border, rgba(0,0,0,.06));
}

.rm-eb-detail {
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rm-eb-detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  align-items: start;
}

.rm-eb-detail-row dt {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-mute, #64748b);
}

.rm-eb-detail-row dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim, #475569);
}

.rm-eb-empty {
  margin: 0;
  padding: 16px;
  border-radius: 10px;
  background: var(--surface-2, rgba(0,0,0,.02));
  font-size: 13px;
  color: var(--text-mute, #64748b);
  font-style: italic;
}

.rm-eb-confidence {
  padding-top: 12px;
  border-top: 1px dashed var(--border, rgba(0,0,0,.1));
}

.rm-eb-conf-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong, #0f172a);
}

.rm-eb-conf-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-dim, #64748b);
  line-height: 1.45;
}

.rm-eb-conf-lowers {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-dim, #64748b);
}

@media (max-width: 900px) {
  .rm-eb-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rm-eb-stat:first-child {
    grid-column: 1 / -1;
  }
  .rm-eb-detail-row {
    grid-template-columns: 1fr;
  }
}
