/**
 * CounterMeasure Tenant UI product overlay.
 *
 * Generated from the WASM tenant UI implementation while adopting
 * /Users/wyattroersma/main/CounterMeasure Design System/ as the canonical
 * visual source. Keep Docker consumers independent from npm by syncing this
 * file into tenant-ui-wasm as a static CSS snapshot.
 */

@import "./no-fonts.css";

:root {
  color-scheme: dark;
  --bg-base: #0b0f17;
  --bg-app: #0e1320;
  --bg-card: #111827;
  --bg-card-2: #161f31;
  --bg-input: #0d1421;
  --bg-glass: rgba(255, 255, 255, 0.025);
  --bg-glass-2: rgba(255, 255, 255, 0.05);
  --bg-glass-3: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.075);
  --border-2: rgba(255, 255, 255, 0.12);
  --border-3: rgba(255, 255, 255, 0.17);
  --text: #f3f5f9;
  --text-2: #c5cbd6;
  --text-3: #8b94a6;
  --text-4: #687184;
  --brand: #ff7a00;
  --brand-hot: #ff9233;
  --brand-soft: rgba(255, 122, 0, 0.11);
  --critical: #ef4444;
  --critical-bg: rgba(239, 68, 68, 0.12);
  --critical-bd: rgba(239, 68, 68, 0.32);
  --high: #f59e0b;
  --high-bg: rgba(245, 158, 11, 0.12);
  --high-bd: rgba(245, 158, 11, 0.32);
  --medium: #8b5cf6;
  --medium-bg: rgba(139, 92, 246, 0.12);
  --medium-bd: rgba(139, 92, 246, 0.32);
  --low: #38bdf8;
  --low-bg: rgba(56, 189, 248, 0.12);
  --low-bd: rgba(56, 189, 248, 0.32);
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, 0.12);
  --ok-bd: rgba(34, 197, 94, 0.32);
  --rose: var(--critical);
  --amber: var(--high);
  --violet: var(--medium);
  --cyan: var(--low);
  --emerald: var(--ok);
  --surface: var(--bg-card);
  --surface-raised: var(--bg-card-2);
  --surface-hover: var(--bg-glass-2);
  --muted: var(--text-2);
  --subtle: var(--text-3);
  --sidebar-w: 236px;
  --header-h: 52px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font-display: Sora, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.34);
  font-family: var(--font-display);
}

body {
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(255, 122, 0, 0.04), transparent 60%),
    linear-gradient(180deg, #0b0f17, #0d1320);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
textarea {
  font-family: inherit;
}

code,
kbd,
pre,
.mono,
.tu-cell-mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
}

.app-shell {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background: var(--bg-app);
}

.app-shell-bannered {
  grid-template-rows: 36px minmax(0, 1fr);
}

.app-shell:not(.app-shell-bannered) .sidebar,
.app-shell:not(.app-shell-bannered) .main-panel {
  grid-row: 1;
}

.app-shell-bannered .sidebar,
.app-shell-bannered .main-panel {
  grid-row: 2;
}

.shell-banners {
  min-height: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(11, 15, 23, 0.94);
  padding: 0;
}

.demo-mode-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--high);
  font-size: 12px;
  font-weight: 600;
}

.demo-mode-banner-hint {
  color: var(--text-4);
  font-size: 10.5px;
  font-weight: 500;
}

.sidebar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 12px 10px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: #0a0f1a;
  backdrop-filter: none;
}

.sidebar::after {
  position: absolute;
  inset: 0 0 auto;
  height: 110px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 122, 0, 0.035), transparent);
  content: "";
}

.sidebar-header,
.sidebar-sage-button,
.sidebar-nav,
.sidebar-footer {
  position: relative;
  z-index: 1;
}

.sidebar-header {
  height: 36px;
  padding: 0 6px;
}

.brand {
  gap: 8px;
}

.brand-mark-product {
  width: 22px;
  height: 22px;
}

