/* CLRTY SCOPE — Cyber HUD (IBM Plex Sans + IBM Plex Mono) */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #000000;
  --bg-panel: #141414;
  --border: #2a2a2a;
  --text: #ffffff;
  --text-muted: #a3a3a3;
  --accent: #e5e5e5;
  --bg-deep-space: #0a0a0a;
  --bg-deep-void: #000000;
  --node-glow-cyan: #e5e5e5;
  --node-idle-blue: #404040;
  --hud-text-primary: #a3a3a3;
  --hud-accent-green: #e5e5e5;
  --scope-bg: #000000;
  --scope-panel: rgba(20, 20, 20, 0.72);
  --scope-panel-solid: #141414;
  --scope-border: #2a2a2a;
  --scope-border-bright: #3a3a3a;
  --scope-text: #ffffff;
  --scope-muted: #a3a3a3;
  --scope-cyan: #e5e5e5;
  --scope-cyan-bright: #f5f5f5;
  --scope-cyan-dim: #737373;
  --scope-cyan-glow: rgba(229, 229, 229, 0.35);
  --scope-purple: #a3a3a3;
  --scope-green: #a3a3a3;
  --scope-green-bright: #e5e5e5;
  --scope-amber: #737373;
  --scope-red: #a3a3a3;
  --scope-asia: #525252;
  --scope-eu2: #737373;
  --scope-font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --scope-mono: "IBM Plex Mono", ui-monospace, monospace;
  --scope-display: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body.scope-page {
  font-family: var(--scope-font);
  background: var(--scope-bg);
  color: var(--scope-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-image:
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(rgba(229, 229, 229, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(229, 229, 229, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 4rem 4rem, 4rem 4rem;
  background-position: center, 0 0, 0 0;
}

body.scope-page[dir="rtl"] .scope-hud-left {
  left: auto;
  right: 1rem;
}
body.scope-page[dir="rtl"] .scope-hud-right {
  right: auto;
  left: 1rem;
}

.glow-cyan {
  text-shadow: 0 0 8px var(--scope-cyan-glow), 0 0 18px rgba(229, 229, 229, 0.25);
  color: var(--scope-cyan);
}
.glow-purple {
  text-shadow: 0 0 8px rgba(163, 163, 163, 0.45);
  color: var(--scope-purple);
}

/* Header */
.scope-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1.1rem;
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
  border-bottom: 1px solid var(--scope-border);
  flex-shrink: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.scope-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--scope-text);
  flex-shrink: 0;
}
.scope-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(229, 229, 229, 0.5));
}
.scope-brand span {
  font-family: var(--scope-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
}

.scope-portal-tag {
  margin-left: 0.35rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid rgba(229, 229, 229, 0.45);
  border-radius: 999px;
  font-size: 0.55rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #e5e5e5;
  background: rgba(229, 229, 229, 0.08);
}

.scope-rpc-portal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  padding: 0.4rem 1.1rem;
  border-bottom: 1px solid var(--scope-border);
  background: linear-gradient(90deg, rgba(8, 20, 40, 0.95), rgba(12, 28, 52, 0.85));
  font-size: 0.68rem;
  color: var(--scope-muted);
}
.scope-rpc-portal-label {
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffffff;
}
.scope-rpc-portal-bar code {
  font-family: var(--scope-mono);
  color: #e5e5e5;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(229, 229, 229, 0.2);
  border-radius: 4px;
  padding: 0.12rem 0.35rem;
}
.scope-rpc-portal-link {
  color: #a3a3a3;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.scope-rpc-portal-link:hover {
  color: #e5e5e5;
  border-bottom-color: rgba(229, 229, 229, 0.5);
}

