:root {
    --rm-bg: #06101d;
    --rm-bg-2: #091827;
    --rm-panel: rgba(12, 27, 45, .96);
    --rm-panel-2: rgba(8, 20, 35, .98);
    --rm-border: rgba(124, 168, 215, .17);
    --rm-border-strong: rgba(74, 165, 255, .5);
    --rm-text: #eef6ff;
    --rm-muted: #8ea6c0;
    --rm-subtle: #657b93;
    --rm-blue: #4aa5ff;
    --rm-cyan: #39d8ff;
    --rm-green: #42d69a;
    --rm-yellow: #f5c75c;
    --rm-orange: #ff9b59;
    --rm-red: #ff6379;
    --rm-purple: #a98cff;
    --rm-radius-lg: 18px;
    --rm-radius-md: 12px;
    --rm-radius-sm: 8px;
    --rm-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

body {
    background:
        radial-gradient(circle at 12% 0%, rgba(47, 127, 207, .17), transparent 31%),
        radial-gradient(circle at 88% 7%, rgba(57, 216, 255, .08), transparent 25%),
        linear-gradient(180deg, #050e19, #081522 48%, #050e19);
    color: var(--rm-text);
}

.rm-workspace { width: min(1840px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 48px; }
.rm-topbar, .rm-investigation-bar, .rm-source-strip, .rm-panel, .rm-investigation-console { border: 1px solid var(--rm-border); box-shadow: var(--rm-shadow); }
.rm-topbar { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; padding:20px 22px; border-radius:var(--rm-radius-lg); background:linear-gradient(135deg,rgba(15,36,59,.97),rgba(7,18,31,.98)); }
.rm-brand-row { display:flex; gap:12px; align-items:center; }
.rm-product-name { font-size:1.05rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:#fff; }
.rm-live-pill { display:inline-flex; align-items:center; gap:7px; border:1px solid rgba(66,214,154,.34); border-radius:999px; padding:5px 9px; color:#baf5d9; background:rgba(66,214,154,.08); font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; }
.rm-live-pill span { width:7px; height:7px; border-radius:50%; background:var(--rm-green); box-shadow:0 0 12px var(--rm-green); animation:rmPulse 1.5s ease-in-out infinite; }
.rm-brand-block h1 { margin:5px 0 4px; font-size:clamp(2rem,4vw,3.7rem); line-height:1; letter-spacing:-.05em; }
.rm-brand-block p { margin:0; color:var(--rm-muted); }
.rm-topbar-actions { display:flex; align-items:flex-end; justify-content:flex-end; gap:12px; flex-wrap:wrap; }
.rm-scenario-control { display:grid; gap:5px; color:var(--rm-subtle); font-size:.68rem; text-transform:uppercase; letter-spacing:.08em; }
.rm-scenario-control select { min-width:220px; height:42px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-sm); background:#081725; color:#fff; padding:0 12px; }
.rm-powered-by { width:100%; color:var(--rm-muted); font-size:.72rem; text-align:right; }
.rm-powered-by strong { color:#d8e8f8; }
.rm-button { border-radius:var(--rm-radius-sm); min-height:42px; padding:0 16px; font-weight:700; cursor:pointer; }
.rm-button--primary { border:0; color:#fff; background:linear-gradient(135deg,#318ce8,#35c8ed); box-shadow:0 10px 26px rgba(50,157,227,.22); }
.rm-button--secondary { border:1px solid var(--rm-border-strong); color:#dff3ff; background:rgba(29,83,132,.2); }
.rm-button:disabled { opacity:.55; cursor:not-allowed; }

.rm-investigation-bar { margin-top:14px; display:grid; grid-template-columns:minmax(260px,1.6fr) repeat(5,minmax(110px,.55fr)); gap:1px; border-radius:var(--rm-radius-md); overflow:hidden; background:var(--rm-border); }
.rm-investigation-bar > div { padding:13px 15px; background:rgba(8,21,36,.96); min-width:0; }
.rm-investigation-bar strong { display:block; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rm-status-item span { display:block; margin-bottom:3px; color:var(--rm-subtle); font-size:.64rem; text-transform:uppercase; letter-spacing:.08em; }
.rm-kicker { display:block; color:var(--rm-cyan); font-size:.63rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }

.rm-metrics { margin-top:14px; display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.rm-metric-card { padding:16px 18px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-md); background:linear-gradient(135deg,rgba(16,37,60,.95),rgba(8,20,35,.97)); box-shadow:var(--rm-shadow); }
.rm-metric-card > span { color:var(--rm-subtle); font-size:.68rem; text-transform:uppercase; letter-spacing:.08em; }
.rm-metric-card strong { display:block; margin:6px 0 3px; font-size:clamp(1.6rem,2.7vw,2.4rem); color:#fff; }
.rm-metric-card small { color:var(--rm-muted); }
.rm-metric-card--accent { border-color:rgba(57,216,255,.34); }

.rm-source-strip { margin-top:12px; display:grid; grid-template-columns:max-content minmax(0,1fr); align-items:center; overflow:hidden; border-radius:var(--rm-radius-md); background:rgba(7,18,31,.92); }
.rm-source-strip-label { position:relative; z-index:2; display:flex; gap:8px; align-items:center; align-self:stretch; padding:11px 14px; color:#dcecff; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; border-right:1px solid var(--rm-border); background:rgba(7,18,31,.98); white-space:nowrap; }
.rm-source-strip-label span { width:7px; height:7px; border-radius:50%; background:var(--rm-green); box-shadow:0 0 10px var(--rm-green); }
.rm-source-ticker { display:flex; gap:18px; width:max-content; min-width:max-content; padding:10px 18px; animation:rmTicker 28s linear infinite; will-change:transform; }
.rm-source-event { color:var(--rm-muted); font-size:.75rem; }
.rm-source-event strong { color:#fff; margin-right:5px; }
.rm-source-event em { color:var(--rm-green); font-style:normal; }

.rm-dashboard { margin-top:14px; display:grid; grid-template-columns:minmax(270px,.8fr) minmax(570px,1.8fr) minmax(330px,.95fr); gap:14px; align-items:start; }
.rm-center-column, .rm-right-column { display:grid; gap:14px; }
.rm-panel { overflow:hidden; border-radius:var(--rm-radius-lg); background:linear-gradient(180deg,rgba(14,32,53,.97),rgba(8,20,35,.98)); }
.rm-panel-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px 13px; border-bottom:1px solid rgba(124,168,215,.1); }
.rm-panel-header h2 { margin:3px 0 0; font-size:1rem; color:#fff; }
.rm-panel-meta { color:var(--rm-subtle); font-size:.68rem; }
.rm-signals-panel { position:sticky; top:12px; }
.rm-signals-list { display:grid; gap:9px; padding:12px; max-height:calc(100vh - 145px); overflow:auto; }
.rm-signal-card { width:100%; border:1px solid rgba(124,168,215,.12); border-radius:var(--rm-radius-md); background:rgba(6,17,30,.72); color:inherit; padding:13px; text-align:left; cursor:pointer; opacity:0; transform:translateY(8px); transition:.24s ease; }
.rm-signal-card.is-visible { opacity:1; transform:none; }
.rm-signal-card:hover, .rm-signal-card:focus-visible, .rm-signal-card.is-selected { outline:none; border-color:var(--rm-blue); background:linear-gradient(135deg,rgba(35,95,153,.25),rgba(7,18,31,.9)); box-shadow:inset 3px 0 0 var(--rm-blue),0 0 22px rgba(74,165,255,.12); }
.rm-signal-card.is-dimmed { opacity:.24; }

.rm-incoming-signal { display:flex; align-items:center; gap:9px; padding:11px 12px; border:1px dashed rgba(57,216,255,.3); border-radius:var(--rm-radius-sm); color:var(--rm-muted); background:rgba(57,216,255,.04); font-size:.72rem; }
.rm-incoming-signal span { width:8px; height:8px; border-radius:50%; background:var(--rm-cyan); box-shadow:0 0 12px var(--rm-cyan); animation:rmPulse 1.35s ease-in-out infinite; }
.rm-signal-card.is-incoming { box-shadow:inset 3px 0 0 var(--rm-cyan),0 0 28px rgba(57,216,255,.16); }
.rm-signal-card-head, .rm-signal-card-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.rm-signal-card h3 { margin:10px 0 7px; font-size:.88rem; line-height:1.35; color:#f6fbff; }
.rm-signal-card p { margin:0 0 10px; color:var(--rm-muted); font-size:.72rem; }
.rm-signal-card-head time, .rm-signal-card-foot { color:var(--rm-subtle); font-size:.66rem; }
.rm-impact-pill { border-radius:999px; padding:4px 7px; font-size:.61rem; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.impact-high { color:#ffbec7; background:rgba(255,99,121,.12); border:1px solid rgba(255,99,121,.3); }
.impact-medium { color:#ffe2a2; background:rgba(245,199,92,.1); border:1px solid rgba(245,199,92,.28); }
.impact-opportunity { color:#b9f6da; background:rgba(66,214,154,.1); border:1px solid rgba(66,214,154,.28); }
.impact-low { color:#c5daef; background:rgba(142,166,192,.09); border:1px solid rgba(142,166,192,.22); }

.rm-selected-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:20px 22px 13px; }
.rm-selected-header h2 { margin:4px 0 0; max-width:760px; font-size:clamp(1.25rem,2vw,1.9rem); line-height:1.2; color:#fff; }
.rm-confidence-ring { --confidence:0; width:76px; height:76px; flex:0 0 76px; border-radius:50%; display:grid; place-items:center; background:conic-gradient(var(--rm-cyan) calc(var(--confidence)*1%),rgba(255,255,255,.07) 0); position:relative; box-shadow:0 0 24px rgba(57,216,255,.16); }
.rm-confidence-ring::before { content:""; position:absolute; inset:7px; border-radius:50%; background:#0b1d30; }
.rm-confidence-ring span { position:relative; z-index:1; font-weight:800; }
.rm-selected-meta { display:flex; flex-wrap:wrap; gap:10px; padding:0 22px 14px; color:var(--rm-muted); font-size:.73rem; }
.rm-selected-summary { margin:0; padding:17px 22px; border-top:1px solid rgba(124,168,215,.09); border-bottom:1px solid rgba(124,168,215,.09); color:#dceafa; line-height:1.65; }
.rm-selected-grid { display:grid; grid-template-columns:1.35fr .65fr; gap:16px; padding:18px 22px 4px; }
.rm-selected-grid h3 { margin:0 0 8px; font-size:.82rem; color:#fff; }
.rm-selected-grid p { margin:0; color:var(--rm-muted); line-height:1.55; }
.rm-text-button { padding:0; border:0; background:none; color:var(--rm-cyan); cursor:pointer; font-weight:700; text-align:left; }
.rm-impact-assessment { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; padding:16px 22px 22px; }
.rm-impact-card { padding:12px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-sm); background:rgba(6,17,30,.55); }
.rm-impact-card span { display:block; color:var(--rm-muted); font-size:.68rem; }
.rm-impact-card strong { display:block; margin-top:5px; color:#fff; font-size:1.15rem; }
.rm-mini-bar { height:6px; margin-top:9px; border-radius:999px; overflow:hidden; background:rgba(255,255,255,.07); }
.rm-mini-bar i { display:block; height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg,var(--rm-blue),var(--rm-cyan)); transition:width .8s cubic-bezier(.22,1,.36,1); }

.rm-graph-stage { position:relative; min-height:520px; overflow:hidden; }
.rm-entity-graph { display:block; width:100%; height:520px; cursor:grab; }
.rm-entity-graph:active { cursor:grabbing; }
.rm-graph-tools { display:flex; align-items:center; gap:10px; }
.rm-graph-reset { padding:6px 10px; border:1px solid var(--rm-border); border-radius:999px; background:rgba(5,16,28,.76); color:#dcecff; font-size:.68rem; cursor:pointer; }
.rm-graph-reset:hover, .rm-graph-reset:focus-visible { border-color:var(--rm-cyan); color:#fff; outline:none; }
.rm-graph-link { stroke:rgba(117,164,210,.45); stroke-width:1.35; vector-effect:non-scaling-stroke; }
.rm-graph-link.is-highlighted { stroke:var(--rm-cyan); stroke-width:2.4; filter:drop-shadow(0 0 4px rgba(57,216,255,.75)); }
.rm-graph-link.is-dimmed { opacity:.12; }
.rm-graph-link-label { fill:#7893af; font-size:9px; pointer-events:none; }
.rm-node { cursor:pointer; outline:none; }
.rm-node .halo { fill:rgba(74,165,255,.07); stroke:rgba(74,165,255,.16); stroke-width:1.2; vector-effect:non-scaling-stroke; }
.rm-node .core { fill:#163755; stroke:var(--rm-blue); stroke-width:1.5; vector-effect:non-scaling-stroke; }
.rm-node .icon { fill:#edf7ff; font-weight:800; font-size:14px; pointer-events:none; }
.rm-node .name { fill:#f4f9ff; font-size:10px; font-weight:800; pointer-events:none; }
.rm-node .type { fill:#7893af; font-size:8px; pointer-events:none; }
.rm-node.entity-government .core { fill:rgba(169,140,255,.24); stroke:var(--rm-purple); }
.rm-node.entity-law-firm .core { fill:rgba(66,214,154,.2); stroke:var(--rm-green); }
.rm-node.entity-practice .core { fill:rgba(245,199,92,.18); stroke:var(--rm-yellow); }
.rm-node.entity-person .core { fill:rgba(255,155,89,.2); stroke:var(--rm-orange); }
.rm-node.is-selected .halo, .rm-node.is-highlighted .halo { fill:rgba(57,216,255,.16); stroke:rgba(57,216,255,.72); animation:rmNodePulse 1.4s ease-in-out infinite; }
.rm-node.is-dimmed { opacity:.16; }
.rm-node.is-hot .halo { filter:drop-shadow(0 0 8px rgba(255,99,121,.7)); }
.rm-entity-drawer { position:absolute; top:0; right:0; width:min(410px,92%); height:100%; overflow:auto; padding:20px; background:rgba(5,15,27,.98); border-left:1px solid var(--rm-border-strong); transform:translateX(102%); transition:transform .3s ease; box-shadow:-22px 0 50px rgba(0,0,0,.34); z-index:4; }
.rm-entity-drawer.is-open { transform:none; }
.rm-entity-drawer-close { position:sticky; top:0; float:right; z-index:2; }
.rm-entity-header h2 { margin:5px 0 3px; color:#fff; }
.rm-entity-subtitle { margin:0; color:var(--rm-muted); }
.rm-entity-summary { color:#dceafa; line-height:1.6; }
.rm-entity-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:14px 0; }
.rm-entity-metric { padding:10px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-sm); background:rgba(10,29,48,.72); }
.rm-entity-metric span { display:block; color:var(--rm-subtle); font-size:.62rem; text-transform:uppercase; }
.rm-entity-metric strong { display:block; margin-top:5px; color:#fff; }
.rm-drawer-section { margin-top:18px; }
.rm-drawer-section h3 { margin:0 0 9px; font-size:.82rem; color:#fff; }
.rm-drawer-list { display:grid; gap:7px; margin:0; padding:0; list-style:none; }
.rm-drawer-link, .rm-drawer-item { width:100%; display:flex; justify-content:space-between; gap:10px; align-items:center; padding:9px 10px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-sm); background:rgba(8,23,39,.72); color:#dcecff; text-decoration:none; font-size:.74rem; }
button.rm-drawer-link { cursor:pointer; }
.rm-reasoning-path { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.rm-reasoning-step { padding:6px 8px; border-radius:999px; background:rgba(74,165,255,.1); color:#dcefff; font-size:.68rem; }
.rm-reasoning-arrow { color:var(--rm-cyan); }

.rm-ready-pill { color:#baf6d9; background:rgba(66,214,154,.09); border-radius:999px; padding:5px 8px; font-size:.62rem; }
.rm-analyst-content { padding:16px 18px; }
.rm-analyst-content p { margin:0; color:#dceafa; line-height:1.6; }
.rm-evidence-list { display:grid; gap:9px; margin:15px 0 0; padding:0; list-style:none; }
.rm-evidence-list li { display:flex; gap:8px; color:var(--rm-muted); font-size:.75rem; line-height:1.4; }
.rm-evidence-list b { color:var(--rm-green); }
.rm-actions-list { display:grid; gap:8px; padding:12px; }
.rm-action-button { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%; padding:11px 12px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-sm); background:rgba(6,17,30,.68); color:#dcecff; cursor:pointer; text-align:left; transition:.18s ease; }
.rm-action-button:hover, .rm-action-button:focus-visible { outline:none; border-color:var(--rm-blue); transform:translateX(2px); background:rgba(36,92,145,.2); }
.rm-action-button span:last-child { color:var(--rm-blue); font-size:1.05rem; }
.rm-activity-feed { display:grid; gap:9px; padding:14px 16px 17px; }
.rm-activity-item { display:flex; gap:8px; align-items:flex-start; color:var(--rm-muted); font-size:.72rem; opacity:.45; transition:.25s ease; }
.rm-activity-item.is-active { opacity:1; color:#dceafa; }
.rm-activity-item b { color:var(--rm-green); }
.rm-timeline { margin:0; padding:14px 16px 18px; list-style:none; }
.rm-timeline li { display:grid; grid-template-columns:62px 13px 1fr; gap:8px; min-height:54px; }
.rm-timeline time { color:var(--rm-subtle); font-size:.64rem; }
.rm-timeline-marker { position:relative; width:8px; height:8px; border-radius:50%; background:var(--rm-blue); box-shadow:0 0 8px var(--rm-blue); }
.rm-timeline-marker::after { content:""; position:absolute; top:12px; left:3px; height:40px; width:1px; background:var(--rm-border); }
.rm-timeline li:last-child .rm-timeline-marker::after { display:none; }
.rm-timeline strong { display:block; color:#dcecff; font-size:.72rem; line-height:1.35; }
.rm-timeline small { display:block; margin-top:3px; color:var(--rm-subtle); }
.rm-timeline li.is-highlighted strong { color:#fff; }
.rm-timeline li.is-dimmed { opacity:.25; }

.rm-investigation-console { margin-top:14px; display:grid; grid-template-columns:minmax(260px,.7fr) minmax(520px,1.6fr); gap:24px; padding:22px; border-radius:var(--rm-radius-lg); background:linear-gradient(135deg,rgba(19,48,79,.96),rgba(7,18,31,.98)); }
.rm-console-copy h2 { margin:4px 0 8px; font-size:1.45rem; }
.rm-console-copy p { margin:0; color:var(--rm-muted); line-height:1.55; }
.rm-investigation-chips { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:11px; }
.rm-investigation-chip { border:1px solid var(--rm-border); border-radius:999px; background:rgba(6,17,30,.65); color:#dcecff; padding:8px 11px; cursor:pointer; font-size:.72rem; }
.rm-investigation-chip:hover, .rm-investigation-chip.is-active { border-color:var(--rm-cyan); background:rgba(57,216,255,.1); }
.rm-investigation-form { display:flex; gap:9px; }
.rm-investigation-form input { flex:1; min-width:0; height:46px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-sm); background:#061321; color:#fff; padding:0 14px; outline:none; }
.rm-investigation-form input:focus { border-color:var(--rm-blue); box-shadow:0 0 0 3px rgba(74,165,255,.12); }
.rm-investigation-progress, .rm-investigation-result { margin-top:13px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-md); background:rgba(5,16,28,.68); padding:15px; }
.rm-progress-step { color:var(--rm-muted); font-size:.75rem; margin:5px 0; }
.rm-progress-step.is-complete { color:#dceafa; }
.rm-progress-step.is-complete::before { content:"✓ "; color:var(--rm-green); }
.rm-investigation-result h3 { margin:0 0 7px; color:#fff; }
.rm-investigation-result p { color:var(--rm-muted); line-height:1.55; }
.rm-result-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.rm-result-stat { padding:9px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-sm); }
.rm-result-stat span { display:block; color:var(--rm-subtle); font-size:.62rem; text-transform:uppercase; }
.rm-result-stat strong { display:block; margin-top:4px; }

.rm-icon-button { width:36px; height:36px; border:1px solid var(--rm-border); border-radius:50%; background:rgba(5,16,28,.92); color:#fff; cursor:pointer; font-size:1.15rem; }
.rm-modal-backdrop { position:fixed; inset:0; background:rgba(0,6,13,.76); backdrop-filter:blur(5px); z-index:1000; }
.rm-dialog { position:fixed; inset:0; margin:auto; width:min(680px,calc(100% - 28px)); max-height:88vh; overflow:auto; border:1px solid var(--rm-border-strong); border-radius:var(--rm-radius-lg); background:linear-gradient(180deg,#0c2238,#071522); color:var(--rm-text); box-shadow:0 30px 90px rgba(0,0,0,.55); padding:24px; z-index:1001; }
.rm-dialog::backdrop { background:transparent; }
.rm-dialog--wide { width:min(900px,calc(100% - 28px)); }
.rm-dialog--brief { width:min(980px,calc(100% - 28px)); }
.rm-dialog-close { float:right; margin:-10px -10px 8px 12px; }
.rm-dialog h2 { margin:4px 0 6px; color:#fff; }
.rm-dialog h3 { color:#fff; font-size:.88rem; }
.rm-dialog p { color:var(--rm-muted); line-height:1.6; }
.rm-dialog-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.rm-dialog-card { padding:13px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-md); background:rgba(5,16,28,.62); }
.rm-dialog-list { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.rm-dialog-list li { color:var(--rm-muted); font-size:.76rem; }
.rm-dialog-list li::before { content:"✓ "; color:var(--rm-green); }
.rm-dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.rm-action-running { display:grid; gap:8px; margin-top:16px; }
.rm-action-running span { color:var(--rm-muted); }
.rm-action-running span.is-complete { color:#dceafa; }
.rm-action-running span.is-complete::before { content:"✓ "; color:var(--rm-green); }
.rm-evidence-card { margin-top:10px; padding:14px; border:1px solid var(--rm-border); border-radius:var(--rm-radius-md); background:rgba(5,16,28,.65); }
.rm-evidence-card-head { display:flex; justify-content:space-between; gap:14px; }
.rm-evidence-card h3 { margin:0; }
.rm-evidence-meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:7px; color:var(--rm-subtle); font-size:.67rem; }
.rm-evidence-score { color:var(--rm-cyan); font-weight:800; }
.rm-brief-header { padding-bottom:14px; border-bottom:1px solid var(--rm-border); }
.rm-brief-section { margin-top:18px; }
.rm-brief-section h3 { margin-bottom:8px; }
.rm-brief-findings { display:grid; gap:9px; }
.rm-brief-finding { padding:11px; border-left:3px solid var(--rm-blue); background:rgba(5,16,28,.58); }

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

@keyframes rmPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.55);opacity:.55} }
@keyframes rmNodePulse { 0%,100%{opacity:.65} 50%{opacity:1} }
@keyframes rmTicker { from{transform:translateX(0)} to{transform:translateX(-45%)} }

@media (max-width:1450px) {
    .rm-dashboard { grid-template-columns:minmax(250px,.75fr) minmax(520px,1.65fr); }
    .rm-right-column { grid-column:1/-1; grid-template-columns:repeat(4,1fr); }
    .rm-signals-panel { position:static; }
    .rm-signals-list { max-height:none; }
}
@media (max-width:1050px) {
    .rm-topbar, .rm-investigation-console { grid-template-columns:1fr; flex-direction:column; }
    .rm-topbar-actions { justify-content:flex-start; }
    .rm-powered-by { text-align:left; }
    .rm-investigation-bar { grid-template-columns:repeat(3,1fr); }
    .rm-investigation-bar > div:first-child { grid-column:1/-1; }
    .rm-metrics { grid-template-columns:repeat(2,1fr); }
    .rm-dashboard, .rm-right-column { grid-template-columns:1fr; }
    .rm-source-strip { align-items:stretch; }
    .rm-source-strip-label { display:none; }
}
@media (max-width:700px) {
    .rm-workspace { width:min(100% - 18px,1840px); }
    .rm-topbar-actions, .rm-investigation-form, .rm-selected-header { align-items:stretch; flex-direction:column; }
    .rm-scenario-control select { width:100%; min-width:0; }
    .rm-investigation-bar, .rm-metrics, .rm-selected-grid, .rm-impact-assessment, .rm-investigation-console, .rm-dialog-grid, .rm-result-stats { grid-template-columns:1fr; }
    .rm-confidence-ring { width:68px; height:68px; }
    .rm-graph-stage, .rm-entity-graph { min-height:420px; height:420px; }
    .rm-entity-drawer { width:100%; }
}
@media (prefers-reduced-motion:reduce) {
    *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; scroll-behavior:auto!important; }
}

/* Live connector controls */
.rm-source-strip-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto;
    gap: 7px;
    overflow: hidden;
}

.rm-source-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
    padding: 0 12px 7px;
}

.rm-live-source-status {
    margin-right: auto;
    color: var(--rm-muted, #8ea6c0);
    font-size: .68rem;
}

.rm-source-health {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.rm-source-health-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--rm-muted, #8ea6c0);
    font-size: .65rem;
    white-space: nowrap;
}

.rm-source-health-item i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #42d69a;
    box-shadow: 0 0 8px rgba(66, 214, 154, .6);
}

.rm-source-health-item.status-delayed i,
.rm-source-health-item.status-rate-limited i,
.rm-source-health-item.status-configured i {
    background: #f6c85f;
    box-shadow: 0 0 8px rgba(246, 200, 95, .55);
}

.rm-source-health-item.status-unavailable i,
.rm-source-health-item.status-configuration-required i {
    background: #ff6278;
    box-shadow: 0 0 8px rgba(255, 98, 120, .55);
}

.rm-source-health-item.status-disabled i {
    background: #687f99;
    box-shadow: none;
}

.rm-source-pause {
    padding: 5px 9px;
    border: 1px solid rgba(125, 168, 214, .22);
    border-radius: 7px;
    background: rgba(7, 18, 32, .72);
    color: #dcecff;
    font-size: .65rem;
    white-space: nowrap;
    cursor: pointer;
}

.rm-source-pause:hover,
.rm-source-pause:focus-visible {
    border-color: #54a5ff;
    outline: none;
}

.rm-new-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(66, 214, 154, .14);
    border: 1px solid rgba(66, 214, 154, .35);
    color: #baf7db;
    font-size: .56rem;
    line-height: 1;
    text-transform: uppercase;
    vertical-align: middle;
    animation: rmNewBadgeFade 12s ease forwards;
}

@keyframes rmNewBadgeFade {
    0%, 70% { opacity: 1; }
    100% { opacity: .28; }
}

.rm-source-event[data-status="rate-limited"] {
    color: #f6c85f;
}

.rm-source-event[data-status="configuration-required"],
.rm-source-event[data-status="unavailable"] {
    opacity: .72;
}

@media (max-width: 900px) {
    .rm-source-controls {
        align-items: flex-start;
        flex-direction: column;
    }

    .rm-source-health {
        justify-content: flex-start;
    }
}

.rm-evidence-source-link {
    display: inline-flex;
    margin-top: 12px;
    color: #6fc5ff;
    font-size: .75rem;
    font-weight: 650;
    text-decoration: none;
}

.rm-evidence-source-link:hover,
.rm-evidence-source-link:focus-visible {
    color: #ffffff;
    text-decoration: underline;
    outline: none;
}


/* Live-source correlation and graph evolution */
.rm-live-intelligence-band {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    gap: 14px;
    margin: 12px 0 18px;
}

.rm-live-timeline-wrap,
.rm-live-correlation {
    border: 1px solid var(--rm-border, rgba(121, 164, 208, .18));
    border-radius: 14px;
    background: rgba(8, 20, 35, .78);
    padding: 13px 15px;
    min-width: 0;
}

.rm-live-source-timeline {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    padding-top: 9px;
    scrollbar-width: thin;
}

.rm-live-timeline-event {
    position: relative;
    flex: 0 0 min(190px, 42vw);
    padding: 7px 18px 5px 16px;
    border-left: 1px solid rgba(91, 169, 255, .28);
}

.rm-live-timeline-event::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rm-cyan, #35d5ff);
    box-shadow: 0 0 12px rgba(53, 213, 255, .7);
}

.rm-live-timeline-event time,
.rm-live-timeline-event small {
    display: block;
    color: var(--rm-muted, #8fa7c1);
    font-size: .68rem;
}

.rm-live-timeline-event strong {
    display: block;
    margin: 3px 0;
    color: #eef7ff;
    font-size: .78rem;
}

.rm-live-timeline-event.is-rainmaker::before {
    background: var(--rm-green, #42d69a);
    box-shadow: 0 0 14px rgba(66, 214, 154, .8);
}

.rm-live-correlation[hidden] { display: none; }
.rm-live-correlation {
    border-color: rgba(66, 214, 154, .3);
    background: linear-gradient(135deg, rgba(19, 65, 65, .38), rgba(8, 20, 35, .92));
    animation: rmCorrelationEnter .45s ease both;
}
.rm-live-correlation strong { display: block; margin: 5px 0 7px; color: #fff; }
.rm-live-correlation p { margin: 0; color: var(--rm-muted, #8fa7c1); font-size: .8rem; line-height: 1.5; }
.rm-correlation-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rm-correlation-sources span { padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(66,214,154,.25); color: #baf7db; font-size: .65rem; }

.rm-graph-delta {
    padding: 4px 8px;
    border-radius: 999px;
    color: #baf7db;
    background: rgba(66, 214, 154, .1);
    border: 1px solid rgba(66, 214, 154, .28);
    font-size: .68rem;
    white-space: nowrap;
}
.rm-graph-delta.is-visible { animation: rmGraphDelta 2.8s ease both; }
.rm-node.is-live-pulse .halo { animation: rmNodeLivePulse 1.1s ease-in-out 3; }
.rm-graph-link.is-live-trace { animation: rmLiveTrace 1.8s ease both; }

@keyframes rmCorrelationEnter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rmGraphDelta { 0% { opacity: 0; transform: translateY(4px); } 12%,78% { opacity: 1; transform: none; } 100% { opacity: .72; } }
@keyframes rmNodeLivePulse { 0%,100% { transform: scale(1); opacity: .65; } 50% { transform: scale(1.32); opacity: 1; filter: drop-shadow(0 0 12px #35d5ff); } }
@keyframes rmLiveTrace { 0% { stroke-dasharray: 0 200; stroke: #35d5ff; } 100% { stroke-dasharray: 200 0; stroke: rgba(117,164,210,.65); } }

@media (max-width: 900px) {
    .rm-live-intelligence-band { grid-template-columns: 1fr; }
}

/* Compact monitoring column and promoted graph layout */
.rm-dashboard {
    grid-template-columns: minmax(280px, .78fr) minmax(470px, 1.12fr) minmax(540px, 1.35fr);
}

.rm-center-column,
.rm-right-column {
    align-content: start;
}

.rm-signals-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 24px);
}

.rm-signals-list {
    flex: 1 1 auto;
    min-height: 260px;
    max-height: 52vh;
}

.rm-monitoring-timeline {
    flex: 0 0 auto;
    padding: 13px 14px 14px;
    border-top: 1px solid rgba(124, 168, 215, .12);
    background: rgba(5, 16, 28, .4);
}

.rm-monitoring-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.rm-monitoring-timeline-header h3 {
    margin: 3px 0 0;
    color: #fff;
    font-size: .86rem;
}

.rm-monitoring-timeline .rm-live-source-timeline {
    display: grid;
    gap: 0;
    max-height: 190px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2px 2px 2px 5px;
}

.rm-monitoring-timeline .rm-live-timeline-event {
    flex: none;
    width: 100%;
    min-width: 0;
    padding: 7px 8px 9px 16px;
    border-left: 1px solid rgba(91, 169, 255, .28);
}

.rm-monitoring-timeline .rm-live-timeline-event::before {
    top: 11px;
}

.rm-monitoring-timeline .rm-live-correlation {
    margin-top: 10px;
    padding: 11px 12px;
    border-radius: 10px;
}

.rm-monitoring-timeline .rm-live-correlation strong {
    font-size: .8rem;
}

.rm-monitoring-timeline .rm-live-correlation p {
    font-size: .72rem;
}

.rm-monitoring-timeline .rm-correlation-sources {
    margin-top: 8px;
}

.rm-graph-panel .rm-graph-stage {
    min-height: 500px;
}

.rm-graph-panel .rm-entity-graph {
    height: 500px;
}

@media (max-width: 1450px) {
    .rm-dashboard {
        grid-template-columns: minmax(270px, .72fr) minmax(470px, 1.28fr);
    }

    .rm-right-column {
        grid-column: 1 / -1;
        grid-template-columns: minmax(540px, 1.65fr) repeat(3, minmax(220px, .72fr));
        align-items: start;
    }

    .rm-signals-panel {
        position: sticky;
        max-height: calc(100vh - 24px);
    }

    .rm-signals-list {
        max-height: 48vh;
    }
}

@media (max-width: 1180px) {
    .rm-dashboard {
        grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
    }

    .rm-right-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rm-graph-panel {
        grid-column: 1 / -1;
    }

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

@media (max-width: 1050px) {
    .rm-dashboard,
    .rm-right-column {
        grid-template-columns: 1fr;
    }

    .rm-signals-panel {
        position: static;
        max-height: none;
    }

    .rm-signals-list {
        min-height: 0;
        max-height: none;
    }

    .rm-graph-panel,
    .rm-timeline-panel {
        grid-column: auto;
    }

    .rm-monitoring-timeline .rm-live-source-timeline {
        max-height: 230px;
    }
}

/* Signal Development now follows the Reasoning Layer in the center column. */
.rm-center-column > .rm-timeline-panel {
    grid-column: auto;
}

.rm-center-column > .rm-timeline-panel .rm-timeline {
    max-height: 310px;
    overflow-y: auto;
}

@media (max-width: 1180px) {
    .rm-center-column > .rm-timeline-panel {
        grid-column: auto;
    }
}

/* Responsive stacking guard: prevent the graph column from occupying the
   monitoring row or rendering beneath the sticky monitoring panel. */
.rm-dashboard,
.rm-center-column,
.rm-right-column,
.rm-graph-panel,
.rm-graph-stage {
    min-width: 0;
}

.rm-panel {
    position: relative;
    isolation: isolate;
}

@media (max-width: 1450px) {
    .rm-dashboard {
        grid-template-columns: minmax(270px, .72fr) minmax(0, 1.28fr);
        grid-auto-flow: row;
    }

    .rm-signals-panel {
        grid-column: 1;
        grid-row: 1;
        position: static;
        z-index: auto;
        max-height: none;
    }

    .rm-center-column {
        grid-column: 2;
        grid-row: 1;
    }

    .rm-right-column {
        grid-column: 1 / -1;
        grid-row: 2;
        position: relative;
        z-index: 0;
    }
}

@media (max-width: 1050px) {
    .rm-dashboard {
        grid-template-columns: minmax(0, 1fr);
    }

    .rm-signals-panel {
        grid-column: 1;
        grid-row: 1;
    }

    .rm-center-column {
        grid-column: 1;
        grid-row: 2;
    }

    .rm-right-column {
        grid-column: 1;
        grid-row: 3;
    }

    .rm-graph-stage {
        overflow: hidden;
    }
}

/* Priority-first intelligence hierarchy ------------------------------------------------ */
.rm-metric-card--live {
    border-color: rgba(66, 214, 154, .36);
    background: linear-gradient(135deg, rgba(15, 57, 58, .88), rgba(8, 20, 35, .98));
}

.rm-metric-card--live strong {
    color: #d8ffef;
    text-shadow: 0 0 18px rgba(66, 214, 154, .18);
}

.rm-metric-card--live.is-incrementing {
    animation: rmEventIncrement 1.25s ease both;
}

@keyframes rmEventIncrement {
    0% { border-color: rgba(66, 214, 154, .35); box-shadow: var(--rm-shadow); }
    18% { border-color: rgba(66, 214, 154, .95); box-shadow: 0 0 0 1px rgba(66,214,154,.28), 0 0 32px rgba(66,214,154,.28); transform: translateY(-2px); }
    100% { border-color: rgba(66, 214, 154, .36); box-shadow: var(--rm-shadow); transform: none; }
}

.rm-priority-band {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(330px, .7fr);
    gap: 14px;
    margin-top: 14px;
    align-items: stretch;
}

.rm-priority-panel,
.rm-impact-panel {
    min-width: 0;
}

.rm-priority-header {
    border-bottom: 0;
    padding-bottom: 8px;
}

.rm-priority-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255, 99, 121, .28);
    border-radius: 999px;
    background: rgba(255, 99, 121, .08);
    color: #ffc5cd;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.rm-priority-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 0 18px 12px;
    overflow: hidden;
    border: 1px solid rgba(124, 168, 215, .12);
    border-radius: 10px;
    background: rgba(124, 168, 215, .1);
}

.rm-priority-stats > div {
    padding: 10px 12px;
    background: rgba(5, 16, 28, .88);
}

.rm-priority-stats strong {
    display: block;
    color: #fff;
    font-size: 1.05rem;
}

.rm-priority-stats span {
    display: block;
    margin-top: 2px;
    color: var(--rm-subtle);
    font-size: .61rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.rm-priority-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 14px 14px;
}

.rm-priority-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 230px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid rgba(124, 168, 215, .16);
    border-radius: 13px;
    background: linear-gradient(155deg, rgba(18, 42, 68, .92), rgba(5, 16, 28, .94));
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.rm-priority-card::after {
    content: "";
    position: absolute;
    inset: auto -25% -65% 35%;
    height: 130px;
    background: radial-gradient(circle, rgba(57,216,255,.12), transparent 68%);
    pointer-events: none;
}

.rm-priority-card:hover,
.rm-priority-card:focus-visible {
    outline: none;
    transform: translateY(-3px);
    border-color: rgba(74, 165, 255, .72);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .25), 0 0 24px rgba(74, 165, 255, .1);
}

.rm-priority-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rm-priority-rank {
    color: rgba(57, 216, 255, .68);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .1em;
}

.rm-priority-card h3 {
    margin: 12px 0 9px;
    color: #fff;
    font-size: .95rem;
    line-height: 1.35;
}

.rm-priority-card > p {
    margin: 10px 0 14px;
    color: var(--rm-muted);
    font-size: .73rem;
    line-height: 1.5;
}

.rm-priority-orgs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.rm-priority-orgs span {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #dfefff;
    font-size: .62rem;
}

.rm-priority-source-line {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(124, 168, 215, .1);
}

.rm-priority-source-line > strong {
    display: block;
    margin-bottom: 7px;
    color: #bfe5ff;
    font-size: .63rem;
    font-weight: 700;
}

.rm-source-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.rm-source-badges i {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 6px;
    border: 1px solid rgba(57, 216, 255, .21);
    border-radius: 5px;
    background: rgba(57, 216, 255, .055);
    color: #9deaff;
    font-size: .55rem;
    font-style: normal;
    font-weight: 850;
    letter-spacing: .05em;
}

.rm-source-badges--selected {
    padding: 0 22px 14px;
}

.rm-impact-organizations {
    display: grid;
    gap: 8px;
    padding: 12px 14px 14px;
}

.rm-impact-organization {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
    align-items: start;
    padding: 11px 12px;
    border: 1px solid rgba(124,168,215,.13);
    border-radius: 10px;
    background: rgba(5, 16, 28, .64);
}

.rm-impact-organization strong {
    display: block;
    color: #fff;
    font-size: .77rem;
}

.rm-impact-role {
    display: block;
    margin-top: 2px;
    color: var(--rm-cyan);
    font-size: .61rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.rm-impact-organization p {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    color: var(--rm-muted);
    font-size: .68rem;
    line-height: 1.4;
}

.rm-brief-impact {
    margin-top: 16px;
    padding: 15px;
    border: 1px solid rgba(255, 99, 121, .25);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(72, 27, 42, .32), rgba(5, 16, 28, .76));
}

.rm-brief-impact-heading h3 {
    margin: 3px 0 11px;
    font-size: 1rem;
}

.rm-brief-impact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.rm-brief-impact-card {
    padding: 10px 11px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 9px;
    background: rgba(5, 16, 28, .62);
}

.rm-brief-impact-card > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rm-brief-impact-card strong {
    color: #fff;
    font-size: .76rem;
}

.rm-brief-impact-card p {
    margin: 6px 0 0;
    font-size: .69rem;
    line-height: 1.4;
}

@media (max-width: 1320px) {
    .rm-priority-band { grid-template-columns: 1fr; }
    .rm-impact-organizations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .rm-priority-cards { grid-template-columns: 1fr; }
    .rm-priority-card { min-height: 0; }
    .rm-impact-organizations { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .rm-priority-stats,
    .rm-brief-impact-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .rm-metric-card--live.is-incrementing,
    .rm-priority-card { animation: none; transition: none; }
}

.rm-priority-audience {
    margin: 5px 0 0;
    max-width: 760px;
    font-size: .82rem;
    line-height: 1.45;
    color: var(--rm-muted);
}