.brand-copy strong {
  display: flex;
  gap: 0;
  align-items: baseline;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.brand .brand-accent {
  color: var(--brand);
}

.sidebar-sage-button {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  width: 100%;
  border: 1px solid rgba(255, 122, 0, 0.3);
  border-radius: 8px;
  background: rgba(255, 122, 0, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
}

.sidebar-sage-button:hover {
  border-color: rgba(255, 122, 0, 0.45);
  background: rgba(255, 122, 0, 0.14);
}

.sidebar-sage-button span {
  flex: 1;
  text-align: left;
}

.sidebar-sage-button kbd,
.search-trigger kbd {
  height: 20px;
  min-width: 20px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text-3);
  font: 600 10px/18px var(--font-mono);
  padding: 0 6px;
}

.sidebar-nav {
  flex: 1;
  gap: 14px;
  overflow-y: auto;
  padding: 0 0 8px;
}

.nav-section {
  gap: 1px;
}

.nav-section-title {
  margin: 10px 0 5px;
  padding: 0 10px;
  color: var(--text-4);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.nav-section-icon {
  display: none;
}

.nav-link,
.nav-subnav-summary {
  min-height: 32px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  padding: 0 10px;
}

.nav-link:hover,
.nav-subnav-summary:hover {
  background: var(--bg-glass-2);
  color: var(--text);
}

.nav-link-active {
  background: var(--brand-soft);
  color: var(--text);
}

.nav-link-active::before {
  left: -10px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
  box-shadow: none;
}

.nav-icon {
  width: 16px;
  height: 16px;
  border: 0;
  background: transparent;
  color: var(--text-3);
}

.nav-link-active .nav-icon {
  color: var(--brand-hot);
}

.nav-link-label {
  transition: transform 150ms ease;
}

.nav-link:hover .nav-link-label,
.nav-subnav-summary:hover .nav-link-label {
  transform: translateX(2px);
}

.nav-subnav-items {
  max-height: 0;
  gap: 2px;
  margin-top: 0;
  overflow: hidden;
  padding-left: 8px;
  opacity: 0;
  transition:
    max-height 200ms ease,
    opacity 200ms ease;
}

.nav-subnav-items-open {
  max-height: 400px;
  opacity: 1;
}

.nav-link.nav-link-indent {
  min-height: 28px;
  color: var(--text-3);
  font-size: 12.5px;
  padding-left: 32px;
}

.nav-link.nav-link-indent .nav-icon {
  display: none;
}

.nav-link.nav-link-indent.nav-link-active::before {
  display: none;
}

.sidebar-footer {
  gap: 1px;
  border-top: 1px solid var(--border);
  padding: 8px 0 0;
}

.main-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: var(--header-h) minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--header-h);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 23, 0.86);
  padding: 0 32px;
  backdrop-filter: blur(12px);
}

.topbar-leading {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 12px;
}

.topbar-breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 13px;
}

.topbar-breadcrumb strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb-chevron {
  color: var(--text-4);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 0;
  gap: 10px;
}

.action-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-trigger {
  width: clamp(220px, 21vw, 280px);
  min-width: 0;
  flex: 0 1 280px;
  height: 32px;
  min-height: 32px;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-3);
  padding: 0 10px;
}

.search-trigger:hover,
.feedback-button:hover,
.icon-btn:hover {
  border-color: var(--border-2);
  background: var(--bg-glass-2);
  color: var(--text);
}

.search-trigger span:not(.cm-icon) {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-width: 96px;
  height: 32px;
  min-height: 32px;
  flex: 0 0 auto;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  padding: 0 12px;
  white-space: nowrap;
}

.feedback-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
}

.icon-btn .cm-icon,
.feedback-button .cm-icon,
.search-trigger .cm-icon {
  width: 16px;
  height: 16px;
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--bg-base);
  border-radius: 999px;
  background: var(--ok);
}

.notification-badge {
  display: none;
}

.user-chip {
  width: 28px;
  height: 28px;
  min-height: 28px;
  flex: 0 0 28px;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-hot), var(--brand));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0;
}