.scope-nav {
  display: flex;
  gap: 0.2rem;
  flex: 1;
}
.scope-nav-btn,
.scope-module-btn {
  background: transparent;
  border: none;
  color: var(--scope-muted);
  font-family: var(--scope-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.scope-nav-btn:hover,
.scope-module-btn:hover {
  color: var(--scope-text);
  background: rgba(229, 229, 229, 0.06);
}
.scope-nav-btn.active {
  color: var(--scope-cyan);
  background: rgba(229, 229, 229, 0.1);
  box-shadow: inset 0 -2px 0 var(--scope-cyan);
}

.scope-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.scope-search-box {
  position: relative;
}
.scope-search-icon {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--scope-muted);
  font-size: 0.7rem;
  pointer-events: none;
}
.scope-search {
  background: rgba(13, 21, 39, 0.7);
  border: 1px solid var(--scope-border);
  border-radius: 6px;
  color: var(--scope-text);
  font-family: var(--scope-mono);
  font-size: 0.72rem;
  padding: 0.4rem 0.65rem 0.4rem 1.7rem;
  width: 220px;
  outline: none;
}
.scope-search:focus {
  border-color: var(--scope-cyan-dim);
  box-shadow: 0 0 0 2px var(--scope-cyan-glow);
}

.scope-locale-select {
  background: rgba(13, 21, 39, 0.7);
  border: 1px solid var(--scope-border);
  border-radius: 4px;
  color: var(--scope-cyan);
  font-family: var(--scope-mono);
  font-size: 0.62rem;
  padding: 0.35rem 0.4rem;
  max-width: 110px;
  cursor: pointer;
}

.scope-rpc-badge {
  font-size: 0.6rem;
  font-family: var(--scope-mono);
  color: var(--scope-muted);
  padding: 0.22rem 0.45rem;
  border: 1px solid var(--scope-border);
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.scope-rpc-badge.live {
  color: var(--scope-cyan-bright);
  border-color: rgba(245, 245, 245, 0.45);
  box-shadow: 0 0 10px rgba(245, 245, 245, 0.25);
}
.scope-rpc-badge.offline {
  color: var(--scope-red);
  border-color: rgba(163, 163, 163, 0.45);
}
.scope-rpc-badge.awaiting {
  color: var(--scope-amber);
  border-color: rgba(115, 115, 115, 0.35);
}

/* Active pinger — pulse rings near live badge */
.scope-pinger {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}
.scope-pinger::before,
.scope-pinger::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  animation: scope-ping-ring 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.scope-pinger::after {
  animation-delay: 0.55s;
}
.scope-pinger-core {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.scope-pinger.active {
  color: var(--scope-cyan-bright);
}
.scope-pinger.awaiting,
.scope-pinger.offline {
  color: var(--scope-amber);
  opacity: 0.85;
}
.scope-pinger.awaiting::before,
.scope-pinger.awaiting::after,
.scope-pinger.offline::before,
.scope-pinger.offline::after {
  animation-duration: 2.4s;
}
@keyframes scope-ping-ring {
  0% {
    transform: scale(0.55);
    opacity: 0.9;
  }
  70% {
    transform: scale(2.4);
    opacity: 0;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Center hub DOM pinger overlay (mirrors canvas rings) */
.scope-hub-pinger {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  z-index: 15;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scope-hub-pinger .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--scope-cyan-bright);
  opacity: 0;
  animation: scope-hub-ping 2s ease-out infinite;
}
.scope-hub-pinger .ring:nth-child(2) {
  animation-delay: 0.65s;
}
.scope-hub-pinger .ring:nth-child(3) {
  animation-delay: 1.3s;
}
.scope-hub-pinger.awaiting .ring,
.scope-hub-pinger.offline .ring {
  border-color: #737373;
  animation-duration: 2.8s;
}
@keyframes scope-hub-ping {
  0% {
    transform: scale(0.55);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.85);
    opacity: 0;
  }
}

.scope-modules {
  display: flex;
  gap: 0.3rem;
  padding: 0.35rem 1.1rem;
  background: rgba(13, 21, 39, 0.55);
  border-bottom: 1px solid var(--scope-border);
  overflow-x: auto;
  flex-shrink: 0;
}
.scope-module-btn {
  border: 1px solid transparent;
  white-space: nowrap;
  font-size: 0.62rem;
}
.scope-module-btn.active {
  color: var(--scope-cyan);
  border-color: var(--scope-cyan-dim);
  background: rgba(229, 229, 229, 0.08);
}

.scope-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.scope-view {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.scope-view.active {
  display: flex;
}

/* Cyber HUD hero */
.scope-cyber-hud {
  position: relative;
  flex: 1;
  min-height: 360px;
  overflow: hidden;
  background: var(--bg-deep-space);
}

.scope-radial-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.scope-hud-panel {
  position: absolute;
  z-index: 20;
  background: var(--scope-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(36, 48, 68, 0.9);
  padding: 0.85rem 1rem;
  font-size: 0.7rem;
  will-change: transform;
  max-width: 260px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(229, 229, 229, 0.04);
}
.scope-hud-panel::before,
.scope-hud-panel::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--scope-cyan);
  border-style: solid;
  pointer-events: none;
}
.scope-hud-panel::before {
  top: -1px;
  left: -1px;
  border-width: 1.5px 0 0 1.5px;
}
.scope-hud-panel::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1.5px 1.5px 0;
}

.scope-hud-left {
  top: 1rem;
  left: 1rem;
}
.scope-hud-right {
  top: 0.65rem;
  right: 0.65rem;
  bottom: 0.65rem;
  max-width: 288px;
  width: min(288px, 32vw);
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.65rem;
  overflow: hidden;
}

.scope-hud-title {
  margin: 0 0 0.65rem;
  font-family: var(--scope-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--scope-cyan);
  text-transform: uppercase;
}

.scope-region-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.scope-region-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--scope-text);
  font-family: var(--scope-mono);
  font-size: 0.68rem;
  padding: 0.3rem 0.35rem;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s, border-color 0.15s, background 0.15s;
}
.scope-region-btn:hover,
.scope-region-btn.active {
  border-color: rgba(229, 229, 229, 0.35);
  background: rgba(229, 229, 229, 0.06);
}
.scope-region-btn.dimmed {
  opacity: 0.22;
}
.scope-region-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.scope-region-count {
  margin-left: auto;
  color: var(--scope-muted);
  font-variant-numeric: tabular-nums;
}

