:root{
  --bg:#0b1020;
  --card:#111832;
  --muted:#9aa7c7;
  --text:#eef2ff;
  --line:rgba(255,255,255,.10);
  --line2:rgba(255,255,255,.06);
  --accent:#4f83ff;
  --bad:#ff4d4d;
  --warn:#ffb020;
  --good:#35d07f;
}

*{box-sizing:border-box}
html{height:100%}
body{min-height:100%}

body{
  margin:0;
  color:var(--text);
  font:14px/1.45 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
}

.wrap{
  max-width:1180px;
  margin:0 auto;
  padding:18px 18px;
}

header.wrap{
  padding-top:14px;
  padding-bottom:14px;
}

.nm-sticky-shell{
  position:static;
}

.nm-mobile-sticky-header{
  position:relative;
}

.nm-header-support{
  padding-top:0;
  padding-bottom:14px;
}

main.wrap{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
  padding-top:6px;
}

/* ===== Header / Hero ===== */

.title-row{
  display:block;
}

.toolbar-row{
  display:none;
}

.hero-grid{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.hero-row{
  display:grid;
  column-gap:28px;
  align-items:start;
}

.hero-row--top{
  grid-template-columns:minmax(0, 1fr) auto;
}

.hero-row--bottom{
  grid-template-columns:minmax(0, 640px);
}

.brand-block{
  min-width:0;
}

.toolbar-block{
  min-width:0;
  display:flex;
  justify-content:flex-end;
}

.subtitle-block{
  min-width:0;
  max-width:none;
  display:flex;
  justify-content:flex-start;
}

.oa-brand-switch{
  --switch-padding: 4px;
  --pill-padding-y: 7px;
  --pill-padding-x: 14px;
  --pill-font-size: 14px;
  --pill-radius: 999px;
  --switch-bg: rgba(255,255,255,0.03);
  --switch-border: rgba(255,255,255,0.12);
  --pill-text: rgba(232,238,246,0.72);
  --pill-text-active: #e8eef6;
  --indicator-bg: rgba(90,169,255,0.18);

  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  padding: var(--switch-padding);
  border: 1px solid var(--switch-border);
  border-radius: var(--pill-radius);
  background: var(--switch-bg);
  isolation: isolate;
  min-height: 42px;
}

.oa-brand-switch__indicator{
  display: none;
}

.oa-brand-pill{
  min-width: 0;
  width: auto;
}

.oa-brand-switch--oa .oa-brand-pill--oa,
.oa-brand-switch--nm .oa-brand-pill--nm{
  background: linear-gradient(
    180deg,
    rgba(59,130,246,0.28),
    rgba(59,130,246,0.18)
  );
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.oa-brand-switch--oa .oa-brand-switch__indicator{
  transform: translateX(0%);
}

.oa-brand-switch--nm .oa-brand-switch__indicator{
  transform: translateX(calc(100% + 2px));
}

.oa-brand-pill{
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--pill-padding-y) var(--pill-padding-x);
  font-size: var(--pill-font-size);
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.025em;
  color: var(--pill-text);
  border-radius: var(--pill-radius);
  transition: color 180ms ease, opacity 180ms ease;
}

.oa-brand-pill:hover,
.oa-brand-pill:focus-visible{
  color: #e8eef6;
  text-decoration: none;
  outline: none;
}

.oa-brand-pill:visited{
  color: inherit;
}

.oa-brand-switch--oa .oa-brand-pill--oa,
.oa-brand-switch--nm .oa-brand-pill--nm{
  color: var(--pill-text-active);
}

/* active brand emphasis */

.oa-brand-switch--oa .oa-brand-pill--oa,
.oa-brand-switch--nm .oa-brand-pill--nm{
  font-size: calc(var(--pill-font-size) * 1.8);
  letter-spacing: -0.02em;
}

.oa-brand-primary{
  color:#ffffff;
}

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

.site-subtitle{
  margin-top:0;
  max-width:520px;
  width:100%;
  font-size:14px;
  line-height:1.6;
  color:rgba(255,255,255,0.75);
}

.nm-desktop-hero{
  display:block;
  padding:0 0 10px;
  margin-top:-10px;
}

.nm-desktop-hero__wrap{
  max-width:980px;
  margin:0 auto;
  padding:0 16px;
  text-align:center;
  font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.nm-desktop-hero__copy{
  min-width:0;
}

.nm-desktop-hero__title{
  margin:0;
  font-size:32px;
  line-height:1.12;
  letter-spacing:-0.01em;
  font-weight:700;
  color:#ffffff;
  opacity:0.97;
}

.nm-desktop-hero__accent{
  color:#3b82f6;
}

.nm-desktop-hero__subtitle{
  margin:14px auto 0;
  font-size:18px;
  line-height:1.55;
  max-width:780px;
  font-weight:400;
  letter-spacing:0;
  color:rgba(255,255,255,0.92);
}

.nm-about-details{
  position:relative;
  display:none;
  margin-left:0;
  width:max-content;
}

.nm-about-link{
  display:inline-block;
  background:none;
  border:0;
  padding:0;
  color:rgba(226,232,240,.75);
  font-size:12px;
  line-height:1.4;
  font-weight:600;
  letter-spacing:.2px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  list-style:none;
}

.nm-about-link:hover,
.nm-about-link:focus-visible{
  color:rgba(255,255,255,.95);
  text-decoration:none;
  outline:none;
}

.nm-about-link::-webkit-details-marker{
  display:none;
}

.nm-about-link::marker{
  content:"";
}

.nm-about-row{
  width:100%;
  display:flex;
  justify-content:flex-start;
  padding-left:0;
  margin-top:4px;
}

.nm-about-body{
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  z-index:999;
  width:min(520px, calc(100vw - 40px));
  max-height:70vh;
  overflow:auto;
  padding:16px 18px;
  background:rgba(15,23,42,0.96);
  backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:16px;
  box-shadow:0 16px 36px rgba(0,0,0,0.45);
}

.nm-about-copy{
  font-size:14px;
  line-height:1.65;
  color:rgba(255,255,255,0.82);
  white-space:normal;
}

@media (min-width: 901px){
  .nm-about-details{
    display:inline-block;
  }

  .controls__sub{
    display:none;
  }

  .nm-about-row{
    display:flex;
    justify-content:flex-end;
    width:auto;
    padding-right:0;
    margin-top:0;
  }

  .subtitle-block{
    display:none;
  }

  .nm-desktop-hero__wrap{
    position:relative;
    display:flex;
    align-items:flex-start;
    justify-content:flex-end;
    max-width:1180px;
    min-height:84px;
  }

  .nm-desktop-hero__copy{
    position:absolute;
    left:50%;
    top:0;
    width:min(760px, calc(100% - 280px));
    transform:translateX(-50%);
    text-align:center;
  }

  .nm-desktop-hero__subtitle{
    margin:14px auto 0;
    max-width:760px;
  }
}

.index-map__line strong{
  font-weight:700;
}

/* ===== Controls ===== */

.controls{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:10px;
  width:100%;
  margin-top:0;
}

.controls__top{
  display:flex;
  gap:6px;
  justify-content:flex-end;
  flex-wrap:nowrap;
  align-items:center;
  min-width:0;
  width:auto;
}

.toolbar-block .controls__top{
  justify-content:flex-end;
}

.controls__sub{
  display:flex;
  justify-content:flex-end;
  width:100%;
  margin-top:-2px;
}

.nm-about-row{
  display:flex;
  justify-content:flex-end;
  width:160px;
  padding-right:6px;
  margin-top:0;
}

.legend-block .index-map{
  margin-left:0;
  padding-left:60px;
}

.legend-block .metrics-legend{
  margin-left:0;
  text-align:left;
}

.control{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
  align-items:center;
  flex:0 0 auto;
}

.controls .control__label{
  display:none !important;
}

.control__label{
  font-size:12px;
  color:var(--muted);
}

#windowSelect{width:118px}
#leagueSelect{width:112px}
#filterInput{
  width:160px;
  min-width:160px;
  max-width:160px;
}

.mobile-sort-shell{
  display:none;
}

.metric-stack{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
}

.metric-label,
.mobile-section-label{
  display:none;
}

.rank-value{
  font-size:18px;
  line-height:1;
}

.control__input{
  background:#0f172a;
  color:#e5e7eb;
  border:1px solid #334155;
  border-radius:10px;
  height:37px;
  padding:0 10px;
  outline:none;
}

.control__input:focus{
  outline:none;
  border-color:#3b82f6;
  box-shadow:0 0 0 2px rgba(59,130,246,0.3);
}

.control__input option{
  background-color:#0f172a;
  color:#e5e7eb;
}

.control__input option:checked{
  background-color:#1e293b;
  color:#ffffff;
}

/* ===== Subrow / misc hidden header elements ===== */

.subrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:14px;
  color:var(--muted);
  font-size:12px;
}