.user-avatar-initials {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.content {
  width: min(100%, 1480px);
  min-height: 0;
  margin: 0 auto;
  overflow-y: auto;
  padding: 24px 28px 64px;
}

.route-stack,
.tu-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-title-row,
.tu-home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
}

.page-title-row h1,
.tu-h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.page-title-row p,
.tu-sub {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 13.5px;
}

.tu-date {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-glass);
  color: var(--text-3);
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  padding: 7px 10px;
  text-transform: uppercase;
}

.grid,
.stat-grid-five,
.stat-grid-four,
.analytics-strip,
.tu-grid {
  display: grid;
  gap: 12px;
}

.stat-grid-five,
.tu-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.card,
.metric,
.stat-card,
.table-shell,
.filter-rail,
.status-item,
.tu-card,
.tu-kpi,
.tu-exec {
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-2);
}

.card,
.table-shell,
.tu-card {
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.card h2,
.table-shell-header h2,
.tu-card-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.card p,
.table-shell-header p {
  color: var(--text-3);
}

.eyebrow,
.tu-card-eyebrow,
.table th,
.metric span,
.stat-card span,
.tu-kpi-label {
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge {
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}

.badge-cyan {
  border-color: var(--low-bd);
  background: var(--low-bg);
  color: var(--low);
}

.badge-emerald {
  border-color: var(--ok-bd);
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-amber {
  border-color: var(--high-bd);
  background: var(--high-bg);
  color: var(--high);
}

.badge-rose {
  border-color: var(--critical-bd);
  background: var(--critical-bg);
  color: var(--critical);
}

.btn {
  min-height: 36px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.btn-primary,
.tu-exec-btn-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn-secondary,
.btn-ghost,
.tu-exec-btn-ghost {
  border-color: var(--border);
  background: var(--bg-glass);
  color: var(--text-2);
}

.table {
  min-width: 760px;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 11px 12px;
}

.table th {
  background: rgba(255, 255, 255, 0.025);
}

.table tr:hover td {
  background: var(--bg-glass);
}

.tu-exec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 408px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.tu-exec-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 238px;
  padding: 24px 28px;
}

.tu-exec-eyebrow,
.ops-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font: 700 11px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tu-pulse-dot,
.ops-pill-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ok);
}

.tu-pulse-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--ok);
  border-radius: inherit;
  opacity: 0.5;
  content: "";
}

.tu-exec-title {
  max-width: 820px;
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}

.tu-exec-title em {
  border-radius: 4px;
  background: var(--high-bg);
  color: var(--high);
  font-style: normal;
  padding: 1px 6px;
}

.tu-exec-body {
  max-width: 760px;
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}

.tu-exec-body code {
  border: 1px solid var(--high-bd);
  border-radius: 4px;
  background: var(--high-bg);
  color: var(--high);
  font-size: 12.5px;
  padding: 2px 6px;
}

.tu-exec-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.tu-exec-btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
}

.tu-exec-meta {
  color: var(--text-4);
  font-size: 12px;
}

.tu-exec-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 1px solid var(--border);
  background: var(--bg-card-2);
  padding: 22px 24px;
}