.scope-kpi-stack {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(229, 229, 229, 0.25) transparent;
}
.scope-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(36, 48, 68, 0.7);
  flex-shrink: 0;
}
.scope-kpi-block .lbl {
  font-family: var(--scope-display);
  font-size: 0.48rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--scope-muted);
  margin-bottom: 0.08rem;
}
.scope-kpi-block .val {
  font-family: var(--scope-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--scope-cyan);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  text-shadow: 0 0 10px rgba(245, 245, 245, 0.25);
}
.scope-kpi-block .sub {
  font-family: var(--scope-mono);
  font-size: 0.5rem;
  color: var(--scope-muted);
  margin-top: 0.06rem;
}
.scope-chart-panel {
  flex-shrink: 0;
  padding: 0.28rem 0.35rem 0.35rem;
  border: 1px solid rgba(36, 48, 68, 0.85);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  position: relative;
}
.scope-chart-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 6px;
  height: 6px;
  border-top: 1px solid var(--scope-cyan);
  border-left: 1px solid var(--scope-cyan);
  opacity: 0.55;
  pointer-events: none;
}
.scope-health-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--scope-green-bright);
  margin-right: 0.35rem;
  box-shadow: 0 0 8px rgba(57, 211, 83, 0.7);
  animation: healthBlink 1.4s ease-in-out infinite;
}
.scope-health-dot.off {
  background: var(--scope-red);
  box-shadow: 0 0 8px rgba(163, 163, 163, 0.5);
  animation: none;
}
@keyframes healthBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.scope-spark {
  width: 100%;
  height: 48px;
  display: block;
  margin-top: 0.2rem;
}
.scope-spark.tall {
  height: 56px;
}
.scope-spark-label {
  font-family: var(--scope-display);
  font-size: 0.48rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--scope-muted);
}

.scope-await-banner {
  margin-top: 0.35rem;
  padding: 0.35rem 0.45rem;
  border: 1px dashed rgba(229, 229, 229, 0.3);
  border-radius: 4px;
  font-size: 0.54rem;
  font-family: var(--scope-mono);
  color: var(--scope-amber);
  line-height: 1.35;
}

.scope-node-tip {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(229, 229, 229, 0.4);
  padding: 0.4rem 0.55rem;
  font-size: 0.62rem;
  color: var(--scope-cyan);
  border-radius: 4px;
  display: none;
  max-width: 200px;
}

/* Below-fold metrics */
.scope-below {
  flex-shrink: 0;
  max-height: 42vh;
  overflow: auto;
  border-top: 1px solid var(--scope-border);
  background: rgba(0, 0, 0, 0.92);
}

.scope-kpi-strip {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 1px;
  background: var(--scope-border);
}
.scope-kpi-cell {
  background: rgba(13, 21, 39, 0.7);
  padding: 0.75rem 1.1rem;
}
.scope-kpi-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--scope-muted);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.scope-kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--scope-cyan);
  font-variant-numeric: tabular-nums;
}
.scope-kpi-sub {
  font-size: 0.68rem;
  color: var(--scope-muted);
  margin-top: 0.2rem;
}
.scope-kpi-sub .vote {
  color: var(--scope-cyan);
}
.scope-kpi-sub .nonvote {
  color: var(--scope-green);
}