.status{color:var(--muted)}

.hint code{
  color:rgba(238,242,255,.9);
  background:rgba(255,255,255,.06);
  padding:3px 6px;
  border-radius:8px;
  border:1px solid var(--line2);
}

.subrow,
.status,
.hint,
.footer,
.card__head{
  display:none !important;
}

/* ===== Card / Table shell ===== */

.card{
  background:transparent;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 18px 60px rgba(0,0,0,.35);
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-height:0;
  margin-top:0px;
}

.card__head{
  padding:14px 14px;
  border-bottom:1px solid var(--line2);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.card__title{font-weight:700}
.card__meta{color:var(--muted);font-size:12px}

.table-wrap{
  position:relative;
  overflow:auto;
  flex:1 1 auto;
  min-height:0;
  scrollbar-width:thin;
  scrollbar-color:rgba(79,131,255,.6) rgba(255,255,255,.06);
}

.table-wrap::-webkit-scrollbar{
  width:10px;
}

.table-wrap::-webkit-scrollbar-track{
  background:rgba(255,255,255,.06);
  border-radius:10px;
}

.table-wrap::-webkit-scrollbar-thumb{
  background:linear-gradient(
    180deg,
    rgba(79,131,255,.8),
    rgba(53,208,127,.8)
  );
  border-radius:10px;
  border:2px solid rgba(17,24,50,.9);
}

.table-wrap::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(
    180deg,
    rgba(79,131,255,1),
    rgba(53,208,127,1)
  );
}