.tu-fico-head,
.tu-fico-factor-top,
.tu-kpi-top,
.tu-chart-head,
.tu-risk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tu-fico-label,
.tu-risk-sum-l {
  color: var(--text-3);
  font: 700 10.5px/1.4 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tu-fico-band,
.tu-kpi-trend,
.tu-chart-delta {
  border-radius: 4px;
  font: 700 11px/1 var(--font-mono);
  padding: 4px 8px;
}

.tu-fico-band,
.tu-kpi-trend[data-pos="true"],
.tu-chart-delta-pos {
  background: var(--ok-bg);
  color: var(--ok);
}

.tu-kpi-trend[data-pos="false"],
.tu-chart-delta-neg {
  background: var(--high-bg);
  color: var(--high);
}

.tu-fico-score {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.tu-fico-num {
  color: var(--text);
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}

.tu-fico-range {
  color: var(--text-4);
  font: 700 14px/1 var(--font-mono);
}

.tu-fico-delta {
  color: var(--ok);
  font: 700 11.5px/1 var(--font-mono);
}

.tu-fico-bar {
  position: relative;
  margin-top: 4px;
  padding-top: 18px;
}

.tu-fico-bar-track {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.tu-fico-seg {
  height: 100%;
  border-right: 1px solid rgba(0, 0, 0, 0.38);
}

.tu-fico-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.tu-fico-marker-tri {
  width: 0;
  height: 0;
  border-top: 8px solid var(--text);
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
}

.tu-fico-scale,
.tu-fico-legend {
  display: flex;
  justify-content: space-between;
  color: var(--text-4);
  font: 600 9.5px/1.4 var(--font-mono);
}

.tu-fico-legend {
  justify-content: flex-start;
  gap: 14px;
  color: var(--text-3);
  font-size: 10.5px;
}

.tu-fico-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tu-fico-legend i,
.tu-chart-dot,
.tu-risk-sw {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.tu-fico-factors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.tu-fico-factor {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tu-fico-factor-top {
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
}

.progress-track,
.tu-fico-factor .progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  background: var(--low);
}

.progress-emerald .progress-fill {
  background: var(--ok);
}

.progress-amber .progress-fill {
  background: var(--high);
}

.progress-rose .progress-fill {
  background: var(--critical);
}

.tu-kpi {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.tu-kpi-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-bd, var(--border));
  border-radius: 8px;
  background: var(--accent-bg, var(--bg-glass-2));
  color: var(--accent, var(--text-2));
}

.tu-kpi[data-accent="cyan"] {
  --accent: var(--low);
  --accent-bg: var(--low-bg);
  --accent-bd: var(--low-bd);
}

.tu-kpi[data-accent="rose"] {
  --accent: var(--critical);
  --accent-bg: var(--critical-bg);
  --accent-bd: var(--critical-bd);
}

.tu-kpi[data-accent="emerald"] {
  --accent: var(--ok);
  --accent-bg: var(--ok-bg);
  --accent-bd: var(--ok-bd);
}

.tu-kpi[data-accent="violet"] {
  --accent: var(--medium);
  --accent-bg: var(--medium-bg);
  --accent-bd: var(--medium-bd);
}

.tu-kpi-value,
.tu-chart-num,
.tu-risk-sum-v {
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tu-spark {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: auto;
}

.tu-chart-card {
  padding: 20px 22px;
}

.tu-chart-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.tu-chart-stat {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 6px;
}

.tu-chart-meta {
  color: var(--text-3);
  font: 600 12px/1.4 var(--font-mono);
}

.tu-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.tu-chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12.5px;
}

.tu-line-svg {
  display: block;
  width: 100%;
}

.tu-line-svg .grid {
  stroke: var(--border);
  stroke-width: 1;
}

.tu-line-svg .axis,
.tu-line-svg .axis-x,
.tu-line-svg .axis-y {
  fill: var(--text-4);
  font: 600 10.5px/1 var(--font-mono);
}

.tu-line-svg .axis-y {
  text-anchor: end;
}

.tu-line-svg .axis-x {
  text-anchor: middle;
}

.tu-line-svg .yAxisLabel {
  fill: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}

.tu-risk {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tu-risk-summary {
  display: flex;
  gap: 24px;
}

.tu-risk-sum {
  display: flex;
  min-width: 80px;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.tu-risk-sum-v small {
  color: var(--text-4);
  font-size: 12px;
}

.tu-risk-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tu-risk-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(240px, 1.4fr) 76px;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card-2);
  padding: 12px 14px;
}

.tu-risk-row[data-tone="bad"] {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.tu-risk-row[data-tone="warn"] {
  border-color: rgba(245, 158, 11, 0.24);
}

.tu-risk-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.tu-risk-name > span:first-child {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.tu-risk-meta {
  color: var(--text-4);
  font: 600 11px/1.4 var(--font-mono);
}

.tu-risk-track {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.09) 0 5px, rgba(255,255,255,0.04) 5px 8px);
}

.tu-risk-fill {
  height: 100%;
}

.tu-risk-fill[data-tone="ok"],
.tu-risk-sw[data-tone="ok"] {
  background: var(--ok);
}

.tu-risk-fill[data-tone="warn"],
.tu-risk-sw[data-tone="warn"] {
  background: var(--high);
}

.tu-risk-fill[data-tone="bad"],
.tu-risk-sw[data-tone="bad"] {
  background: var(--critical);
}

.tu-risk-residual {
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
}

.tu-risk-cov {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.tu-risk-pct {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.tu-risk-weight {
  color: var(--text-4);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tu-risk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-3);
  font-size: 12px;
}

.tu-risk-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.browser-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 14px;
}

.filter-rail {
  border-radius: var(--radius-lg);
  padding: 14px;
}

.filter-rail h2 {
  margin: 14px 0 8px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.filter-option {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  padding: 0 10px;
}

.filter-option-active,
.filter-option:hover {
  border-color: var(--border);
  background: var(--bg-glass-2);
  color: var(--text);
}

.browser-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.browser-toolbar,
.mini-legend,
.connector-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.browser-toolbar input,
.connector-tabs input,
.field input,
.field textarea,
.search-field input {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  padding: 0 12px;
}

.browser-toolbar input {
  flex: 1 1 280px;
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-glass);
  padding: 3px;
}

.segment {
  min-height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
}

.segment-active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-2);
}

.empty-state {
  border: 1px dashed var(--border-2);
  border-radius: 10px;
  background:
    repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, 0.015) 6px 8px),
    var(--bg-glass);
}