.scope-chart-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.scope-chart-tab {
  background: transparent;
  border: 1px solid var(--scope-border);
  color: var(--scope-muted);
  font-family: var(--scope-mono);
  font-size: 0.58rem;
  padding: 0.18rem 0.4rem;
  border-radius: 3px;
  cursor: pointer;
}
.scope-chart-tab.active {
  color: var(--scope-cyan);
  border-color: var(--scope-cyan-dim);
}
.scope-block-chart {
  height: 64px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}
.scope-block-chart .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--scope-cyan) 0%, rgba(115, 115, 115, 0.45) 100%);
  border-radius: 1px 1px 0 0;
  min-height: 3px;
}
.scope-chart-dates {
  display: flex;
  justify-content: space-between;
  font-size: 0.55rem;
  color: var(--scope-muted);
  margin-top: 0.3rem;
}

.scope-dual-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--scope-border);
  border-top: 1px solid var(--scope-border);
}
.scope-table-wrap {
  overflow: auto;
  background: rgba(11, 15, 25, 0.95);
  max-height: 220px;
}
.scope-table-wrap h3 {
  margin: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--scope-cyan);
  border-bottom: 1px solid var(--scope-border);
  background: rgba(13, 21, 39, 0.8);
}
.scope-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
}
.scope-table th {
  text-align: left;
  padding: 0.45rem 0.75rem;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: var(--scope-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--scope-border);
}
.scope-table td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid rgba(26, 36, 54, 0.6);
  font-family: var(--scope-mono);
  font-size: 0.65rem;
}
.scope-table tr:hover td {
  background: rgba(229, 229, 229, 0.04);
}
.scope-table tr.highlight td {
  background: rgba(229, 229, 229, 0.12);
  outline: 1px solid rgba(229, 229, 229, 0.35);
}
.scope-table .tx-id {
  color: var(--scope-cyan);
}

/* Panel pages */
.scope-panel-full {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.25rem;
  background: var(--scope-bg);
}
.scope-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--scope-cyan);
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.scope-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--scope-border);
  border: 1px solid var(--scope-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.scope-metric-card {
  background: rgba(13, 21, 39, 0.75);
  padding: 0.75rem 1rem;
}
.scope-metric-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--scope-cyan);
  text-transform: uppercase;
}
.scope-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.72rem;
  padding: 0.18rem 0;
  border-bottom: 1px solid rgba(26, 36, 54, 0.45);
}
.scope-metric-row:last-child {
  border-bottom: none;
}
.scope-metric-row .label {
  color: var(--scope-muted);
}
.scope-metric-row .value {
  font-family: var(--scope-mono);
  font-size: 0.68rem;
}
.scope-metric-row .value.good {
  color: var(--scope-green);
}

.scope-tag {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  font-size: 0.58rem;
  font-weight: 600;
}
.scope-tag.atu {
  background: rgba(229, 229, 229, 0.15);
  color: var(--scope-cyan);
}
.scope-tag.abm {
  background: rgba(52, 211, 153, 0.15);
  color: var(--scope-green);
}
.scope-tag.mirra {
  background: rgba(163, 163, 163, 0.15);
  color: var(--scope-purple);
}
.scope-tag.ok {
  background: rgba(57, 211, 83, 0.15);
  color: var(--scope-green-bright);
}
.scope-tag.fail {
  background: rgba(163, 163, 163, 0.15);
  color: var(--scope-red);
}
.scope-tag.low {
  background: rgba(52, 211, 153, 0.1);
  color: var(--scope-green);
}
.scope-tag.med {
  background: rgba(115, 115, 115, 0.1);
  color: var(--scope-amber);
}
.scope-tag.high {
  background: rgba(163, 163, 163, 0.1);
  color: var(--scope-red);
}