#entitiesTable{
  position:sticky;
  top:0;
  z-index:60;
  background:rgba(11,16,32,.58);
  backdrop-filter:saturate(1.2) blur(6px);
  border-bottom:1px solid var(--line);
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
}

.table th,
.table td{
  padding:12px 12px;
  vertical-align:top;
}

.table th{
  background:transparent;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:12px;
  color:rgba(238,242,255,.9);
}

.table tr td{
  border-bottom:1px solid var(--line2);
}

.table tr:hover td{
  background:rgba(255,255,255,.03);
}

/* ===== Sortable column headers ===== */

.th-btn{
  appearance:none;
  -webkit-appearance:none;
  background:transparent;
  border:0;
  color:inherit;
  font:inherit;
  padding:0;
  margin:0;
  cursor:pointer;
  display:block;
  width:100%;
  text-align:left;
}

.th-btn:focus{
  outline:none !important;
}

.th-btn:focus-visible{
  outline:2px solid rgba(79,131,255,.65);
  outline-offset:3px;
  border-radius:10px;
}

.th-btn:hover{
  color:rgba(238,242,255,1);
}

.th-btn__inner{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.table th .th-btn:hover .th-label{
  text-decoration:underline;
  text-underline-offset:3px;
  text-decoration-color:rgba(238,242,255,.35);
}

.sort-ind{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:rgba(154,167,199,.95);
}

.sort-prio{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  border:1px solid var(--line2);
  background:rgba(255,255,255,.05);
  font-size:11px;
  color:rgba(238,242,255,.9);
}

.table th .th-label{
  font-family:"Inter", sans-serif;
  font-size:15px;
  font-weight:1200;
  letter-spacing:.04em;
  color:#4f83ff;
}

/* ===== Generic badges ===== */

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--line2);
  background:rgba(255,255,255,.04);
  font-size:12px;
  color:rgba(238,242,255,.92);
  margin-right:6px;
  margin-bottom:6px;
  white-space:nowrap;
}

.badge__k{color:var(--muted)}
.badge__v{font-weight:650}
.badge__rank{color:rgba(238,242,255,.92)}

.badge__pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:26px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  border:1px solid var(--line2);
  background:rgba(255,255,255,.05);
  font-size:11px;
  color:rgba(238,242,255,.9);
}

.mono{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.dim{color:var(--muted)}
.footer{color:var(--muted);font-size:12px;margin-top:14px}

.error{
  margin:0 0 14px 0;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,77,77,.35);
  background:rgba(255,77,77,.10);
  color:rgba(255,235,235,.95);
}

.hidden{display:none}

.top-indexes-list{
  list-style:none;
  padding-left:0;
  margin:0;
}

.top-index-item{
  margin:6px 0;
  line-height:1.35;
  font-weight:600;
}

/* ===== Event badges ===== */

.event-badges{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px;
}

.event-badge{
  display:inline-flex;
  flex-direction:column;
  align-items:stretch;
  gap:4px;
  min-width:0;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:rgba(255,255,255,0.92);
  font-size:11px;
  line-height:14px;
  user-select:none;
}