@media (min-width: 921px) {
  .topbar-leading {
    display: flex;
  }
}

@media (max-width: 1200px) {
  .topbar {
    padding: 0 24px;
  }

  .tu-exec {
    grid-template-columns: 1fr;
  }

  .tu-exec-right {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .stat-grid-five,
  .tu-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-trigger {
    width: clamp(180px, 19vw, 240px);
    min-width: 0;
  }
}

@media (max-width: 1120px) {
  .topbar-actions {
    gap: 8px;
  }

  .feedback-button {
    width: 32px;
    min-width: 32px;
    padding: 0;
  }

  .feedback-button span:not(.cm-icon) {
    display: none;
  }
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .main-panel {
    display: block;
  }

  .topbar {
    display: flex;
    min-height: 56px;
  }

  .topbar-breadcrumb {
    display: none;
  }

  .content {
    overflow: visible;
    padding: 18px 16px 48px;
  }

  .browser-layout,
  .grid,
  .analytics-strip,
  .tu-risk-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar-actions {
    min-width: 0;
    gap: 4px;
  }

  .topbar {
    padding: 0 12px;
  }

  .search-trigger {
    flex: 1 1 140px;
    min-width: 0;
  }

  .search-trigger kbd,
  .feedback-button span:not(.cm-icon),
  .sidebar-sage-button kbd {
    display: none;
  }

  .feedback-button {
    width: 32px;
    justify-content: center;
    padding: 0;
  }

  .page-title-row,
  .tu-home-head {
    align-items: stretch;
    flex-direction: column;
  }

  .stat-grid-five,
  .tu-grid-4,
  .tu-fico-factors {
    grid-template-columns: 1fr;
  }
}

/* Page-family bridges for the Rust/WASM implementation. */
.tu-listcard-tabs,
.det-tabs,
.ta-region-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.det-tab,
.dt-tbtn,
.ta-region-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-glass);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  padding: 0 11px;
}

.det-tab.is-active,
.ta-region-pill[data-active="true"],
.dt-tbtn:hover {
  border-color: rgba(255, 122, 0, 0.42);
  background: var(--brand-soft);
  color: var(--text);
}