/* Languages matrix */
.scope-lang-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  min-height: 420px;
}
.scope-lang-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.scope-lang-search {
  flex: 1;
  min-width: 160px;
  background: rgba(13, 21, 39, 0.7);
  border: 1px solid var(--scope-border);
  border-radius: 4px;
  color: var(--scope-text);
  font-family: var(--scope-mono);
  font-size: 0.7rem;
  padding: 0.4rem 0.6rem;
}
.scope-lang-filters {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.scope-lang-filter {
  font-family: var(--scope-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--scope-border);
  background: transparent;
  color: var(--scope-muted);
  border-radius: 3px;
  cursor: pointer;
}
.scope-lang-filter.active {
  color: var(--scope-cyan);
  border-color: var(--scope-cyan-dim);
}
.scope-lang-list {
  border: 1px solid var(--scope-border);
  border-radius: 6px;
  overflow: auto;
  max-height: 520px;
  background: rgba(13, 21, 39, 0.5);
}
.scope-lang-section-h {
  position: sticky;
  top: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--scope-purple);
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid var(--scope-border);
  z-index: 1;
}
.scope-lang-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(26, 36, 54, 0.5);
  cursor: pointer;
  font-size: 0.68rem;
}
.scope-lang-row:hover,
.scope-lang-row.selected {
  background: rgba(229, 229, 229, 0.08);
}
.scope-lang-row .id {
  color: var(--scope-muted);
  font-variant-numeric: tabular-nums;
}
.scope-lang-detail {
  border: 1px solid var(--scope-border);
  border-radius: 6px;
  padding: 1rem;
  background: rgba(13, 21, 39, 0.65);
  position: sticky;
  top: 0;
}
.scope-lang-detail h4 {
  margin: 0 0 0.5rem;
  color: var(--scope-cyan);
  font-size: 0.9rem;
}
.scope-lang-detail p {
  margin: 0.35rem 0;
  font-size: 0.72rem;
  color: var(--scope-muted);
  line-height: 1.5;
}
.scope-lang-note {
  margin-top: 0.75rem;
  padding: 0.5rem;
  border: 1px dashed rgba(163, 163, 163, 0.35);
  font-size: 0.62rem;
  color: var(--scope-purple);
  line-height: 1.4;
}

.scope-heatmap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  padding: 0.5rem 0;
  max-width: 900px;
}
.scope-heat-cell {
  aspect-ratio: 1;
  border-radius: 3px;
}
.scope-builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}
.scope-builder-card {
  background: rgba(13, 21, 39, 0.7);
  border: 1px solid var(--scope-border);
  border-radius: 6px;
  padding: 1rem;
}
.scope-builder-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
}
.scope-builder-card p {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  color: var(--scope-muted);
  line-height: 1.4;
}
.scope-cta {
  display: inline-block;
  background: rgba(229, 229, 229, 0.1);
  color: var(--scope-cyan);
  border: 1px solid var(--scope-cyan-dim);
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
}
.scope-inst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.scope-inst-stat {
  background: rgba(13, 21, 39, 0.7);
  border: 1px solid var(--scope-border);
  border-radius: 6px;
  padding: 0.85rem;
  text-align: center;
}
.scope-inst-stat .num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--scope-cyan);
}
.scope-inst-stat .lbl {
  font-size: 0.58rem;
  color: var(--scope-muted);
  margin-top: 0.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scope-sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}
.scope-gauge {
  background: rgba(13, 21, 39, 0.7);
  border: 1px solid var(--scope-border);
  border-radius: 6px;
  padding: 0.85rem;
}
.scope-gauge-label {
  font-size: 0.58rem;
  color: var(--scope-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.scope-gauge-bar {
  height: 7px;
  background: var(--scope-border);
  border-radius: 4px;
  overflow: hidden;
}
.scope-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--scope-cyan-dim), var(--scope-cyan));
  border-radius: 4px;
}
.scope-gauge-value {
  font-size: 1rem;
  margin-top: 0.4rem;
}
.scope-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0;
}
.scope-flow-node {
  background: rgba(13, 21, 39, 0.7);
  border: 1px solid var(--scope-border-bright);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  text-align: center;
  min-width: 90px;
}
.scope-flow-node strong {
  display: block;
  font-size: 0.7rem;
  color: var(--scope-cyan);
  margin-bottom: 0.2rem;
}
.scope-flow-node span {
  font-size: 0.58rem;
  color: var(--scope-muted);
}
.scope-flow-arrow {
  color: var(--scope-cyan-dim);
}

@media (max-width: 1100px) {
  .scope-hud-right {
    max-width: 260px;
    width: min(260px, 36vw);
  }
  .scope-kpi-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}
@media (max-width: 900px) {
  .scope-hud-right {
    display: none;
  }
  .scope-dual-tables,
  .scope-kpi-strip,
  .scope-lang-layout {
    grid-template-columns: 1fr;
  }
  .scope-search {
    width: 140px;
  }
}
@media (max-width: 700px) {
  .scope-hud-left {
    max-width: 160px;
    font-size: 0.62rem;
  }
  .scope-nav {
    display: none;
  }
}