.event-badge__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  min-width:0;
}

.event-badge__topic{
  display:inline-flex;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:650;
  letter-spacing:0.1px;
}

.event-badge__meta{
  color:rgba(255,255,255,0.72);
  font-size:10px;
  line-height:12px;
}

.event-arrow{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  height:16px;
  border-radius:999px;
  font-size:10px;
  line-height:10px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
}

.event-arrow--up{color:rgba(160,255,180,0.95)}
.event-arrow--flat{color:rgba(255,255,255,0.70)}
.event-arrow--down{color:rgba(255,180,180,0.95)}

.event-intensity__track{
  position:relative;
  display:block;
  height:6px;
  border-radius:999px;
  background:rgba(255,255,255,0.12);
  overflow:hidden;
}

.event-intensity__fill{
  display:block;
  width:0%;
  height:100%;
  border-radius:999px;
}

.event-intensity__fill--l1{background:rgba(0,255,120,0.85)}
.event-intensity__fill--l2{background:rgba(210,255,0,0.90)}
.event-intensity__fill--l3{background:rgba(255,210,0,0.92)}
.event-intensity__fill--l4{background:rgba(255,140,0,0.92)}
.event-intensity__fill--l5{background:rgba(255,60,60,0.92)}

.event-__all__{
  border-color:rgba(255,200,0,0.22);
  background:rgba(255,200,0,0.10);
  color:rgba(255,235,180,0.98);
}

.event-injury{
  border-color:rgba(255,90,90,0.22);
  background:rgba(255,90,90,0.10);
}

.event-transfer{
  border-color:rgba(90,200,255,0.22);
  background:rgba(90,200,255,0.10);
}

.event-manager{
  border-color:rgba(170,120,255,0.22);
  background:rgba(170,120,255,0.10);
}

.event-discipline{
  border-color:rgba(255,140,0,0.22);
  background:rgba(255,140,0,0.10);
}

.data-confidence{
  margin-top:6px;
  font-size:12px;
  opacity:.75;
}