.det-tab b,
.ta-region-count,
.dt-count b {
  color: var(--text);
  font-family: var(--font-mono);
}

.det-rail,
.ai-intel-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.det-kpi,
.ai-intel-kpi {
  display: grid;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  padding: 16px;
}

.det-kpi-icon,
.ai-intel-kpi-icon,
.ta-header-icon,
.th-hero-icon,
.th-sage-icon,
.th-detcov-icon,
.th-picker-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-glass-2);
  color: var(--brand-hot);
}

.det-kpi-num,
.ai-intel-kpi-val,
.ta-comp-num,
.th-ring-score {
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.det-kpi-lbl,
.ai-intel-kpi-label,
.th-eyebrow {
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.det-kpi-sub,
.ai-intel-kpi-trend,
.ai-intel-kpi-pulse,
.ta-actor-alias,
.ta-motive,
.ta-last,
.th-card-meta,
.th-hero-desc,
.th-picker-meta {
  color: var(--text-3);
  font-size: 12px;
}

.dt-wrap,
.ta-card,
.th-card,
.th-sage,
.th-hero,
.ai-intel-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: hidden;
}

.dt-toolbar,
.ai-intel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding: 12px;
}

.dt-toolbar-spacer {
  flex: 1;
}

.dt-quick {
  display: flex;
  flex: 1 1 260px;
  min-width: 220px;
}

.dt-quick input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  padding: 0 11px;
}

.dt-scroll {
  overflow-x: auto;
}

.dt-grid {
  min-width: 980px;
}

.dt-r {
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.det-cols,
.det-row {
  grid-template-columns: 42px minmax(260px, 1.7fr) 110px 120px 110px 150px 170px 130px 110px;
}

.ta-cols,
.ta-row {
  grid-template-columns: minmax(240px, 1.8fr) 160px 90px 120px 180px 80px 100px 40px;
}

.dt-r-head {
  background: rgba(255, 255, 255, 0.025);
}

.dt-h,
.dt-c {
  min-width: 0;
  padding: 10px 12px;
}

.dt-h {
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dt-c {
  color: var(--text-2);
  font-size: 13px;
}

.dt-row {
  color: inherit;
  text-decoration: none;
}

.dt-row:hover {
  background: var(--bg-glass);
}

.dt-cell-stack,
.ai-intel-row-main,
.th-picker-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.dt-cell-strong,
.ai-intel-row-title,
.ta-actor-name,
.th-card-title,
.th-hero-title,
.th-picker-name {
  color: var(--text);
  font-weight: 800;
}

.ta-actor-name,
.ta-region-cell,
.ta-composite-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.ta-actor-name {
  flex-wrap: wrap;
}

.ta-region-cell {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.ta-hot,
.ta-sec,
.ta-region-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-glass-2);
  color: var(--text-3);
  font: 800 9.5px/1 var(--font-mono);
  letter-spacing: 0.05em;
  padding: 3px 5px;
}

.ta-hot {
  border-color: var(--high-bd);
  background: var(--high-bg);
  color: var(--high);
}

.ta-sec {
  border-color: var(--ok-bd);
  background: var(--ok-bg);
  color: var(--ok);
}

.dt-cell-mono,
.dt-cell-muted,
.th-gaps-num,
.th-gaps-detail-meta {
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 11px;
}

.dt-cell-trunc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-cell-pill,
.ta-tier,
.th-sev {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-glass-2);
  color: var(--text-2);
  font: 700 10.5px/1 var(--font-mono);
  padding: 4px 7px;
}

.dt-cell-pill[data-tone="critical"],
.dt-cell-pill[data-tone="high"],
.th-sev-critical {
  border-color: var(--critical-bd);
  background: var(--critical-bg);
  color: var(--critical);
}

.dt-cell-pill[data-tone="medium"],
.dt-cell-pill[data-tone="draft"],
.dt-cell-pill[data-tone="testing"],
.th-sev-high {
  border-color: var(--high-bd);
  background: var(--high-bg);
  color: var(--high);
}

