/* Dispatch Brain — command console */

.brain-console {
  --brain-cyan: #58d6ff;
  --brain-violet: #a78bfa;
  --brain-glow: rgba(88, 166, 255, 0.35);
  position: relative;
  margin: 0 0 1.15rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid #2a3a4d;
  border-radius: 14px;
  background:
    radial-gradient(1200px 280px at 10% -10%, rgba(88, 166, 255, 0.1), transparent 55%),
    radial-gradient(900px 240px at 95% 0%, rgba(167, 139, 250, 0.08), transparent 50%),
    #121922;
  overflow: hidden;
}
.brain-console::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 3px,
    rgba(255, 255, 255, 0.012) 4px
  );
  opacity: 0.7;
}

.brain-mast {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}
.brain-mast-id {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.brain-mast h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brain-mast-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.brain-plain-lead {
  flex: 1 1 100%;
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #dce6f2;
  max-width: 52rem;
}
.brain-plain-sub {
  flex: 1 1 100%;
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--brain-cyan);
}
.brain-optional {
  margin: 0.85rem 0;
  border: 1px solid #243041;
  border-radius: 10px;
  padding: 0.35rem 0.65rem 0.65rem;
  background: rgba(0, 0, 0, 0.15);
}
.brain-optional > summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
  padding: 0.35rem 0;
}
.brain-learn-row-side {
  opacity: 0.85;
}
.brain-ticker {
  margin: 0;
  flex: 1;
  min-width: 12rem;
  font-size: 0.82rem;
  color: var(--brain-cyan);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.brain-console .learning-loop-score,
.brain-console .brain-ticker {
  display: none;
}
.brain-learn-sign {
  flex: 1 1 100%;
  display: grid;
  gap: 0.4rem;
  margin: 0.15rem 0 0;
}
.brain-learn-row {
  display: grid;
  grid-template-columns: 7.5rem 4.5rem 1fr;
  gap: 0.55rem;
  align-items: baseline;
  font-size: 0.9rem;
}
.brain-learn-k {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brain-learn-trend {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.brain-learn-row.better .brain-learn-trend { color: var(--ok, #3ecf8e); }
.brain-learn-row.worse .brain-learn-trend { color: #f07178; }
.brain-learn-row.same .brain-learn-trend { color: var(--muted); }
.brain-learn-v {
  color: var(--text, #e6edf3);
}

.brain-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(139, 148, 158, 0.4);
}
.brain-pulse[data-live="1"] {
  background: var(--ok);
  animation: brain-pulse 1.6s ease-out infinite;
}
@keyframes brain-pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

.brain-duel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.brain-era {
  border: 1px solid #2a3644;
  border-radius: 12px;
  padding: 0.85rem 1rem 1rem;
  background: rgba(8, 12, 18, 0.55);
  text-align: center;
}
.brain-era-then { box-shadow: inset 0 0 40px rgba(167, 139, 250, 0.08); }
.brain-era-now {
  box-shadow: inset 0 0 48px rgba(88, 214, 255, 0.1);
  border-color: #355066;
}
.brain-era-lift {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 24, 0.7);
}
.brain-era-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
@keyframes pct-flash-up {
  0% {
    background-color: transparent;
    box-shadow: none;
  }
  18% {
    background-color: rgba(74, 222, 128, 0.32);
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.45);
    color: #86efac;
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}
.brain-era-pct.pct-flash-up {
  animation: pct-flash-up 1.35s ease-out;
  border-radius: 6px;
}
.brain-era-pct {
  font-size: 3.1rem;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.03em;
}
.brain-era-then .brain-era-pct { color: var(--brain-violet); }
.brain-era-now .brain-era-pct { color: var(--brain-cyan); text-shadow: 0 0 24px rgba(88, 214, 255, 0.35); }
.brain-era-lab {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.brain-era-meta {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text);
  opacity: 0.8;
}
.brain-delta {
  font-size: 1.7rem;
  font-weight: 750;
  line-height: 1;
  margin-top: -0.2rem;
}
.brain-delta.up { color: var(--ok); }
.brain-delta.down { color: var(--bad); }
.brain-delta-lab {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.brain-era-lift .brain-delta { font-size: 2.4rem; margin-top: 0; }

.brain-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}
.brain-card {
  position: relative;
  border: 1px solid #2a3644;
  border-radius: 12px;
  padding: 0.75rem 0.85rem 0.85rem;
  background: rgba(8, 12, 18, 0.5);
}
.brain-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c6d0da;
}
.brain-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
}
.brain-card-lead, .brain-card-foot {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.brain-card-foot { margin: 0.55rem 0 0; }
.brain-wide { margin-bottom: 0.7rem; }

.brain-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.6rem;
}
.brain-stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.brain-stat-grid-2 { grid-template-columns: 1fr 1fr; }
.brain-stat-val {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}
.brain-stat-lab {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.25;
}

.brain-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.brain-mx-cell {
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  border: 1px solid #2a3644;
}
.mx-tp { background: rgba(63, 185, 80, 0.12); }
.mx-fn { background: rgba(248, 81, 73, 0.1); }
.mx-fp { background: rgba(210, 153, 34, 0.1); }
.mx-tn { background: rgba(88, 166, 255, 0.08); }

.brain-chew-bar {
  height: 8px;
  border-radius: 99px;
  background: #1b2430;
  overflow: hidden;
  margin-bottom: 0.65rem;
}
.brain-chew-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brain-violet), var(--brain-cyan));
  box-shadow: 0 0 12px var(--brain-glow);
  transition: width 0.6s ease;
}

