/* Scoped to the shared review component and its standalone shell. */
.nr-root {
  --nr-bg: #080b10;
  --nr-surface: #0e151d;
  --nr-raised: #131e28;
  --nr-line: #2a3947;
  --nr-muted: #a4b3c1;
  --nr-text: #edf2f8;
  --nr-mint: #67e6bc;
  color: var(--nr-text);
  color-scheme: dark;
  font-size: 14px;
  line-height: 1.55;
  min-width: 0;
}
.nr-root *, .nr-root *::before, .nr-root *::after { box-sizing: border-box; }
.nr-root [hidden], #review[hidden] { display: none !important; }
.nr-root h2, .nr-root h3, .nr-root h4, .nr-root p { margin: 0; }
.nr-root h2 { font-size: clamp(24px, 2.5vw, 34px); line-height: 1.2; letter-spacing: -.035em; }
.nr-root h3 { font-size: 20px; line-height: 1.3; }
.nr-root h4 { font-size: 15px; }
.nr-root p, .nr-root small, .nr-root strong, .nr-root dd { overflow-wrap: anywhere; }
.nr-root button, .nr-root input, .nr-root select, .nr-root textarea { font: inherit; }
.nr-root button, .nr-root select, .nr-root summary { cursor: pointer; }
.nr-root :is(button, a, input, select, textarea, summary, video):focus-visible,
.nr-standalone :is(a, button):focus-visible { outline: 2px solid #67e6bc; outline-offset: 4px; }
.nr-root :is(input, select, textarea)[aria-invalid="true"] { border-color: #ff9199; }
.nr-root :is(button, input, select, textarea):disabled { cursor: not-allowed; opacity: .55; }
.nr-root fieldset:disabled { opacity: .7; }
.nr-root fieldset { margin: 0; min-width: 0; }
.nr-root legend { padding: 0 6px; color: var(--nr-text); font-size: 15px; font-weight: 700; }
.nr-root a { color: var(--nr-mint); }
.nr-muted { color: var(--nr-muted); }
.nr-root .nr-eyebrow { color: var(--nr-mint); font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.nr-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.nr-header > div:first-child { display: grid; gap: 10px; }
.nr-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 400px; }
.nr-badge { color: var(--nr-mint); background: #12251f; border: 1px solid #30574a; border-radius: 999px; padding: 6px 12px; font-size: 12px; }
.nr-header-actions .nr-badge { margin-bottom: 4px; }
.nr-root .nr-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 13px; border: 1px solid var(--nr-line); border-radius: 9px;
  background: var(--nr-raised); color: var(--nr-text); font-size: 12px; font-weight: 650;
  text-decoration: none; line-height: 1.4; transition: border-color .15s, background .15s;
}
.nr-root .nr-button:not(:disabled):hover { border-color: #65998a; background: #1a2b32; }
.nr-root .nr-primary { background: var(--nr-mint); color: #082018; border-color: var(--nr-mint); }
.nr-root .nr-primary:not(:disabled):hover { background: #8ceecf; }
.nr-root .nr-subtle { background: transparent; color: var(--nr-muted); }
.nr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.nr-stat { display: grid; gap: 2px; border: 1px solid var(--nr-line); border-radius: 12px; padding: 15px 18px; background: linear-gradient(145deg, #111d25, #0d141c); }
.nr-stat strong { font-size: 25px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.nr-stat span { font-size: 12px; }
.nr-progress { grid-column: 1 / -1; width: 100%; height: 4px; border: 0; border-radius: 4px; overflow: hidden; appearance: none; background: #1b2934; accent-color: var(--nr-mint); }
.nr-progress::-webkit-progress-bar { background: #1b2934; }
.nr-progress::-webkit-progress-value { background: var(--nr-mint); }
.nr-progress::-moz-progress-bar { background: var(--nr-mint); }
.nr-steps { counter-reset: review-step; display: flex; flex-wrap: wrap; gap: 12px 24px; list-style: none; padding: 0; margin: 0 0 20px; color: var(--nr-muted); font-size: 12px; }
.nr-steps li { counter-increment: review-step; display: flex; align-items: center; gap: 8px; }
.nr-steps li::before { content: counter(review-step); display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border: 1px solid #345347; border-radius: 50%; color: var(--nr-mint); font-weight: 700; }
.nr-message { border: 1px solid #335246; border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; background: #10211d; overflow-wrap: anywhere; }
.nr-root .nr-qa-notice { padding: 14px 18px; margin: 0 0 18px; color: #f8d9ab; background: #2a2115; border: 1px solid #93703b; border-radius: 10px; font-size: 13px; font-weight: 650; }
.nr-root .nr-error { border-color: #71434b; color: #ffb4ba; background: #281a20; }
.nr-root .nr-success { color: #a4f1d7; }
.nr-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 20px; }
.nr-cases { min-width: 0; padding: 16px; border: 1px solid var(--nr-line); border-radius: 14px; background: var(--nr-surface); }
.nr-cases > p { font-size: 12px; margin: 8px 0 16px; }
.nr-case-list { display: grid; gap: 7px; list-style: none; padding: 0 4px 0 0; margin: 14px 0 0; max-height: 790px; overflow-y: auto; scrollbar-color: #385245 transparent; scrollbar-width: thin; }
.nr-root .nr-case { display: grid; justify-content: stretch; justify-items: start; gap: 5px; width: 100%; text-align: left; padding: 13px 12px; background: #0b1219; border-color: transparent; font-weight: 400; }
.nr-case strong { font-size: 13px; }
.nr-case > span, .nr-case > small { font-size: 11px; }
.nr-root .nr-case.nr-selected { background: #142720; border-color: #5ba990; box-shadow: inset 3px 0 #67e6bc; }
.nr-target { color: #d4e0ec; }
.nr-saved-label { color: var(--nr-mint); }
.nr-detail { min-width: 0; border: 1px solid var(--nr-line); border-radius: 16px; overflow: hidden; background: var(--nr-surface); }
.nr-case-header { padding: 22px 24px; display: grid; gap: 8px; border-bottom: 1px solid var(--nr-line); background: radial-gradient(ellipse at 90% 0%, #17312970, transparent 60%); }
.nr-rule-name { font-size: 14px; color: #cbded7; }
.nr-description { line-height: 1.7; white-space: pre-wrap; }
.nr-rule-details { margin-top: 5px; color: var(--nr-muted); font-size: 12px; }
.nr-root summary { padding: 8px 0; min-height: 36px; }
.nr-facts { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr); gap: 7px 15px; padding: 12px; border: 1px solid var(--nr-line); border-radius: 8px; margin: 6px 0; }
.nr-facts dt { color: var(--nr-muted); }
.nr-facts dd { margin: 0; color: var(--nr-text); }
.nr-workbench { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); align-items: start; }
.nr-viewer { padding: 20px; min-width: 0; }
.nr-video-frame { position: relative; aspect-ratio: 16 / 9; width: 100%; overflow: hidden; border-radius: 10px; background: #030609; border: 1px solid var(--nr-line); }
.nr-video-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.nr-geometry { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nr-geometry polygon { fill: #67e6bc19; }
.nr-geometry :is(polygon, polyline) { stroke: #81ffd2; stroke-width: 2.5px; stroke-linejoin: round; filter: drop-shadow(0 1px 2px #00170f); }
.nr-geometry text { fill: #edfff8; stroke: #061510; stroke-width: 3px; paint-order: stroke; font: bold 32px ui-sans-serif, sans-serif; }
.nr-geometry .nr-direction { stroke: #f7d994; fill: none; stroke-width: 2px; }
.nr-media-missing { display: grid; place-content: center; height: 100%; color: var(--nr-muted); padding: 24px; text-align: center; }
.nr-viewer > p { font-size: 12px; margin-top: 10px; }
.nr-transport { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 16px 0; }
.nr-transport .nr-field { flex: 1; min-width: 135px; }
.nr-time { display: block; width: 100%; text-align: right; color: var(--nr-mint); font-size: 12px; font-variant-numeric: tabular-nums; }
.nr-interval { padding: 14px; border: 1px solid var(--nr-line); border-radius: 10px; background: #0a1118; }
.nr-interval-grid, .nr-event-window { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nr-interval > p { margin-top: 10px; font-size: 12px; }
.nr-interval > small { display: block; font-size: 11px; margin-top: 5px; }
.nr-form-panel { padding: 20px; min-width: 0; border-left: 1px solid var(--nr-line); }
.nr-form, .nr-form-controls { display: grid; gap: 16px; }
.nr-form-controls { border: 0; padding: 0; }
.nr-form-controls > legend { padding: 0 0 12px; }
.nr-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.nr-field label { font-size: 12px; color: #d0dce7; font-weight: 600; }
.nr-field small { font-size: 11px; line-height: 1.5; }
.nr-root input:not([type="radio"]):not([type="checkbox"]), .nr-root select, .nr-root textarea {
  display: block; min-height: 42px; min-width: 0; width: 100%; padding: 9px 10px; border: 1px solid #364858;
  border-radius: 8px; background: #080f16; color: var(--nr-text);
}
.nr-root textarea { resize: vertical; min-height: 90px; }
.nr-root textarea::placeholder { color: #96a6b8; }
.nr-root :is(input[type="radio"], input[type="checkbox"]) { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; accent-color: var(--nr-mint); }
.nr-decisions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nr-decision { display: flex; align-items: center; gap: 9px; padding: 11px; min-height: 48px; border: 1px solid var(--nr-line); border-radius: 9px; font-size: 12px; cursor: pointer; }
.nr-decision:has(input:checked) { background: #142a23; border-color: #58a78b; color: #a2f0d6; }
.nr-decision:has(input:disabled) { color: var(--nr-muted); cursor: not-allowed; }
.nr-attestation { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: #14231f; border: 1px solid #315146; border-radius: 8px; font-size: 12px; cursor: pointer; }
.nr-expected { display: grid; gap: 12px; }
.nr-expected > p { font-size: 12px; }
.nr-event { display: grid; gap: 12px; padding: 12px; border: 1px solid #345247; border-radius: 10px; background: #0a1419; }
.nr-event > legend { font-size: 12px; color: #acd9c8; }
.nr-event > small { font-size: 11px; }
.nr-event .nr-subtle { justify-self: end; }
.nr-provenance, .nr-save-status { font-size: 12px; color: var(--nr-muted); }
.nr-save-status:not(:empty) { color: var(--nr-mint); }
.nr-root .nr-warning { color: #f8ce8e; }
.nr-conflict { display: grid; gap: 10px; padding: 14px; border: 1px solid #755a34; border-radius: 9px; background: #241e15; color: #f8d9ab; font-size: 12px; }
.nr-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nr-form-actions .nr-primary { flex: 1 1 190px; }
.nr-comparison { display: grid; justify-items: start; gap: 12px; padding: 24px; border-top: 1px solid var(--nr-line); background: #0b131b; }
.nr-comparison > p { font-size: 12px; }
.nr-result-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.nr-result-metrics > div { display: grid; padding: 14px; gap: 4px; border: 1px solid var(--nr-line); border-radius: 9px; }
.nr-result-metrics strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.nr-result-metrics span { font-size: 12px; color: var(--nr-muted); }
.nr-result-details { max-width: 100%; width: 100%; font-size: 12px; }
.nr-result-details pre { overflow: auto; max-height: 280px; margin: 8px 0; padding: 12px; background: #070d13; border: 1px solid var(--nr-line); border-radius: 8px; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.nr-empty { padding: 40px 24px; display: grid; justify-items: start; align-content: center; gap: 14px; border: 1px solid var(--nr-line); border-radius: 14px; background: var(--nr-surface); min-height: 180px; }
.nr-detail > .nr-empty { border: 0; }
.nr-root .nr-footnote { margin: 18px 0 0; color: var(--nr-muted); font-size: 11px; }

/* The dashboard remains unchanged outside its new #review route. */
body.numen-review-active main > .section:not(#review) { display: none; }
body.numen-review-active .sidebar .nav-item.active:not([href="#review"]) { background: transparent; color: #8f9caf; }
body.numen-review-active #review { scroll-margin-top: 16px; }

.nr-standalone { color-scheme: dark; background: #080b10; color: #edf2f8; }
.nr-standalone .nr-page-shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }
.nr-standalone .nr-sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px; border-right: 1px solid #263742; background: #090f15; display: flex; flex-direction: column; gap: 22px; }
.nr-standalone .nr-brand { display: flex; align-items: center; gap: 10px; color: #edf2f8; text-decoration: none; font-weight: 750; letter-spacing: .15em; }
.nr-standalone .nr-brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #3b6857; border-radius: 10px; color: #67e6bc; background: #14251d; font: 22px Georgia, serif; }
.nr-standalone .nr-brand small { display: block; font-size: 9px; color: #a4b3c1; margin-top: 3px; }
.nr-standalone .nr-sidebar nav { display: grid; gap: 9px; }
.nr-standalone .nr-sidebar nav a { text-decoration: none; color: #a4b3c1; border-radius: 9px; padding: 12px; font-size: 13px; }
.nr-standalone .nr-sidebar nav a[aria-current] { background: #14271f; color: #67e6bc; border: 1px solid #315345; }
.nr-standalone .nr-sidebar > p { margin-top: auto; color: #a4b3c1; font-size: 12px; line-height: 1.65; }
.nr-standalone .nr-page-main { padding: 0 28px 36px; max-width: 1760px; }
.nr-standalone .nr-page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 24px 0; margin-bottom: 14px; border-bottom: 1px solid #263742; }
.nr-standalone .nr-page-header h1 { font-size: 15px; margin: 0; }
.nr-standalone .nr-page-header span { color: #67e6bc; font-size: 12px; }
.nr-skip-link { position: fixed; top: -80px; left: 16px; z-index: 300; background: #67e6bc; color: #082018; padding: 12px 18px; border-radius: 8px; }
.nr-skip-link:focus { top: 12px; }

@media (max-width: 1460px) {
  .nr-workbench { grid-template-columns: minmax(0, 1fr); }
  .nr-form-panel { border-left: 0; border-top: 1px solid var(--nr-line); }
  .nr-decisions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .nr-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 14px; }
  .nr-header { flex-direction: column; gap: 14px; }
  .nr-header-actions { justify-content: flex-start; max-width: none; }
  .nr-decisions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nr-standalone .nr-page-shell { grid-template-columns: 170px minmax(0, 1fr); }
  .nr-standalone .nr-page-main { padding-inline: 18px; }
}
@media (max-width: 760px) {
  .nr-layout { grid-template-columns: minmax(0, 1fr); }
  .nr-case-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 260px; }
  .nr-cases { padding: 14px; }
  .nr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .nr-stat { padding: 12px; }
  .nr-stat strong { font-size: 22px; }
  .nr-steps { gap: 8px 16px; }
  .nr-case-header, .nr-comparison { padding: 18px; }
  .nr-viewer, .nr-form-panel { padding: 14px; }
  .nr-standalone .nr-page-shell { display: block; }
  .nr-standalone .nr-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid #263742; padding: 16px; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .nr-standalone .nr-sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nr-standalone .nr-sidebar nav a { padding: 8px; font-size: 11px; }
  .nr-standalone .nr-sidebar > p { display: none; }
  .nr-standalone .nr-page-main { padding: 0 12px 30px; }
  .nr-standalone .nr-page-header { padding: 18px 0; }
  body.numen-review-active .sidebar nav { overflow-x: auto; justify-content: flex-start; }
  body.numen-review-active .sidebar .nav-item { flex-shrink: 0; min-width: 40px; }
}
@media (max-width: 420px) {
  .nr-case-list { grid-template-columns: minmax(0, 1fr); }
  .nr-root .nr-button { padding-inline: 10px; }
  .nr-result-metrics { grid-template-columns: minmax(0, 1fr); }
  .nr-result-metrics > div { grid-template-columns: 40px 1fr; align-items: center; }
  .nr-interval { padding: 10px; }
  .nr-event-window { grid-template-columns: minmax(0, 1fr); }
  .nr-standalone .nr-brand { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .nr-root .nr-button { transition: none; }
  html:has(.nr-root) { scroll-behavior: auto; }
}