.dt-cell-pill[data-tone="validated"],
.dt-cell-pill[data-tone="active"],
.dt-cell-pill[data-tone="production"] {
  border-color: var(--ok-bd);
  background: var(--ok-bg);
  color: var(--ok);
}

.det-confidence,
.ta-cov {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.det-confidence-bar,
.ta-cov-bar {
  display: inline-flex;
  width: 72px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.det-confidence-bar span,
.ta-cov-bar span {
  display: block;
  width: var(--confidence-value, var(--coverage-value, 72%));
  background: currentColor;
}

.dt-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  color: var(--text-3);
  font-size: 12px;
}

.gap-header,
.th-topbar,
.th-hero,
.th-card-head,
.th-detcov-head,
.ai-intel-row,
.ai-intel-row-head,
.ai-intel-row-meta,
.ai-intel-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gap-header,
.th-hero {
  justify-content: space-between;
  padding: 18px 20px;
}

.gap-header-row,
.gap-header-title,
.th-hero-l,
.th-detcov-head-l {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gap-header-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.gap-header-desc {
  margin-top: 5px;
  color: var(--text-3);
  font-size: 13px;
}

.th-grid-1,
.ai-intel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.th-card,
.th-sage,
.ai-intel-card {
  padding: 18px;
}

.th-topbar {
  flex-wrap: wrap;
  justify-content: space-between;
}

.th-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-glass);
  color: var(--text-2);
  cursor: pointer;
  padding: 9px 12px;
}

.th-picker-btn:hover {
  border-color: var(--border-2);
  background: var(--bg-glass-2);
  color: var(--text);
}

.th-pillars,
.th-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.th-pillar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-glass);
  color: var(--text-2);
  padding: 5px 9px;
}

.th-pillar-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brand);
}

.th-hero-r,
.th-ring {
  display: grid;
  place-items: center;
}

.th-hero-r {
  min-width: 132px;
  gap: 8px;
  justify-items: center;
}

.th-ring {
  width: auto;
  height: auto;
}

.th-hero-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.th-gaps-table,
.th-detcov-list,
.ai-intel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.th-gaps-row {
  display: grid;
  grid-template-columns: 42px 110px minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-glass);
  color: var(--text-2);
  padding: 10px;
  text-align: left;
}

.th-card-title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.th-gaps-detail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.th-gaps-detail-name {
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-gaps-head {
  background: transparent;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.th-detcov-pct {
  color: var(--high);
  font-size: 28px;
  font-weight: 800;
}

.th-detcov-sage {
  display: flex;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-glass);
  color: var(--text-2);
  padding: 12px;
}

.th-em-warn {
  color: var(--high);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
}

.th-mitre-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ai-intel-row {
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-glass);
  color: inherit;
  padding: 12px;
  text-decoration: none;
}

.ai-intel-row:hover {
  border-color: var(--border-2);
  background: var(--bg-glass-2);
}

.ai-intel-row-mark {
  width: 4px;
  align-self: stretch;
  border-radius: 999px;
  background: var(--brand);
}

.ai-intel-row-id,
.ai-intel-row-kind {
  color: var(--text-4);
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-intel-row-sep {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--text-4);
}

.ai-intel-row-btn {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-glass);
  color: var(--text-2);
}

@media (max-width: 920px) {
  .det-rail,
  .ai-intel-kpis,
  .th-mitre-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dt-grid {
    min-width: 860px;
  }

  .th-gaps-row,
  .gap-header,
  .th-hero,
  .ai-intel-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .det-rail,
  .ai-intel-kpis,
  .th-mitre-grid {
    grid-template-columns: 1fr;
  }
}

/* Overview parity polish: match the React operations dashboard density. */
.content {
  width: min(100%, 1508px);
}

.dashboard-parity {
  gap: 16px;
}

.dashboard-parity .tu-home-head {
  padding-top: 0;
  padding-bottom: 0;
}