.brain-who {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.brain-who > div {
  border-radius: 8px;
  padding: 0.4rem 0.35rem;
  border: 1px solid #2a3644;
  text-align: center;
}
.brain-who > div:nth-child(1) { background: rgba(248, 81, 73, 0.08); }
.brain-who > div:nth-child(2) { background: rgba(210, 153, 34, 0.1); }
.brain-who > div:nth-child(3) { background: rgba(167, 139, 250, 0.1); }

.brain-cut { margin-bottom: 0.65rem; }
.brain-cut .brain-stat-val {
  font-size: 1.8rem;
  color: var(--brain-cyan);
}

.brain-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

/* What it knows: placement grade, desk facts, desk moves. */
.brain-know { grid-template-columns: 1.15fr 1fr 0.85fr; }
.brain-know-place { border-color: rgba(167, 139, 250, 0.45); }
.brain-verdict { color: #e6edf3; font-weight: 600; }
.brain-verdict[data-level="check"] { color: #7ee787; }
.brain-verdict[data-level="early"] { color: #79c0ff; }
.brain-verdict[data-level="none"] { color: #8b949e; }
.brain-verdict[data-level="trusted"] { color: #7ee787; }
.brain-verdict[data-level="even"] { color: #79c0ff; }
.brain-verdict[data-level="off"] { color: #ffa198; }
.brain-know-list { display: flex; flex-direction: column; gap: 0.22rem; margin-top: 0.55rem; }
.brain-know-list .brain-know-h {
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.1rem;
}
.brain-know-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.72rem;
  line-height: 1.3;
}
.brain-know-row .brain-know-who { color: #e6edf3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brain-know-row .brain-know-num { color: var(--brain-cyan); white-space: nowrap; }
.brain-know-row.is-bad .brain-know-num { color: #ffa198; }
@media (max-width: 1100px) {
  .brain-know { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .brain-know { grid-template-columns: 1fr; }
}

.brain-attention { display: flex; flex-direction: column; gap: 0.42rem; }
.brain-att {
  display: grid;
  grid-template-columns: 8.4rem 1fr 2.4rem;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.74rem;
}
.brain-att-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brain-att-track {
  height: 7px;
  border-radius: 99px;
  background: #1b2430;
  overflow: hidden;
}
.brain-att-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.brain-att.late i { background: linear-gradient(90deg, #f0883e, #f85149); }
.brain-att.ontime i { background: linear-gradient(90deg, #3fb950, #58d6ff); }
.brain-att-w { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.brain-tape {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 220px;
  overflow: auto;
}
.brain-chip {
  min-width: 5.4rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #2a3644;
  background: #0d131b;
  font-size: 0.72rem;
}
.brain-chip strong { display: block; font-size: 0.95rem; }
.brain-chip.in { border-color: #2f6a3d; box-shadow: inset 0 0 12px rgba(63, 185, 80, 0.12); }
.brain-chip.hold { opacity: 0.75; }
.brain-chip .chip-day { color: var(--muted); }

.brain-pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}
.brain-pipeline .learning-loop-step,
.brain-console .learning-loop-step {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid #2a3644;
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.55);
  font-size: 0.78rem;
  line-height: 1.3;
}
.brain-console .learning-loop-job { color: var(--brain-cyan); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.brain-console .learning-loop-doing { color: var(--text); }
.brain-console .learning-loop-scope { color: var(--muted); }

@media (max-width: 1100px) {
  .brain-grid { grid-template-columns: 1fr 1fr; }
  .brain-pipeline { grid-template-columns: 1fr 1fr; }
}
.brain-health {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem 0.7rem;
  border: 1px solid #314155;
  border-radius: 14px;
  background: #121922;
}
.brain-health h3 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.brain-health .gauge-label,
.brain-health .gauge-detail,
.brain-health .gauge-val {
  color: #e2e8f0;
}
.brain-health .gauge-detail { color: #94a3b8; }

.strand-widget {
  position: relative;
  overflow: hidden;
  margin: 0 0 1.15rem;
  padding: 1rem 1.1rem 0.85rem;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px;
  background: #000;
}
.strand-widget > :not(.entity-field) {
  position: relative;
  z-index: 1;
}
.entity-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.entity-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.entity-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 40% 46%, #000 20%, transparent 72%);
  animation: entity-grid 8s linear infinite;
}
@keyframes entity-grid {
  to { background-position: 28px 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .entity-grid {
    animation: none;
  }
}
.strand-head {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.strand-full {
  border: 1px solid #4b6278;
  background: rgba(8, 12, 18, 0.55);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.strand-full:hover { border-color: #7dd3fc; color: #7dd3fc; }
.flight-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: #000;
}
.flight-overlay.open { display: block; }
.flight-overlay canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}
.flight-overlay.menu canvas { cursor: default; }
#brainStage:fullscreen,
#brainStage.is-fullscreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  box-sizing: border-box;
  overflow: auto;
  background: #0c1118;
  padding: 0.75rem 1rem 1rem;
}
#brainStage.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
}
#brainStage:fullscreen .brain-health,
#brainStage.is-fullscreen .brain-health {
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
}
#brainStage:fullscreen .strand-widget,
#brainStage.is-fullscreen .strand-widget {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}
#brainStage:fullscreen #brainStrandCanvas,
#brainStage.is-fullscreen #brainStrandCanvas {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 240px;
}

.strand-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.strand-head h2 {
  margin: 0.1rem 0 0;
  font-size: 1.35rem;
  color: #f0f9ff;
}
.strand-day {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted, #94a3b8);
  font-size: 0.85rem;
}
.strand-detail input[type="date"] {
  background: #0e1620;
  color: #e2e8f0;
  border: 1px solid #3d5168;
  border-radius: 4px;
  padding: 0.25rem 0.45rem;
  color-scheme: dark;
}
.strand-detail select {
  max-width: 100%;
  text-overflow: ellipsis;
}
.strand-day select,
.strand-detail select {
  appearance: none;
  -webkit-appearance: none;
  background: #0e1620
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%2393a4b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 0.45rem center;
  background-size: 0.65rem;
  color: #e2e8f0;
  border: 1px solid #3d5168;
  border-radius: 4px;
  padding: 0.25rem 1.45rem 0.25rem 0.45rem;
}
#brainStrandCanvas {
  width: 100%;
  height: clamp(420px, calc(100vh - 150px), 900px);
  display: block;
}
.strand-compare {
  display: flex;
  gap: 0.75rem;
  margin: 0.2rem 0 0.35rem;
}
.strand-compare div {
  flex: 1;
  padding: 0.55rem 0.7rem;
  border: 1px solid #243044;
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.45);
}
.strand-compare strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1.1;
  color: #e2e8f0;
}
.strand-compare span {
  color: #94a3b8;
  font-size: 0.78rem;
}
.strand-pop,
.strand-widget > .strand-pop {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1200;
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 100px);
  min-width: 320px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  border: 1px solid #3d5168;
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  resize: both;
  overflow: hidden;
}
.strand-pop[hidden] {
  display: none;
}
.strand-pop.is-full,
.strand-widget > .strand-pop.is-full {
  top: 8px !important;
  left: 8px !important;
  right: 8px !important;
  bottom: 8px !important;
  width: auto !important;
  height: auto !important;
  max-height: none;
  resize: none;
}
.strand-pop.is-full .group-lab-map {
  height: 62vh;
}
.strand-pop.is-full .strand-pop-head {
  cursor: default;
}
.strand-pop-tools {
  display: flex;
  gap: 0.15rem;
}
.strand-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem 0.45rem 0.8rem;
  border-bottom: 1px solid #3d5168;
  cursor: move;
  user-select: none;
  color: #7dd3fc;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.strand-pop-close {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}
.strand-pop-close:hover {
  color: #e2e8f0;
}
.strand-detail {
  flex: 1;
  padding: 0.7rem 0.8rem;
  color: #e2e8f0;
  font-size: 0.84rem;
  overflow: auto;
}
.strand-sched {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.strand-sched th {
  position: sticky;
  top: 0;
  text-align: left;
  font-weight: 600;
  color: #93a4b8;
  background: #121922;
  border-bottom: 1px solid #3d5168;
  padding: 0.28rem 0.4rem;
}
.strand-sched td {
  border-bottom: 1px solid rgba(61, 81, 104, 0.45);
  padding: 0.22rem 0.4rem;
  white-space: nowrap;
}
.strand-detail h3 {
  margin: 0.7rem 0 0.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.strand-detail h3:first-child { margin-top: 0; }
.strand-detail ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.strand-detail li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid rgba(61, 81, 104, 0.45);
}
.strand-detail li span:first-child {
  flex: 1;
}
.strand-detail li span:last-child {
  text-align: right;
  color: #94a3b8;
}
#brainStrandCanvas { cursor: pointer; }
.strand-widget > .beetlejuice-call {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  pointer-events: none;
  white-space: nowrap;
  font-family: Impact, "Arial Black", Haettenschweiler, sans-serif;
  font-size: 5rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b6ff00;
}
.strand-widget > .beetlejuice-call[hidden] {
  display: none;
}
.beetlejuice-call.is-on {
  animation: beetlejuice-pop 1.5s ease forwards;
}
@keyframes beetlejuice-pop {
  0% { opacity: 0; transform: scale(0.9); }
  8% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}
.strand-source {
  display: none;
}
.pin-pending button,
.pin-val-actions button,
.pin-map-card header button,
.pin-map-card > button {
  background: #0e1620;
  color: #e2e8f0;
  border: 1px solid #4b6278;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
.pin-val-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}
.pin-map-pop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 16, 0.72);
  padding: 1rem;
}
.pin-map-pop[hidden] { display: none; }
.pin-map-card {
  width: min(720px, 100%);
  background: #121a24;
  border: 1px solid #3d5168;
  border-radius: 12px;
  padding: 0.8rem;
  color: #e2e8f0;
}
.pin-map-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.pin-map-card header strong {
  font-size: 0.95rem;
}
#pinMap {
  height: 420px;
  border-radius: 10px;
  background: #0b121a;
}
.pin-map-card > p {
  margin: 0.55rem 0;
  color: #94a3b8;
  font-size: 0.8rem;
}
.leaflet-marker-icon.address-pin {
  background: transparent;
  border: 0;
}
.address-pin-dot {
  display: block;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  background: #38bdf8;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.35);
}
.mapping-lab label {
  margin-right: 0.5rem;
  font-size: 0.85rem;
}
.mapping-lab button {
  background: #0e1620;
  color: #e2e8f0;
  border: 1px solid #4b6278;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  cursor: pointer;
  margin-right: 0.35rem;
}
.group-lab-maps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin: 0.65rem 0 0.3rem;
}
.group-lab-maps.is-compare {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.group-lab-map {
  height: 380px;
  border-radius: 10px;
  background: #0b121a;
  border: 1px solid #263445;
}
.group-lab-map[hidden] {
  display: none;
}
.group-lab-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 0 0 0.5rem;
}
.group-lab-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.lab-key-line {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 2px;
}
.lab-key-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #fff;
}
.lab-key-dot.is-drop {
  border-radius: 3px;
}
.lab-key-dot.is-late {
  border-color: #fbbf24;
}
.lab-key-dot.is-broken {
  border-color: #ef4444;
}
.lab-key-dot.is-moved {
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.55);
}
.lab-card {
  background: rgba(10, 16, 26, 0.92);
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  font: 12px/1.35 system-ui, sans-serif;
  min-width: 190px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.lab-card-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 12.5px;
  margin-bottom: 0.3rem;
}
.lab-card-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.lab-card table {
  border-collapse: collapse;
  width: 100%;
}
.lab-card th {
  color: #94a3b8;
  font-weight: 500;
  text-align: left;
  padding: 1px 8px 1px 0;
}
.lab-card td {
  padding: 1px 0;
  white-space: nowrap;
}
.lab-card td:last-child {
  text-align: right;
  padding-left: 6px;
}
.lab-chip {
  display: inline-block;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}
.lab-chip.is-good {
  background: rgba(74, 222, 128, 0.18);
  color: #4ade80;
}
.lab-chip.is-bad {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}
.lab-card-save {
  margin-top: 0.4rem;
  padding: 0.3rem 0.45rem;
  border-radius: 7px;
  font-weight: 700;
  font-size: 13px;
  background: rgba(148, 163, 184, 0.12);
}
.lab-card-save.is-good {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}
.lab-card-save.is-bad {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}
.lab-card-save span {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: #94a3b8;
}
.leaflet-tooltip.lab-tip {
  background: rgba(10, 16, 26, 0.95);
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  font: 12px/1.4 system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.leaflet-tooltip.lab-tip::before {
  border-top-color: #334155;
}
.lab-tip-dim {
  color: #94a3b8;
}
.lab-tip-bad {
  color: #fca5a5;
  font-weight: 600;
}
.lab-tip-warn {
  color: #fbbf24;
  font-weight: 600;
}
.lab-tip-good {
  color: #4ade80;
}
.lab-tip-early {
  color: #7dd3fc;
}
.leaflet-marker-icon.group-lab-arrow {
  background: transparent;
  border: 0;
  pointer-events: none;
}
.group-lab-arrow span {
  display: block;
  width: 18px;
  height: 18px;
  font-size: 15px;
  line-height: 18px;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 3px var(--lab-arrow, #0f172a), 0 0 2px #0f172a, 0 0 1px #0f172a;
}
.mapping-lab-diff {
  color: #7dd3fc;
}
.mapping-lab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 6px 0 10px;
}
.mapping-lab-table th,
.mapping-lab-table td {
  padding: 2px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
  white-space: nowrap;
}
.strand-detail .mapping-lab li {
  justify-content: flex-start;
}
.strand-detail .mapping-lab li > span {
  text-align: left;
}
.strand-detail .mapping-lab li span.mapping-lab-good {
  color: #4ade80;
}
.strand-detail .mapping-lab li span.mapping-lab-bad {
  color: #fca5a5;
}
.mapping-lab-headline {
  font-size: 0.95rem;
  color: #e2e8f0;
}
.strand-detail .mapping-lab-savings {
  list-style: none;
  margin: 0.2rem 0 0.1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.15rem 1rem;
}
.strand-detail .mapping-lab-savings li {
  justify-content: flex-start;
  gap: 0.4rem;
}
.mapping-lab-savings li > span:first-child {
  color: #94a3b8;
  min-width: 6.5rem;
}
.strand-detail .mapping-lab-savings li span:last-child {
  text-align: left;
  color: #e2e8f0;
}
.strand-detail .mapping-lab-savings li span.mapping-lab-good {
  color: #4ade80;
}
.strand-detail .mapping-lab-savings li span.mapping-lab-bad {
  color: #fca5a5;
}
.mapping-lab-savings-note {
  font-size: 0.75rem;
  margin: 0 0 0.3rem;
}
.mapping-lab-good {
  color: #4ade80;
}
.mapping-lab-dim {
  color: #64748b;
  font-size: 11px;
}
.mapping-lab-side tr.mapping-lab-same td {
  color: #64748b;
}
.mapping-lab-side tr.mapping-lab-moved td {
  background: rgba(74, 222, 128, 0.07);
}
.mapping-lab .mapping-lab-bad,
.mapping-lab-side td.mapping-lab-bad {
  color: #fca5a5;
}
.mapping-lab-side th:nth-child(4),
.mapping-lab-side td:nth-child(4) {
  border-left: 1px solid rgba(148, 163, 184, 0.35);
}
.mapping-lab-views button.is-on {
  border-color: #4ade80;
  color: #4ade80;
}
.mapping-lab-more summary {
  cursor: pointer;
  color: #94a3b8;
  margin: 0.5rem 0;
}
.mapping-lab-table tr.mapping-lab-broken td {
  color: #fca5a5;
}
.leaflet-marker-icon.group-lab-pin {
  background: transparent;
  border: 0;
}
.group-lab-pin-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.35);
  transition: transform 0.12s ease;
}
.group-lab-pin-dot.is-drop {
  border-radius: 5px;
}
.group-lab-pin-dot.is-late {
  border-color: #fbbf24;
  border-width: 3px;
}
.group-lab-pin-dot.is-broken {
  border-color: #ef4444;
  border-width: 3px;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35);
}
.group-lab-pin-dot.is-moved {
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.5);
}
.group-lab-pin-dot.is-broken.is-moved {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35), 0 0 0 6px rgba(74, 222, 128, 0.45);
}
.group-lab-pin-dot.is-start {
  background: #f59e0b;
  border-radius: 50%;
}
.leaflet-marker-icon.group-lab-pin:hover .group-lab-pin-dot,
.leaflet-marker-icon.group-lab-pin.is-linked .group-lab-pin-dot {
  transform: scale(1.35);
}
.leaflet-marker-icon.group-lab-pin.is-linked {
  z-index: 2000 !important;
}
.group-lab-drove-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #f472b6;
  color: #1e0b16;
  border: 2px solid #fff;
  font: 700 10px/1 system-ui, sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s;
}
.leaflet-marker-icon.group-lab-pin:hover .group-lab-drove-badge,
.leaflet-marker-icon.group-lab-pin.is-linked .group-lab-drove-badge {
  transform: scale(1.35);
}
.lab-key-line.is-wide {
  height: 7px;
}
.lab-key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f472b6;
  color: #1e0b16;
  border: 1.5px solid #fff;
  font: 700 8px/1 system-ui, sans-serif;
  font-style: normal;
}
.lab-card-vs {
  color: #64748b;
  font-weight: 500;
}
.lab-card-two thead th {
  color: #64748b;
  font-size: 11px;
  text-align: right;
}
.lab-card-two thead th:first-child {
  text-align: left;
}
.lab-card .lab-card-two td {
  text-align: right;
  padding-left: 10px;
}
.lab-card-note {
  margin-top: 0.35rem;
  max-width: 240px;
  color: #94a3b8;
  font-size: 11px;
  white-space: normal;
}
.lab-tip-tap {
  color: #f9a8d4;
}
.mapping-lab-drove {
  color: #cbd5e1;
  margin-top: -0.2rem;
}
.mapping-lab-drove-key {
  display: inline-block;
  width: 16px;
  height: 6px;
  border-radius: 3px;
  background: #f472b6;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.mapping-lab-side th.mapping-lab-col-drove {
  color: #f9a8d4;
}
.mapping-lab-side td.mapping-lab-col-drove {
  background: rgba(244, 114, 182, 0.05);
}
.mapping-lab-side td.mapping-lab-col-drove.is-off {
  color: #f9a8d4;
}

@media (max-width: 820px) {
  .brain-duel, .brain-split { grid-template-columns: 1fr; }
  .brain-era-pct { font-size: 2.4rem; }
  .brain-stat-grid-3 { grid-template-columns: 1fr 1fr; }
  .brain-att { grid-template-columns: 7rem 1fr 2.2rem; }
}
