/* ============================================================
   PAGES - Page-specific grid layouts and styles
   ============================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: auto minmax(430px, 1fr) auto;
  gap: var(--sp-16);
  min-height: calc(100vh - var(--topnav-height) - 48px);
  min-height: calc(100dvh - var(--topnav-height) - 48px);
  height: auto;
  align-content: start;
}

.dash-nri {
  grid-column: 1 / -1;
  grid-row: 1;
}

.dash-center {
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative;
  overflow: hidden;
  min-height: clamp(420px, 52vh, 760px);
}

.dash-quellen {
  grid-column: 1;
  grid-row: 3;
}

.dash-warning {
  grid-column: 2;
  grid-row: 3;
}

.nri-hero {
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(0, 1fr);
  gap: var(--sp-32);
  align-items: start;
}

.nri-hero__header {
  border: none;
  margin: 0;
  padding: 0;
}

.nri-hero__header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-8);
}

.nri-trend-btn {
  height: 26px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(232, 238, 246, 0.9);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 var(--sp-12);
  cursor: pointer;
  transition: all var(--duration-micro) var(--ease-standard);
}

.nri-trend-btn:hover {
  border-color: rgba(255, 178, 140, 0.48);
  background: rgba(255, 153, 102, 0.16);
}

.nri-info-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(222, 230, 241, 0.92);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-micro) var(--ease-standard);
}

.nri-info-btn:hover,
.nri-info-btn.is-active {
  border-color: rgba(255, 178, 140, 0.58);
  background: rgba(255, 153, 102, 0.18);
  color: #fff;
}

.nri-info-btn--tiny {
  width: 18px;
  height: 18px;
  font-size: 0.6rem;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

.nri-hero__score-block {
  display: flex;
  align-items: baseline;
  gap: var(--sp-12);
}

.nri-hero__score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.5rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.nri-hero__delta {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 500;
  padding: var(--sp-2) var(--sp-8);
  border-radius: var(--radius-sm);
}

.nri-hero__delta--up {
  color: var(--risk-red);
  background: var(--risk-red-dim);
}

.nri-hero__delta--down {
  color: var(--sentiment-pos);
  background: var(--sentiment-pos-dim);
}

.nri-hero__drivers {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--sp-4);
  line-height: var(--leading-relaxed);
}

.nri-hero__subscores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-12);
  align-content: start;
}

.nri-subscore {
  min-width: 0;
  padding: var(--sp-16);
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 156px;
}

.nri-subscore__label-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-8);
  min-height: 36px;
}

.nri-subscore__label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: 0;
  line-height: 1.28;
}

.nri-subscore__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  margin-top: auto;
  line-height: 1;
}

.nri-subscore__bar {
  margin-top: var(--sp-8);
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.nri-subscore__bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1.5s var(--ease-standard);
}

.nri-info-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(4, 6, 9, 0.58);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-overlay) var(--ease-standard);
}

.nri-info-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nri-info-modal {
  width: min(640px, calc(100vw - 28px));
  margin: clamp(56px, 8vh, 92px) auto 0;
  max-height: min(84vh, 560px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(9, 12, 18, 0.96);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition:
    transform var(--duration-overlay) var(--ease-standard),
    opacity var(--duration-overlay) var(--ease-standard);
}

.nri-info-overlay.is-open .nri-info-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.nri-info-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-12);
  padding: var(--sp-16) var(--sp-16) var(--sp-12);
  border-bottom: 1px solid var(--border-subtle);
}

.nri-info-modal__close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--duration-micro) var(--ease-standard);
}

.nri-info-modal__close:hover {
  border-color: rgba(255, 178, 140, 0.48);
  background: rgba(255, 153, 102, 0.16);
  color: #fff;
}

.nri-info-modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  padding: 22px 22px 24px;
  overflow-y: auto;
}

.nri-info-modal__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: var(--sp-2);
}

.nri-info-modal__line {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 16px 16px;
}

.nri-info-modal__line span {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(194, 201, 214, 0.78);
  margin-bottom: 8px;
}

.nri-info-modal__line p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
  padding-right: var(--sp-4);
}

.nri-trend-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(4, 6, 9, 0.58);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-overlay) var(--ease-standard);
}

.nri-trend-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nri-trend-modal {
  width: min(900px, calc(100vw - 28px));
  margin: clamp(56px, 8vh, 92px) auto 0;
  max-height: min(88vh, 760px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(9, 12, 18, 0.96);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition:
    transform var(--duration-overlay) var(--ease-standard),
    opacity var(--duration-overlay) var(--ease-standard);
}

.nri-trend-overlay.is-open .nri-trend-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.nri-trend-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-12);
  padding: var(--sp-16) var(--sp-16) var(--sp-12);
  border-bottom: 1px solid var(--border-subtle);
}

.nri-trend-modal__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-primary);
}

.nri-trend-modal__close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--duration-micro) var(--ease-standard);
}

.nri-trend-modal__close:hover {
  border-color: rgba(255, 178, 140, 0.48);
  background: rgba(255, 153, 102, 0.16);
  color: #fff;
}

.nri-trend-modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  padding: var(--sp-16);
  overflow-y: auto;
}

.nri-trend-chart {
  height: clamp(220px, 42vh, 340px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 153, 102, 0.08) 0%, rgba(255, 153, 102, 0.01) 100%),
    rgba(8, 11, 15, 0.72);
  overflow: hidden;
}

.nri-trend-chart svg {
  width: 100%;
  height: 100%;
}

.nri-trend-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--sp-12);
  padding: var(--sp-4) 0 var(--sp-2);
}

.nri-trend-stat {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: var(--sp-16) var(--sp-12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--sp-8);
  min-height: 104px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.nri-trend-stat__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(194, 201, 214, 0.76);
}

.nri-trend-stat__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.nri-trend-note {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--sp-10);
}

.nri-trend-area {
  opacity: 0;
  transform-origin: 50% 100%;
  transform: scaleY(0.78);
}

.nri-trend-line {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
}

.nri-trend-point {
  opacity: 0;
  transform: scale(0.7);
  transform-box: fill-box;
  transform-origin: center;
}

.nri-trend-overlay.is-open .nri-trend-area {
  animation: nriAreaReveal 900ms cubic-bezier(0.22, 1, 0.36, 1) 120ms forwards;
}

.nri-trend-overlay.is-open .nri-trend-line {
  animation: nriLineDraw 1100ms cubic-bezier(0.22, 1, 0.36, 1) 180ms forwards;
}

.nri-trend-overlay.is-open .nri-trend-point {
  animation: nriPointPop 420ms cubic-bezier(0.22, 1, 0.36, 1) calc(340ms + (var(--pt-i) * 100ms)) forwards;
}

@keyframes nriAreaReveal {
  0% {
    opacity: 0;
    transform: scaleY(0.78);
  }
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes nriLineDraw {
  from { stroke-dashoffset: 1400; }
  to { stroke-dashoffset: 0; }
}

@keyframes nriPointPop {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  70% {
    opacity: 1;
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.warning-list {
  display: flex;
  flex-direction: column;
}

.warning-item {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-12) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--duration-micro);
}

.warning-item:hover {
  background: var(--accent-dim);
  margin: 0 calc(-1 * var(--sp-24));
  padding-left: var(--sp-24);
  padding-right: var(--sp-24);
}

.warning-item:last-child { border-bottom: none; }

.warning-item__content { flex: 1; }

.warning-item__title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.warning-item__delta {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.warning-item__cta {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  padding: var(--sp-4) var(--sp-8);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  transition: all var(--duration-micro);
}

.warning-item__cta:hover {
  background: var(--accent-dim);
}

.viz-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.viz-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.viz-container__hud { z-index: 2; pointer-events: none; }
.viz-container__interact { z-index: 3; cursor: grab; }
.viz-container__interact:active { cursor: grabbing; }

.viz-controls {
  position: absolute;
  top: var(--sp-12);
  left: var(--sp-12);
  right: var(--sp-12);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-16);
  row-gap: var(--sp-10);
  z-index: 5;
  pointer-events: none;
}

.viz-controls > * { pointer-events: auto; }
.viz-controls > :first-child { min-width: 0; }

.constellation-graph-layer {
  position: absolute;
  inset: 0;
  top: var(--constellation-top-offset, 48px);
  transition: opacity var(--duration-ui) var(--ease-standard);
}

.constellation-webgl,
.constellation-hud,
.constellation-interaction {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.constellation-hud {
  z-index: 2;
  pointer-events: none;
}

.constellation-interaction {
  z-index: 3;
  cursor: grab;
  touch-action: none;
}

.constellation-fs-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 55%, rgba(255, 178, 140, 0.24) 0%, rgba(255, 178, 140, 0.08) 28%, rgba(255, 178, 140, 0) 62%),
    linear-gradient(180deg, rgba(248, 250, 255, 0.1) 0%, rgba(248, 250, 255, 0) 68%);
}

.constellation-fs-veil.is-enter {
  animation: constellationFsVeilEnter 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

.constellation-fs-veil.is-exit {
  animation: constellationFsVeilExit 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

.constellation-fullscreen-btn {
  position: absolute;
  right: var(--sp-16);
  bottom: var(--sp-16);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 11, 15, 0.54);
  color: rgba(229, 236, 247, 0.84);
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 4;
  transition: all var(--duration-micro) var(--ease-standard);
}

.constellation-fullscreen-btn:hover {
  background: rgba(12, 16, 22, 0.76);
  border-color: rgba(255, 153, 102, 0.34);
  color: #fff;
}

.constellation-list-layer {
  position: absolute;
  inset: 0;
  top: var(--constellation-top-offset, 48px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  overflow-y: auto;
  padding: var(--sp-16);
  background: rgba(6, 8, 11, 0.9);
}

.zoom-strip {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(10, 13, 18, 0.72);
  backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
  padding: 6px 10px 6px 12px;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.zoom-strip__label {
  font-size: 0.62rem;
  color: rgba(212, 222, 236, 0.88);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.zoom-strip__btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(212, 222, 236, 0.84);
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 999px;
  transition: all var(--duration-micro) var(--ease-standard);
}

.zoom-strip__btn:hover {
  color: #fff;
  border-color: rgba(255, 153, 102, 0.38);
  background: rgba(255, 153, 102, 0.16);
}

.zoom-strip__track-wrap {
  position: relative;
  width: 148px;
  display: flex;
  align-items: center;
  padding-top: 9px;
}

.zoom-strip__stages {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.zoom-strip__stages span {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: rgba(162, 173, 191, 0.78);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.zoom-strip input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  background: transparent;
}

.zoom-strip input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 11px;
  width: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: #ffb28c;
  cursor: pointer;
  margin-top: -4px;
  box-shadow:
    0 0 10px rgba(255, 153, 102, 0.45),
    0 0 0 3px rgba(255, 153, 102, 0.14);
}

.zoom-strip input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(90deg, rgba(255, 153, 102, 0.32), rgba(255, 255, 255, 0.22));
  border-radius: 999px;
}

.zoom-strip input[type="range"]::-moz-range-thumb {
  height: 11px;
  width: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: #ffb28c;
  cursor: pointer;
  box-shadow:
    0 0 10px rgba(255, 153, 102, 0.45),
    0 0 0 3px rgba(255, 153, 102, 0.14);
}

.zoom-strip input[type="range"]::-moz-range-track {
  height: 3px;
  background: linear-gradient(90deg, rgba(255, 153, 102, 0.32), rgba(255, 255, 255, 0.22));
  border-radius: 999px;
  border: none;
}

.zoom-strip--constellation {
  margin-left: auto;
  flex: 0 0 auto;
  max-width: min(240px, calc(100vw - 420px));
  min-width: 150px;
  gap: var(--sp-8);
  padding: 5px 8px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.003)),
    rgba(8, 11, 15, 0.2);
  border-color: rgba(255, 255, 255, 0.045);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px) saturate(120%);
  opacity: 0.28;
  transition: opacity var(--duration-ui) var(--ease-standard);
}

.zoom-strip--constellation:hover {
  opacity: 0.56;
}

.zoom-strip--constellation .zoom-strip__track-wrap {
  width: clamp(96px, 12vw, 150px);
  margin: 0;
  padding: 0;
}

.zoom-strip--constellation .zoom-strip__btn {
  width: 16px;
  height: 16px;
  opacity: 0.42;
  background: rgba(255, 255, 255, 0.015);
  font-size: 0.78rem;
}

.zoom-strip--constellation .zoom-strip__btn:hover {
  opacity: 0.7;
}

#constellation-container.is-map-fullscreen .constellation-graph-layer {
  top: var(--constellation-top-offset, 48px);
}

.constellation-graph-layer.is-fs-enter {
  animation: constellationFsEnter 740ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.constellation-graph-layer.is-fs-exit {
  animation: constellationFsExit 740ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes constellationFsEnter {
  0% {
    transform: scale(0.965);
    filter: blur(2.8px) saturate(0.78) brightness(0.78);
  }
  35% {
    transform: scale(1.018);
    filter: blur(0px) saturate(1.16) brightness(1.08);
  }
  100% {
    transform: scale(1);
    filter: blur(0) saturate(1) brightness(1);
  }
}

@keyframes constellationFsExit {
  0% {
    transform: scale(1.02);
    filter: blur(0px) saturate(1.18) brightness(1.06);
  }
  45% {
    transform: scale(0.988);
    filter: blur(1.8px) saturate(0.88) brightness(0.82);
  }
  100% {
    transform: scale(1);
    filter: blur(0) saturate(1) brightness(1);
  }
}

@keyframes constellationFsVeilEnter {
  0% { opacity: 0; }
  35% { opacity: 0.58; }
  100% { opacity: 0; }
}

@keyframes constellationFsVeilExit {
  0% { opacity: 0; }
  25% { opacity: 0.52; }
  100% { opacity: 0; }
}

.time-scrubber {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  padding: var(--sp-8) var(--sp-16);
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.time-scrubber__label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.narratives-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--sp-24);
  height: calc(100vh - var(--topnav-height) - 48px);
  height: calc(100dvh - var(--topnav-height) - 48px);
}

.narr-filters {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  overflow-y: auto;
}

.narr-list {
  overflow-y: auto;
}

.narr-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-12);
  margin-bottom: var(--sp-16);
}

.filter-group {
  padding-bottom: var(--sp-16);
  border-bottom: 1px solid var(--border-subtle);
}

.filter-group__title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--sp-12);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--sp-4) var(--sp-12);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-micro);
  margin: 0 var(--sp-4) var(--sp-8) 0;
  background: rgba(255, 255, 255, 0.04);
}

.filter-chip:hover,
.filter-chip.is-active {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--accent-dim);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--sp-24);
  height: calc(100vh - var(--topnav-height) - 48px);
  height: calc(100dvh - var(--topnav-height) - 48px);
  overflow: hidden;
}

.detail-main {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-24);
}

.detail-sidebar {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
}

.detail-cluster-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-16);
}

.detail-cluster-main {
  min-width: 0;
}

.detail-cluster-score {
  text-align: right;
  flex-shrink: 0;
}

.evidence-trail {
  position: relative;
  padding-left: var(--sp-24);
}

.evidence-trail::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.evidence-item {
  position: relative;
  padding-bottom: var(--sp-24);
  cursor: pointer;
}

.evidence-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sp-24) + 3px);
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--ink-500);
  background: var(--surface-raised);
}

.evidence-item--risk::before {
  border-color: var(--risk-red);
  background: var(--risk-red);
  box-shadow: 0 0 8px rgba(197, 48, 48, 0.22);
}

.evidence-item--amber::before {
  border-color: var(--risk-amber);
}

.evidence-item__time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
}

.evidence-item__text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

.actor-card {
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  padding: var(--sp-16);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-ui) var(--ease-standard);
  background: rgba(255, 255, 255, 0.03);
}

.actor-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.08);
}

.actor-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.actor-card__info { flex: 1; }

.actor-card__name {
  font-size: var(--text-sm);
  font-weight: 650;
  margin-bottom: var(--sp-2);
}

.actor-card__role {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.actor-card__reach {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.actors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-24);
  height: calc(100vh - var(--topnav-height) - 48px);
  height: calc(100dvh - var(--topnav-height) - 48px);
}

.actors-map-panel {
  padding: 0;
  overflow: hidden;
  position: relative;
  min-height: clamp(420px, 56dvh, 760px);
}

.actor-graph-meta-wrap {
  position: absolute;
  top: var(--sp-16);
  left: var(--sp-16);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 52%;
}

.actor-graph-meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.actors-side-column {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  overflow-y: auto;
  min-height: 0;
  padding-right: var(--sp-4);
}

.actors-list-panel,
.actors-connections-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.actors-list-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  position: relative;
  z-index: 2;
  overflow-y: auto;
  min-height: 0;
  max-height: clamp(260px, 52vh, 620px);
  max-height: clamp(260px, 52dvh, 620px);
  padding-right: var(--sp-4);
}

.actors-connections-scroll {
  position: relative;
  z-index: 2;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  overflow-y: auto;
  min-height: 0;
  max-height: clamp(220px, 34vh, 420px);
  max-height: clamp(220px, 34dvh, 420px);
  padding-right: var(--sp-4);
}

.actor-connection-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-8) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.actor-connection-row > span:first-child {
  min-width: 0;
}

.actor-map-controls {
  position: absolute;
  top: var(--sp-16);
  right: var(--sp-16);
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  width: min(280px, 44%);
}

.actor-map-controls__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(194, 201, 214, 0.84);
  font-family: var(--font-mono);
}

.actor-map-select-wrap {
  position: relative;
}

.actor-map-select {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.01)),
    rgba(7, 10, 15, 0.7);
  color: var(--text-primary);
  padding: 8px 34px 8px 10px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color var(--duration-micro) var(--ease-standard), background var(--duration-micro) var(--ease-standard);
}

.actor-map-select:hover {
  border-color: rgba(255, 178, 140, 0.38);
}

.actor-map-select:focus-visible {
  outline: none;
  border-color: rgba(255, 178, 140, 0.56);
  box-shadow: 0 0 0 2px rgba(255, 178, 140, 0.16);
}

.actor-map-select-caret {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: rgba(194, 201, 214, 0.86);
  font-size: 0.7rem;
}

.actor-cone-toggle {
  position: absolute;
  right: var(--sp-16);
  bottom: var(--sp-16);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: 8px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03)),
    rgba(8, 11, 15, 0.58);
  color: rgba(229, 236, 247, 0.88);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px) saturate(130%);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    border-color var(--duration-ui) var(--ease-standard),
    background var(--duration-ui) var(--ease-standard),
    color var(--duration-ui) var(--ease-standard),
    transform var(--duration-ui) var(--ease-standard),
    box-shadow var(--duration-ui) var(--ease-standard);
}

.actor-cone-toggle:hover {
  border-color: rgba(255, 178, 140, 0.44);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(11, 14, 19, 0.72);
  color: rgba(248, 251, 255, 0.96);
  transform: translateY(-1px);
}

.actor-cone-toggle:focus-visible {
  outline: none;
  border-color: rgba(255, 178, 140, 0.62);
  box-shadow:
    0 0 0 2px rgba(255, 178, 140, 0.18),
    0 14px 26px rgba(0, 0, 0, 0.32);
}

.actor-cone-toggle.is-active {
  border-color: rgba(255, 178, 140, 0.58);
  background:
    linear-gradient(150deg, rgba(255, 178, 140, 0.34), rgba(255, 178, 140, 0.1)),
    rgba(14, 17, 22, 0.78);
  color: #fff;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.36),
    0 0 26px rgba(255, 153, 102, 0.22);
}

.actor-cone-toggle__icon {
  font-size: 0.82rem;
  line-height: 1;
}

.actor-cone-toggle__text {
  line-height: 1;
  white-space: nowrap;
}

.actors-graph {
  position: relative;
  overflow: hidden;
}

.actors-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
}

.reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-24);
  min-height: calc(100vh - var(--topnav-height) - 190px);
  min-height: calc(100dvh - var(--topnav-height) - 190px);
  align-items: stretch;
}

.reports-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-16);
  margin-bottom: var(--sp-24);
}

.reports-page-actions {
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.reports-col {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--sp-16);
  min-height: 0;
}

.report-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.report-scroll {
  position: relative;
  z-index: 2;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding-right: var(--sp-8);
}

.report-scroll .report-card:last-child {
  margin-bottom: 0;
}

.report-scroll--trail {
  padding-right: var(--sp-4);
}

.settings-grid {
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-24);
}

.settings-page {
  width: 100%;
}

.settings-page-intro {
  margin-bottom: var(--sp-32);
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-16) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-row__label {
  font-size: var(--text-base);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.settings-row__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--sp-4);
  overflow-wrap: anywhere;
}

.settings-status {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  font-size: var(--text-sm);
}

.settings-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.settings-status__dot--ok {
  background: var(--sentiment-pos);
  box-shadow: 0 0 8px rgba(15, 157, 88, 0.2);
}

.settings-status__dot--warn {
  background: var(--risk-amber);
}

.settings-status__dot--off {
  background: var(--ink-600);
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    min-height: 0;
  }

  .dash-nri { grid-column: 1 / -1; grid-row: 1; }
  .dash-center {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: clamp(420px, 46dvh, 560px);
  }
  .dash-quellen { grid-column: 1; grid-row: 3; }
  .dash-warning { grid-column: 2; grid-row: 3; }
  .nri-hero { grid-template-columns: 1fr; gap: var(--sp-16); }
  .nri-hero__subscores { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .narratives-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .narr-filters { display: none; }
  .narr-list { overflow: visible; }

  .detail-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .detail-main,
  .detail-sidebar {
    overflow: visible;
  }

  .actors-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .actors-map-panel {
    min-height: clamp(420px, 60dvh, 780px);
  }

  .actors-side-column {
    overflow: visible;
    padding-right: 0;
  }

  .reports-grid { min-height: 0; }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    height: auto;
    gap: var(--sp-12);
  }

  .dash-center { min-height: min(470px, 58dvh); }
  .dash-quellen { grid-column: 1; grid-row: 3; }
  .dash-warning { grid-column: 1; grid-row: 4; }
  .nri-hero { grid-template-columns: 1fr; }
  .nri-hero__header {
    align-items: flex-start;
    gap: var(--sp-8);
  }
  .nri-hero__header-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
  .nri-hero__subscores { grid-template-columns: 1fr; }

  .nri-info-modal {
    width: calc(100vw - 16px);
    margin-top: 12px;
    max-height: calc(100dvh - 24px);
  }

  .nri-trend-modal {
    width: calc(100vw - 16px);
    margin-top: 12px;
    max-height: calc(100dvh - 24px);
  }

  .nri-info-modal__body,
  .nri-trend-modal__body {
    padding: var(--sp-12);
  }

  .nri-trend-stats {
    grid-template-columns: 1fr;
  }

  .nri-trend-chart {
    height: min(220px, 36dvh);
  }

  .narr-list-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .detail-cluster-head {
    flex-direction: column;
    gap: var(--sp-12);
  }

  .detail-cluster-score {
    text-align: left;
  }

  .evidence-trail {
    padding-left: var(--sp-16);
  }

  .evidence-item::before {
    left: calc(-1 * var(--sp-16) + 3px);
  }

  .reports-page-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: var(--sp-16);
  }

  .reports-page-actions {
    width: 100%;
  }

  .reports-page-actions .btn {
    flex: 1 1 180px;
  }

  .reports-grid {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: var(--sp-16);
  }

  .reports-col {
    grid-template-rows: none;
  }

  .report-scroll,
  .report-scroll--trail {
    padding-right: 0;
  }

  .settings-page-intro {
    margin-bottom: var(--sp-24);
  }

  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-8);
  }

  .settings-row > :last-child {
    width: 100%;
    margin-left: 0;
  }

  .settings-row .settings-status {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .settings-row .btn {
    width: 100%;
    justify-content: center;
  }

  .actor-graph-meta-wrap {
    top: var(--sp-12);
    left: var(--sp-12);
    max-width: calc(100% - 24px);
    padding-right: min(60%, 320px);
  }

  .actor-graph-meta {
    max-width: min(70vw, 300px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .zoom-strip--constellation {
    min-width: 0;
    max-width: min(190px, calc(100vw - 40px));
    padding: 4px 7px;
    gap: var(--sp-4);
  }

  .zoom-strip--constellation .zoom-strip__label {
    display: none;
  }

  .zoom-strip--constellation .zoom-strip__track-wrap {
    width: 84px;
    padding: 0;
  }

  .zoom-strip--constellation .zoom-strip__stages {
    display: none;
  }

  .actor-map-controls {
    top: 44px;
    right: var(--sp-12);
    left: auto;
    width: min(320px, 68%);
  }

  .actor-map-controls__label {
    display: none;
  }

  .actor-map-select {
    font-size: var(--text-xs);
    padding: 7px 30px 7px 9px;
  }

  .actor-cone-toggle {
    right: var(--sp-12);
    bottom: var(--sp-12);
    min-width: 34px;
    padding: 8px;
  }

  .actor-cone-toggle__text {
    display: none;
  }

  .actors-list-scroll,
  .actors-connections-scroll,
  #actors-list,
  #actors-connections {
    max-height: none !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 640px) {
  .nri-hero__score {
    font-size: 2.6rem;
  }

  .nri-hero__score-block {
    flex-wrap: wrap;
    row-gap: var(--sp-8);
  }

  .nri-subscore {
    min-height: 132px;
  }

  .warning-item {
    gap: var(--sp-8);
  }

  .warning-item:hover {
    background: transparent;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .warning-item__cta {
    display: none;
  }

  .actors-map-panel {
    min-height: clamp(480px, 70dvh, 920px);
  }

  .actor-graph-meta-wrap {
    padding-right: min(66%, 270px);
  }

  .actor-map-controls {
    top: 42px;
    right: var(--sp-8);
    width: min(270px, 74%);
  }

  .actor-map-select {
    min-height: 34px;
  }

  .reports-page-actions .btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 480px) {
  .zoom-strip--constellation {
    max-width: min(170px, calc(100vw - 28px));
  }

  .nri-info-modal__line {
    padding: 12px;
  }
}