/* === UX system batch (100-item coverage, greyscale tokens) === */
:root {
  --ux-black: #000;
  --ux-void: #0a0a0a;
  --ux-panel: #141414;
  --ux-border: #2a2a2a;
  --ux-muted: #737373;
  --ux-soft: #a3a3a3;
  --ux-white: #fff;
  --ux-row-h: 36px;
  --z-hud: 40;
  --z-header: 100;
  --z-banner: 200;
  --z-tip: 300;
}

.clarity-brand-header .scope-brand span {
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ux-white);
}
.clarity-about-link {
  color: var(--ux-soft);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.5rem;
}
.clarity-about-link:hover { color: var(--ux-white); }
.feed-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--scope-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--ux-soft);
  border: 1px solid var(--ux-border);
  padding: 0.25rem 0.55rem;
  border-radius: 0.75rem;
  background: rgba(20, 20, 20, 0.85);
}
.feed-status .scope-pinger.stable .scope-pinger-core,
.scope-pinger.stable .scope-pinger-core {
  background: var(--ux-white);
}
.scope-pinger.awaiting .scope-pinger-core { background: var(--ux-muted); }

.ux-num, .scope-kpi-value, .scope-kpi-block .val, .scope-table td {
  font-family: var(--scope-mono);
  font-variant-numeric: tabular-nums;
}
.ux-label { color: var(--ux-muted); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ux-value { color: var(--ux-white); }
.ux-badge {
  display: inline-block;
  font-family: var(--scope-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  padding: 0.12rem 0.4rem;
  border-radius: 0.35rem;
  border: 1px solid var(--ux-border);
}
.ux-badge-succ { color: var(--ux-white); border-color: #525252; }
.ux-badge-pend { color: var(--ux-soft); }
.ux-badge-fail { color: var(--ux-muted); }
.ux-copyable { cursor: copy; }
.ux-copyable:hover { color: var(--ux-white); }
.ux-copied::after { content: " copied"; color: var(--ux-soft); font-size: 0.6rem; }

.scope-hud-panel {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ux-border);
  border-radius: 0.75rem; /* rounded-xl */
  will-change: transform;
  z-index: var(--z-hud);
}
.scope-table tbody tr { height: var(--ux-row-h); }
.scope-table tbody tr:hover { color: var(--ux-white); background: rgba(255,255,255,0.03); }
.scope-nav-btn:active, .scope-module-btn:active, .scope-chart-tab:active { transform: scale(0.95); }

.scope-main, .scope-hud-left, .scope-hud-right, .scope-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
.scope-main::-webkit-scrollbar,
.scope-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.scope-main::-webkit-scrollbar-thumb,
.scope-table-wrap::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

.ux-skeleton {
  background: linear-gradient(90deg, #141414 25%, #2a2a2a 50%, #141414 75%);
  background-size: 200% 100%;
  animation: ux-shimmer 1.2s ease-in-out infinite;
  border-radius: 0.35rem;
  min-height: 0.85rem;
}
@keyframes ux-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ux-offline-banner {
  position: sticky;
  top: 0;
  z-index: var(--z-banner);
  background: #141414;
  color: var(--ux-soft);
  border-bottom: 1px solid var(--ux-border);
  text-align: center;
  font-family: var(--scope-mono);
  font-size: 0.72rem;
  padding: 0.4rem;
}
.ux-offline-banner[hidden] { display: none !important; }

.live-slot-card {
  border: 1px solid var(--ux-border);
  background: rgba(20,20,20,0.85);
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
}
.live-slot-card .slot-num {
  font-family: var(--scope-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  color: var(--ux-white);
}
.live-slot-progress {
  height: 3px;
  background: #2a2a2a;
  border-radius: 2px;
  margin-top: 0.45rem;
  overflow: hidden;
}
.live-slot-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: #e5e5e5;
  transition: width 0.4s ease;
}
.scope-tf-tabs { display: flex; gap: 0.25rem; margin: 0.35rem 0; }
.scope-tf-tab {
  font-family: var(--scope-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--ux-muted);
  background: transparent;
  border: 1px solid var(--ux-border);
  border-radius: 0.35rem;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}
.scope-tf-tab.active, .scope-tf-tab:hover { color: var(--ux-white); border-color: #525252; }

html { scroll-behavior: smooth; }