.nr{color:#4285F4}

/* core state vector */
.xn{color:#60a5fa}      /* xN = level / anchor */
.xt{color:#a78bfa}      /* xT = tension / divergence */

/* meta layer */
.state{color:#9ca3af}   /* derived state, not ranking metric */

/* diagnostics */
.nds{color:#f87171}     /* anomaly / deviation */
.nps{color:#818cf8}     /* persistence / memory */
.fresh{color:#fbbf24}   /* recency / freshness */
.cqs{color:#34d399}     /* quality / coherence */

/* ===== Entity list / cards ===== */

.entities-list{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:0;
  margin:0;
}

.entity-card{
  border:1px solid var(--line2);
  background:rgba(17,24,50,.55);
  border-radius:14px;
  overflow:visible;
}

.entity-metrics-grid,
#entitiesList .entity-metrics-grid,
#entitiesTable .entity-metrics-grid,
.entity-details{
  display:grid;
  grid-template-columns:
    56px
    minmax(220px, 1.45fr)
    minmax(86px, 0.72fr)
    minmax(92px, 0.76fr)
    minmax(150px, 1.00fr)
    minmax(86px, 0.72fr)
    minmax(86px, 0.72fr)
    minmax(86px, 0.72fr)
    minmax(86px, 0.72fr);
}

.entity-metrics-grid .cell{
  padding:12px 12px;
  border-bottom:1px solid var(--line2);
}

.entity-metrics-grid .cell:nth-child(n+3):nth-child(-n+9),
.entity-metrics-grid--head .cell:nth-child(n+3):nth-child(-n+9){
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-width:0;
}

.entity-card:hover .entity-metrics-grid .cell{
  background:rgba(255,255,255,.03);
}

.grid-head-cell{
  padding:0 !important;
}

.entity-metrics-grid--head{
  align-items:center;
}

.entity-metrics-grid--head .cell{
  padding:12px 14px;
}

.entity-metrics-grid--head .th-btn{
  width:100%;
  justify-content:flex-start;
}

.entity-metrics-grid--head .cell:nth-child(3) .th-btn,
.entity-metrics-grid--head .cell:nth-child(4) .th-btn,
.entity-metrics-grid--head .cell:nth-child(6) .th-btn,
.entity-metrics-grid--head .cell:nth-child(7) .th-btn,
.entity-metrics-grid--head .cell:nth-child(8) .th-btn,
.entity-metrics-grid--head .cell:nth-child(9) .th-btn{
  display:inline-flex !important;
  width:auto !important;
  max-width:100%;
  justify-content:center;
  text-align:center !important;
}

.entity-metrics-grid--head .cell:nth-child(3) .th-btn__inner,
.entity-metrics-grid--head .cell:nth-child(4) .th-btn__inner,
.entity-metrics-grid--head .cell:nth-child(6) .th-btn__inner,
.entity-metrics-grid--head .cell:nth-child(7) .th-btn__inner,
.entity-metrics-grid--head .cell:nth-child(8) .th-btn__inner,
.entity-metrics-grid--head .cell:nth-child(9) .th-btn__inner{
  justify-content:center;
}

.entity-insight{
  text-align:center;
  padding:12px 12px 14px 12px;
  background:rgba(255,255,255,.02);
  border-top:1px solid var(--line2);
  height:auto;
  overflow:visible;
  white-space:normal;
  word-break:break-word;
}

.entity-insight .insight-driver{
  display:flex;
  justify-content:center;
  margin:0 0 10px 0;
}

.entity-insight .insight-text > div{
  display:block;
  width:100%;
}

/* ===== Driver / state chips ===== */

.state-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid var(--line2);
  background:rgba(255,255,255,.05);
  color:rgba(238,242,255,.92);
  font-size:12px;
  font-weight:650;
  line-height:1;
  white-space:nowrap;
}

.state-chip--contested{
  color:#fcd34d;
  background:rgba(234,179,8,.12);
  border-color:rgba(234,179,8,.28);
}

.state-chip--stable{
  color:#cbd5e1;
  background:rgba(148,163,184,.10);
  border-color:rgba(148,163,184,.24);
}

.state-chip--skew{
  color:#f0abfc;
  background:rgba(168,85,247,.14);
  border-color:rgba(168,85,247,.30);
}

.state-chip--clean{
  color:#86efac;
  background:rgba(34,197,94,.12);
  border-color:rgba(34,197,94,.28);
}

.state-chip--rising{
  color:#67e8f9;
  background:rgba(34,211,238,.12);
  border-color:rgba(34,211,238,.28);
}

.state-chip--forming{
  color:#c4b5fd;
  background:rgba(139,92,246,.12);
  border-color:rgba(139,92,246,.28);
}

.state-chip--accelerating{
  color:#86efac;
  background:rgba(34,197,94,.12);
  border-color:rgba(34,197,94,.28);
}

.state-chip--persistent{
  color:#fcd34d;
  background:rgba(234,179,8,.12);
  border-color:rgba(234,179,8,.28);
}

.state-chip--fading{
  color:#fb7185;
  background:rgba(244,63,94,.12);
  border-color:rgba(244,63,94,.28);
}

.state-chip--peak{
  color:#fdba74;
  background:rgba(249,115,22,.14);
  border-color:rgba(249,115,22,.30);
}

.state-chip--decaying{
  color:#fb7185;
  background:rgba(244,63,94,.12);
  border-color:rgba(244,63,94,.28);
}

.state-chip--residual{
  color:#c4b5fd;
  background:rgba(139,92,246,.12);
  border-color:rgba(139,92,246,.28);
}

.state-chip--neutral{
  color:#cbd5e1;
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.10);
}

.driver-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid var(--line2);
  background:rgba(255,255,255,.05);
  color:rgba(238,242,255,.92);
  font-size:12px;
  font-weight:650;
  line-height:1;
  white-space:nowrap;
}

.driver-chip--stable-quality,
.driver-chip--stable-presence,
.driver-chip--structural-leader,
.driver-chip--structured-coherence,
.driver-chip--persistent-core{
  color:#99f6e4;
  background:rgba(20,184,166,.14);
  border-color:rgba(20,184,166,.30);
}

.driver-chip--recent-support,
.driver-chip--fresh-distributed,
.driver-chip--clean-signal{
  color:#86efac;
  background:rgba(34,197,94,.12);
  border-color:rgba(34,197,94,.28);
}

.driver-chip--amplification-skew,
.driver-chip--clean-but-skewed,
.driver-chip--fresh-but-skewed,
.driver-chip--skewed-deviation,
.driver-chip--skewed-persistence{
  color:#fcd34d;
  background:rgba(234,179,8,.14);
  border-color:rgba(234,179,8,.30);
}

.driver-chip--active-deviation,
.driver-chip--live-surge,
.driver-chip--early-pulse,
.driver-chip--expanding-persistence{
  color:#67e8f9;
  background:rgba(34,211,238,.12);
  border-color:rgba(34,211,238,.28);
}

.driver-chip--flash-spike,
.driver-chip--broad-deviation,
.driver-chip--window-deviation{
  color:#93c5fd;
  background:rgba(59,130,246,.14);
  border-color:rgba(59,130,246,.30);
}

.driver-chip--cooling-deviation,
.driver-chip--cooling-off,
.driver-chip--fading-impact,
.driver-chip--fading-persistence{
  color:#c4b5fd;
  background:rgba(139,92,246,.14);
  border-color:rgba(139,92,246,.30);
}

.driver-chip--contested-lead,
.driver-chip--possible-artifact,
.driver-chip--noisy-signal,
.driver-chip--fragile-deviation,
.driver-chip--fragmented-signal,
.driver-chip--thin-leader,
.driver-chip--thin-persistence{
  color:#fda4af;
  background:rgba(244,63,94,.14);
  border-color:rgba(244,63,94,.30);
}

.driver-chip--neutral{
  color:#cbd5e1;
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.10);
}

/* ===== Integrity details ===== */

.controls,
.hero,
.hero-right,
.panel{
  overflow:visible !important;
}

.ti-details,
.info-details{
  position:relative;
  display:inline-block;
  margin-left:8px;
}

.ti-details.hidden{
  display:none;
}

.ti-details > summary,
.info-details > summary{
  list-style:none;
  cursor:pointer;
  user-select:none;
}

.ti-details > summary::-webkit-details-marker,
.info-details > summary::-webkit-details-marker{
  display:none;
}

.ti-details > summary::marker,
.info-details > summary::marker{
  content:"";
}

.ti-pill{
  display:flex;
  align-items:center;
  justify-content:center;
  height:36px;
  padding:0 12px;
  font-size:13px;
  line-height:1;
  cursor:pointer;
  white-space:nowrap;
  user-select:none;
}

.info-pill{
  display:flex;
  align-items:center;
  justify-content:center;
  height:36px;
  min-width:56px;
  padding:0 12px;
  font-size:13px;
  line-height:1;
  cursor:pointer;
  white-space:nowrap;
  user-select:none;
  color:#dbeafe;
  border-color:rgba(79,131,255,.34);
  background:rgba(79,131,255,.10);
}

.ti-pill strong{
  font-weight:700;
  margin-left:4px;
}

.badge--pass{
  border-color:rgba(53,208,127,.35);
  background:rgba(53,208,127,.10);
}

.badge--warn{
  border-color:rgba(255,176,32,.45);
  background:rgba(255,176,32,.10);
}

.badge--critical{
  border-color:rgba(255,77,77,.55);
  background:rgba(255,77,77,.12);
}

.ti-body{
  position:absolute;
  top:calc(100% + 2px);
  right:-128px;
  z-index:999;
  width:320px;
  max-height:70vh;
  overflow:auto;
  margin-top:0;
  padding:12px;
  background:rgba(15,23,42,0.96);
  backdrop-filter:blur(6px);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:16px;
  box-shadow:0 12px 30px rgba(0,0,0,0.45);
}

.info-line{
  font-size:12px;
  line-height:1.42;
  color:rgba(180,190,220,0.76);
  white-space:normal;
}

.info-line + .info-line{
  margin-top:6px;
}

.info-line strong{
  font-weight:700;
}

.info-details[open] > .info-body{
  position:fixed;
  left:50%;
  top:88px;
  transform:translateX(-50%);
  z-index:9999;

  width:min(760px, calc(100vw - 32px));
  min-width:0;
  max-width:min(760px, calc(100vw - 32px));
  max-height:calc(100vh - 112px);
  overflow:auto;

  padding:14px 16px;

  background:rgba(15,23,42,0.96);
  backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:16px;

  box-shadow:0 16px 36px rgba(0,0,0,0.45);
}

@media (max-width: 1180px){
  .info-details[open] > .info-body{
    top:78px;
    width:calc(100vw - 24px);
    max-width:calc(100vw - 24px);
    max-height:calc(100vh - 96px);
  }
}

.ti-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:6px 0;
  border-bottom:1px solid var(--line2);
}

.ti-row:last-child{
  border-bottom:none;
}

.ti-k{
  color:rgba(154,167,199,.95);
  font-size:12px;
}

.ti-v{
  color:rgba(238,242,255,.95);
  font-size:12px;
  text-align:right;
}

.ti-section{
  margin-top:12px;
  margin-bottom:6px;
  color:rgba(238,242,255,.95);
  font-size:12px;
  font-weight:600;
}

.ti-ex{
  padding:8px 0;
  border-top:1px solid var(--line2);
}

.ti-ex-title{
  font-size:12px;
  color:rgba(238,242,255,.95);
}

.ti-ex-sub{
  font-size:11px;
  color:rgba(154,167,199,.95);
  margin-top:2px;
}

.ti-ex-url{
  font-size:11px;
  color:rgba(154,167,199,.85);
  margin-top:2px;
  word-break:break-all;
}

/* ===== Hovercards ===== */

.nm-tip{
  position:fixed;
  z-index:2000;
  width:max-content;
  max-width:420px;
  pointer-events:auto;
  background:rgba(15,23,42,0.96);
  backdrop-filter:blur(8px) saturate(1.1);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:14px;
  box-shadow:0 18px 44px rgba(0,0,0,0.55);
  transform:translateY(2px);
  opacity:1;
  transition:opacity 120ms ease, transform 120ms ease;
}

.nm-tip--hidden{
  opacity:0;
  transform:translateY(6px);
  pointer-events:none;
}

.nm-tip__inner{
  padding:12px 12px 10px 12px;
  color:rgba(238,242,255,0.96);
}

.nm-tip__title{
  font-size:13px;
  font-weight:800;
  letter-spacing:.02em;
  margin:0 0 6px 0;
  color:rgba(238,242,255,0.98);
}

.nm-tip__desc{
  font-size:12.5px;
  line-height:1.45;
  color:rgba(226,232,240,0.92);
  margin:0 0 8px 0;
}

.nm-tip__list{
  margin:0;
  padding:0;
  list-style:none;
  display:grid;
  gap:6px;
}

.nm-tip__list li{
  font-size:12px;
  line-height:1.45;
  color:rgba(203,213,225,0.92);
}

.nm-tip__list strong{
  color:rgba(238,242,255,0.95);
  font-weight:750;
}

.nm-tip__arrow{
  position:absolute;
  width:10px;
  height:10px;
  left:50%;
  transform:translateX(-50%) rotate(45deg);
  background:rgba(15,23,42,0.96);
  border-left:1px solid rgba(255,255,255,0.10);
  border-top:1px solid rgba(255,255,255,0.10);
}

#nmHovercard[data-placement="bottom"] .nm-tip__arrow{
  top:-6px;
}

#nmHovercard[data-placement="top"] .nm-tip__arrow{
  bottom:-6px;
  transform:translateX(-50%) rotate(225deg);
}

.nm-tip-target{
  position:relative;
}

@media (prefers-reduced-motion: reduce){
  .nm-tip{transition:none;}
}

/* ===== Entity details ===== */

.entity-details{
  padding:12px 12px 14px 0;
  background:rgba(255,255,255,.02);
  border-top:1px solid var(--line2);
  align-items:start;
}

.entity-details__badges{
  grid-column:1 / 3;
  min-width:0;
  padding-left:8px;
}

.entity-details__badges .event-badges{
  margin-top:0;
}

.entity-details__insight{
  grid-column:3 / -1;
  padding:0 30px;
  color:var(--text);
  font-size:14px;
  line-height:1.5;
}

.entity-details__insight > *{
  margin-left:0;
  margin-right:0;
}

.entity-details__insight .insight-text{
  max-width:640px;
  margin:0;
  text-align:left;
  display:block;
  color:inherit;
  line-height:1.45;
}

.entity-details__insight .insight-text > div{
  display:block;
  width:100%;
}

.entity-league-row{
  margin-top:6px;
}

.league-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:20px;
  padding:0 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(79,131,255,.10);
  color:rgba(210,225,255,.96);
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
  white-space:nowrap;
}