.dashboard-parity .tu-exec {
  border-color: rgba(62, 78, 108, 0.62);
  background: #101827;
}

.dashboard-parity .tu-exec-left {
  min-height: 306px;
  gap: 18px;
  padding: 26px 28px 24px;
}

.dashboard-parity .tu-exec-actions {
  margin-top: 4px;
}

.dashboard-parity .tu-exec-btn {
  min-height: 42px;
  padding: 0 16px;
}

.dashboard-parity .tu-exec-btn-primary {
  box-shadow: 0 10px 24px rgba(255, 122, 0, 0.16);
}

.dashboard-parity .tu-exec-right {
  gap: 10px;
  background: #172133;
  padding: 22px 24px 18px;
}

.dashboard-parity .tu-fico-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tu-info-dot {
  display: inline-grid;
  width: 13px;
  height: 13px;
  place-items: center;
  border: 1px solid var(--text-4);
  border-radius: 999px;
  color: var(--text-3);
  font: 700 9px/1 var(--font-mono);
  text-transform: none;
}

.dashboard-parity .tu-fico-num,
.dashboard-parity .tu-kpi-value,
.dashboard-parity .tu-chart-num,
.dashboard-parity .tu-risk-sum-v {
  letter-spacing: 0;
}

.dashboard-parity .tu-fico-num {
  font-size: 54px;
}

.dashboard-parity .tu-fico-bar {
  margin-top: 0;
  padding-top: 14px;
}

.dashboard-parity .tu-fico-factors {
  gap: 10px 22px;
  padding-top: 10px;
}

.dashboard-parity .tu-fico-factor {
  gap: 6px;
}

.dashboard-parity .tu-fico-mini {
  display: block;
}

.dashboard-parity .tu-fico-mini .progress-track {
  display: block;
  height: 6px;
  overflow: hidden;
}

.dashboard-parity .tu-fico-mini .progress-fill {
  display: block;
  width: var(--progress-value);
  height: 100%;
  border-radius: inherit;
}

.dashboard-parity .tu-grid-4 {
  gap: 14px;
  margin-top: 8px;
}

.dashboard-parity .tu-kpi {
  min-height: 156px;
  gap: 8px;
  overflow: hidden;
  border-color: rgba(62, 78, 108, 0.62);
  background: #101827;
  padding: 16px 18px 14px;
}

.dashboard-parity .tu-kpi[data-accent="emerald"] {
  border-color: var(--ok-bd);
  box-shadow:
    inset 0 0 0 1px rgba(34, 197, 94, 0.25),
    var(--shadow-2);
}

.dashboard-parity .tu-kpi-icon {
  width: 32px;
  height: 32px;
}

.dashboard-parity .tu-kpi-value {
  font-size: 29px;
}

.dashboard-parity .tu-spark {
  height: 42px;
  color: var(--accent);
}

.dashboard-parity .tu-spark-fill {
  fill: var(--accent-bg);
  opacity: 0.95;
}

.dashboard-parity .tu-spark-line {
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent), transparent 72%));
}

.dashboard-parity .tu-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 4px;
}

.dashboard-parity .tu-section-head h2 {
  margin: 0;
}

.dashboard-parity .tu-chart-card {
  border-color: rgba(62, 78, 108, 0.62);
  background: #101827;
  padding: 18px 20px 20px;
}

.dashboard-parity .tu-line-svg {
  min-height: 300px;
}

.dashboard-parity .tu-line-svg .grid {
  stroke: rgba(62, 78, 108, 0.36);
  stroke-dasharray: 4 6;
}

.dashboard-parity .tu-risk {
  border-color: rgba(62, 78, 108, 0.62);
  background: #101827;
}

.dashboard-parity .tu-risk-row {
  background: #131c2d;
}

@media (max-width: 920px) {
  .dashboard-parity .tu-exec-left {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .dashboard-parity {
    gap: 16px;
  }

  .dashboard-parity .tu-kpi {
    min-height: 144px;
  }
}