.oa-brand-stack a:first-child{
  padding-bottom:6px;
  margin-bottom:6px;
  border-bottom:2px solid rgba(255,255,255,0.35);
}

.nm-mobile-hero{
  display:none;
}

.nm-desktop-hero{
  display:block;
}

@media (min-width: 901px){

  .nm-sticky-shell{
    position:sticky;
    top:0;
    z-index:140;
    background:rgba(11,16,32,.72);
    backdrop-filter:blur(14px) saturate(1.08);
    -webkit-backdrop-filter:blur(14px) saturate(1.08);
    border-bottom:1px solid rgba(59, 130, 246, 0.22);
  }
}

@media (max-width: 900px){

  .nm-desktop-hero{
    display:none !important;
  }

  body{
    overflow:auto;
  }

  /* ===== NM Mobile Hero ===== */

  .nm-mobile-hero{
    display:block;
    padding:0;
    margin-top:8px;
    margin-bottom:2px;
  }

  .nm-mobile-hero__wrap{
    display:flex;
    flex-direction:column;
    gap:0;
    padding-top:0;
    padding-bottom:0;
    text-align:center;
    font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  }

  .nm-mobile-hero__title{
    margin:4px 0 0;
    font-size:17px;
    line-height:1.1;
    font-weight:700;
    letter-spacing:-0.015em;
    color:#ffffff;
    white-space:nowrap;
  }

  .nm-mobile-hero__accent{
    color:#3b82f6;
    white-space:nowrap;
  }

  .nm-mobile-hero__subtitle{
    margin:10px auto 0;
    font-size:12px;
    line-height:1.3;
    font-weight:400;
    letter-spacing:0;
    color:rgba(255,255,255,0.92);
    max-width:780px;
  }

  main.wrap{
    min-height:auto;
    padding-top:10px;
  }

  .mobile-sort-shell{
    display:block;
    margin:0 0 6px 0;
  }

  .mobile-sort-panel{
    padding:10px 14px 12px;
    border:1px solid var(--line);
    border-radius:14px;
    background:rgba(11,16,32,.36);
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
  }

  .mobile-sort-dir{
    height:41px;
    padding:0 16px;
    border-radius:10px;
    border:1px solid #334155;
    background:#0f172a;
    color:#e5e7eb;
    font-weight:700;
    white-space:nowrap;
  }

  .card{
    background:transparent;
    border:none;
    box-shadow:none;
    overflow:visible;
  }

  .table-wrap{
    overflow:visible;
    padding:0;
  }

  .entities-list{
    gap:14px;
    padding:0 0 12px 0;
    scroll-snap-type:y proximity;
  }

  .entity-card{
    max-height:80svh;
    overflow:auto;
    border-radius:18px;
    background:rgba(11,16,32,.34);
    border:1px solid var(--line);
    box-shadow:0 14px 40px rgba(0,0,0,.22);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    scroll-snap-align:start;
  }

  .entity-card::-webkit-scrollbar{
    width:8px;
  }

  .entity-card::-webkit-scrollbar-track{
    background:rgba(255,255,255,.04);
    border-radius:10px;
  }

  .entity-card::-webkit-scrollbar-thumb{
    background:rgba(79,131,255,.55);
    border-radius:10px;
  }

  .entity-metrics-grid,
  #entitiesList .entity-metrics-grid,
  #entitiesTable .entity-metrics-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .entity-metrics-grid .cell{
    min-width:0;
    padding:12px;
  }

  .entity-metrics-grid .cell:nth-child(n+3):nth-child(-n+9){
    display:block;
    text-align:left;
  }

  .entity-metrics-grid .cell.cell--rank{
    grid-column:1 / 2;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
    background:rgba(255,255,255,.025);
  }

  .entity-metrics-grid .cell.cell--entity{
    grid-column:2 / -1;
  }

  .metric-stack{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
  }

  .metric-label{
    display:block;
    font-size:11px;
    line-height:1;
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:var(--muted);
  }

  .metric-label--meta{
    margin-bottom:4px;
  }

  .rank-value{
    font-size:24px;
    font-weight:800;
  }

  .cell--entity .entity-name{
    font-size:16px;
    line-height:1.3;
  }

  .entity-details{
    grid-template-columns:1fr;
    gap:12px;
    padding:12px;
  }

  .entity-details__badges,
  .entity-details__insight{
    grid-column:auto;
    padding:0;
  }

  .mobile-section-label{
    display:block;
    margin:0 0 8px 0;
    color:var(--muted);
    text-transform:uppercase;
    letter-spacing:.08em;
    font-size:11px;
    font-weight:700;
  }

  .entity-details__badges .event-badges{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
  }

  .entity-details__insight .insight-text{
    max-width:none;
  }

  .entity-details__insight .insight-text > div{
    width:100%;
  }
}

@media (min-width: 901px){
  .mobile-sort-shell{
    display:none !important;
  }
}

/* Partial rows: xT not computed */
.row--partial {
  opacity: 0.88;
}

/* optional subtle indicator */
.row--partial td:first-child {
  border-left: 2px solid rgba(148, 163, 184, 0.35);
}
