/* Page-only layout + styles extracted from template to keep HTML shorter */

/* Small, self-contained ticker (no global design changes) */
.tickerShell {
  overflow: hidden;
  border-radius: 14px;
  padding: 10px 12px;
}
.tickerLine {
  display: inline-block;
  white-space: nowrap;
  animation: mmTicker 150s linear infinite;
}
.tickerShell:hover .tickerLine {
  animation-play-state: paused;
}
@keyframes mmTicker {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

/* Page-only layout (stacked bands) */
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Stronger visual grouping (page-local) */
.band {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.02);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 10px 30px rgba(0,0,0,0.20);
  padding: 12px;
}
.bandHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.bandTitle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bandSub {
  font-size: 12px;
  opacity: 0.85;
}
.bandBody {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.06);
  padding: 12px;
}

/* Section header pills */
.sectionPill {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.86);
}

/* KPI row */
.kpiRow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.kpiRow6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1200px) {
  .kpiRow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpiRow6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.08);
  padding: 12px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kpiLabel {
  font-size: 12px;
  opacity: 0.85;
}
.kpiValue {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* compact charts row in Overview */
.miniCharts {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 12px;
  margin-top: 10px;
}
@media (max-width: 1200px) {
  .miniCharts { grid-template-columns: 1fr; }
}
.miniCard {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.08);
  padding: 10px;
  min-height: 130px;
}
.miniCardTitle {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.miniHint { font-size: 11px; opacity: 0.7; }
.miniCanvasWrap {
  height: 105px;
  position: relative;
}
.miniCanvasWrap canvas {
  width: 100% !important;
  height: 105px !important;
  display: block;
}

/* Model selector (page-local) */
.modelSelect {
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.12);
  color: rgba(255,255,255,0.92);
  min-width: 260px;
  color-scheme: dark;
}
.modelSelect option {
  background: #0b0f14;
  color: rgba(255,255,255,0.92);
}
.modelSelect option:disabled {
  color: rgba(255,255,255,0.35);
}

/* Assistant full-width band */
.llmBox {
  height: 350px;
  border-radius: 18px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.10);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.llmChat {
  flex: 1 1 auto;
  overflow: auto;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.10);
}
.llmRow {
  display: flex;
  gap: 10px;
}
.llmRow input { flex: 1 1 auto; }

/* Existing small utility styles */
.cardLike {
  border-radius: 18px;
  padding: 12px;
}
.rowLine {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.kv {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.input {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.15);
  color: rgba(255,255,255,0.92);
  width: 100%;
  box-sizing: border-box;
  color-scheme: dark;
}
select.input option {
  background: #0b0f14;
  color: rgba(255,255,255,0.92);
}
.inputRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.toggleBtn { cursor: pointer; user-select: none; }
.togglePill { min-width: 54px; text-align: center; }
.smallMuted { font-size: 12px; }
.tableWrap { width: 100%; overflow-x: auto; }

table.perfTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.perfTable td, table.perfTable th {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  vertical-align: top;
}
table.perfTable th { font-weight: 700; }

/* per-section accordion blocks */
.aaSection {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.06);
  margin-bottom: 10px;
  overflow: hidden;
}
.aaHead,
.accHead {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 10px;
}
.aaBody,
.accBody {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Smooth accordion animation for chart scaffold bodies */
.accBody {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition:
    max-height 220ms ease,
    opacity 180ms ease,
    transform 180ms ease;
  will-change: max-height, opacity, transform;
}
.accBody.is-open {
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
}

/* What-if */
.whatifModalShell {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.10);
  padding: 12px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    max-height 260ms ease,
    opacity 220ms ease,
    transform 220ms ease;
  will-change: max-height, opacity, transform;
}
.whatifModalShell.is-open {
  max-height: 600px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.whatifModalHead {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.whatifModalTitle {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}
.whatifModalActions {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}
.whatifStatusLine {
  font-size: 12px;
  opacity: 0.85;
}
.whatifRow {
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 1000px) {
  .whatifRow { grid-template-columns: 1fr auto; align-items: end; }
}
.whatifBtnRow {
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap: wrap;
}

/* Overview scaffold charts grid */
.overviewGrid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 1200px) {
  .overviewGrid2 { grid-template-columns: 1fr; }
}
.chartShell {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.08);
  overflow: hidden;
}
.chartHint {
  margin-bottom: 8px;
}
.chartWrapTall {
  height: 220px;
  position: relative;
}
.chartWrapTall canvas {
  width: 100% !important;
  height: 220px !important;
  display: block;
}

/* Scenario layout */
.scenarioGrid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 1100px) {
  .scenarioGrid { grid-template-columns: 1fr; }
}
.scenarioCard {
  border-radius: 14px;
}

/* Top nav */
.perfNav {
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.perfNavItem {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.10);
  color: rgba(255,255,255,0.86);
  text-decoration: none;
  font-size: 12px;
}
.perfNavItem:hover {
  background: rgba(255,255,255,0.06);
}

/* What-if heatmap + neon outline */
.whatifPillNeon {
  border-color: rgba(0, 255, 140, 0.90) !important;
  box-shadow:
    0 0 0 2px rgba(0, 255, 140, 0.65),
    0 0 18px rgba(0, 255, 140, 0.25);
}

.whatifHeatmapWrap {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.08);
  padding: 10px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.whatifLegend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 8px;
}
.whatifLegendItem {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.whatifSwatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.16);
  display: inline-block;
}
.whatifSwatchWrong { background: rgba(255, 120, 120, 0.45); }
.whatifSwatchOk { background: rgba(255, 255, 255, 0.10); }
.whatifSwatchSel { background: rgba(0, 255, 140, 0.55); }

.whatifHeatmap {
  display: grid;
  grid-template-columns: repeat(21, minmax(0, 1fr));
  gap: 4px;
}
@media (max-width: 1200px) {
  .whatifHeatmap { grid-template-columns: repeat(14, minmax(0, 1fr)); }
}

.whatifCell {
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.10);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.whatifCell.is-wrong { background: rgba(255, 120, 120, 0.45); }
.whatifCell.is-ok { background: rgba(255, 255, 255, 0.10); }

.whatifCell.is-selected {
  border-color: rgba(0, 255, 140, 0.95);
  box-shadow: 0 0 0 2px rgba(0, 255, 140, 0.55);
  transform: translateY(-1px);
}
.whatifCell.is-active {
  border-color: rgba(0, 255, 140, 0.75);
  box-shadow: 0 0 0 2px rgba(0, 255, 140, 0.35);
}

.whatifSwatchFlip {
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10) inset;
  background: rgba(120, 200, 255, 0.75);
}
.whatifSwatchImpact {
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10) inset;
  background: rgba(140, 255, 180, 0.55);
}
.whatifCell.is-flip {
  box-shadow: 0 0 0 2px rgba(120, 200, 255, 0.90) inset, 0 0 0 1px rgba(0,0,0,0.25);
}
.whatifCell.is-changed {
  box-shadow: 0 0 0 2px rgba(140, 255, 180, 0.70) inset;
}

/* Scenario Lab neon outline */
.togglePill.toggleBtn[data-whatif][data-value="1"] {
  border-color: rgba(0, 255, 140, 0.90) !important;
  box-shadow:
    0 0 0 2px rgba(0, 255, 140, 0.65),
    0 0 18px rgba(0, 255, 140, 0.25);
}

.rowLine:has([data-whatif]) .kv > .pill:first-child {
  border-color: rgba(0, 255, 140, 0.65) !important;
  box-shadow:
    0 0 0 1px rgba(0, 255, 140, 0.35),
    0 0 12px rgba(0, 255, 140, 0.15);
}

/* Flip Analysis - Phase 7 sorting + filtering */
.flipCandidatesShell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flipCandidatesCard {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8,12,18,0.46);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 8px 24px rgba(0,0,0,0.16);
  padding: 14px;
}

.flipCandidatesHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.flipCandidatesTitle {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.flipFilterBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.flipFilterBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.10);
  color: rgba(255,255,255,0.86);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.flipFilterBtn:hover {
  background: rgba(255,255,255,0.05);
}
.flipFilterBtn.is-active {
  border-color: rgba(120, 200, 255, 0.88);
  background: rgba(120, 200, 255, 0.12);
  color: rgba(255,255,255,0.96);
  box-shadow: 0 0 0 1px rgba(120, 200, 255, 0.25) inset;
}

.flipCandidatesTableWrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

table.flipCandidatesTable {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 14px;
}
table.flipCandidatesTable th,
table.flipCandidatesTable td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-align: left;
  vertical-align: middle;
}
table.flipCandidatesTable th {
  color: rgba(255,255,255,0.76);
  font-size: 12px;
  font-weight: 700;
}

.flipSortBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.flipSortBtn:hover {
  color: rgba(255,255,255,0.95);
}
.flipSortBtn.is-active {
  color: rgba(255,255,255,0.96);
}
.flipSortArrow {
  display: inline-block;
  min-width: 12px;
  text-align: center;
  opacity: 0.82;
}

.flipCandidatesRow {
  transition: background 140ms ease, box-shadow 140ms ease;
}
.flipCandidatesRow:hover {
  background: rgba(255,255,255,0.03);
}
.flipCandidatesRowSelected {
  background: rgba(120, 200, 255, 0.06);
  box-shadow: inset 2px 0 0 rgba(120, 200, 255, 0.95);
}

.flipCandidatesEmptyRow td {
  text-align: center;
  padding: 16px 10px;
}

.flipRippleCell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.flipProbBar {
  width: 120px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.flipProbBar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(120,200,255,0.95), rgba(160,255,190,0.92));
}

.flipMiniBarRow {
  display: flex;
  gap: 4px;
}
.flipMiniBarRow span {
  width: 8px;
  height: 16px;
  border-radius: 2px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.08);
}
.flipMiniBarRow span.on {
  background: rgba(140,255,180,0.72);
  border-color: rgba(140,255,180,0.40);
}

.flipImpactValue {
  color: rgba(255,215,120,0.95);
  font-weight: 700;
}
.flipDeltaValue {
  color: rgba(255,155,120,0.95);
  font-weight: 700;
}

.flipPreviewPanel {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.018);
  padding: 14px;
}

.flipPreviewPanel {
  width: 100%;
}

.flipSelectionPanel {
  background:
    linear-gradient(180deg, rgba(120,200,255,0.045), rgba(255,255,255,0.015));
}

.flipPathPanel {
  margin-top: 14px;
  background:
    linear-gradient(180deg, rgba(140,255,180,0.03), rgba(255,255,255,0.015));
}

.flipSectionHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.flipSectionTitle {
  font-size: 17px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.1px;
  line-height: 1.2;
}

.flipSectionSub {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,0.72);
  max-width: 720px;
}

.flipHeroRow {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.flipHeroBadge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(120,200,255,0.30);
  background: rgba(120,200,255,0.08);
  color: rgba(255,255,255,0.94);
  font-size: 13px;
  font-weight: 700;
}

.flipHeroBadgeSoft {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.flipStatGrid {
  display: grid;
  gap: 10px;
}

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

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

.flipStatCard {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.12);
  padding: 11px 12px;
  min-height: 74px;
}

.flipStatLabel {
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255,255,255,0.64);
  margin-bottom: 8px;
}

.flipStatValue {
  font-size: 16px;
  line-height: 1.28;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.flipSelectionPanel .flipStatCard {
  min-height: 66px;
  padding: 10px 12px;
}

.flipSelectionPanel .flipStatValue {
  font-size: 15px;
  line-height: 1.24;
}

.flipMiniStats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.flipMiniStat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}

.flipMiniStatLabel {
  font-size: 12px;
  color: rgba(255,255,255,0.66);
}

.flipMiniStatValue {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.94);
}

.flipBodyCopy {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.76);
  max-width: 980px;
}

.flipCandidatesFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.flipCandidatesPrompt {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
  padding: 0 12px;
  color: rgba(255,255,255,0.82);
  max-width: 620px;
}

/* Flip Analysis - heuristic path preview */
.flipPathHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.flipPathRail {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 34px minmax(170px, 1fr) 34px minmax(160px, 0.95fr) 34px minmax(160px, 0.95fr);
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 16px;
}

.flipPathNode {
  min-height: 104px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.014);
  padding: 14px;
  opacity: 0.58;
  transition: opacity 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.flipPathNode.is-active {
  opacity: 1;
  border-color: rgba(140,255,180,0.20);
  background: rgba(140,255,180,0.03);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 0 0 1px rgba(140,255,180,0.05);
  transform: translateY(-1px);
}

.flipPathNodePrimary {
  border-color: rgba(120,200,255,0.20);
  background: rgba(120,200,255,0.04);
  opacity: 1;
}

.flipPathStage {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
  margin-bottom: 10px;
}

.flipPathTeam {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.96);
  line-height: 1.16;
  margin-bottom: 10px;
  word-break: break-word;
  overflow-wrap: anywhere;
  letter-spacing: 0.1px;
}

.flipPathMeta {
  font-size: 13px;
  color: rgba(255,255,255,0.70);
  line-height: 1.4;
}

.flipPathConnector {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
  opacity: 0.55;
}

.flipPathConnector::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(120,200,255,0.85), rgba(140,255,180,0.72));
  transition: width 160ms ease;
}

.flipPathConnector.is-active {
  opacity: 0.95;
}

.flipPathConnector.is-active::after {
  width: 100%;
}

.flipPathMiniStats {
  margin-top: 4px;
  margin-bottom: 6px;
}

@media (max-width: 1300px) {
  .flipStatGridFive {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .flipPathTeam {
    font-size: 17px;
  }
}

@media (max-width: 1100px) {
  .flipPreviewGrid {
    grid-template-columns: 1fr;
  }

  .flipPathRail {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .flipPathConnector {
    height: 12px;
  }

  .flipPathTeam {
    font-size: 17px;
  }

  .flipCandidatesPrompt {
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .flipCandidatesHead,
  .flipCandidatesFooter,
  .flipFilterBar,
  .flipSectionHead {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .flipStatGridFive,
  .flipStatGridFour {
    grid-template-columns: 1fr;
  }

  .flipPathTeam {
    font-size: 16px;
  }

  .flipStatValue {
    font-size: 15px;
  }

  .flipSelectionPanel .flipStatValue {
    font-size: 14px;
  }
}

/* --- Final Flip Panel Micro Polish --- */

/* Prevent ugly team name wrapping */
.flipStatValue {
  word-break: normal;
  overflow-wrap: normal;
}

/* Allow stat cards to shrink naturally */
.flipStatGridFive {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
}

/* Improve team name readability */
.flipSelectionPanel .flipStatValue {
  font-size: 16px;
  line-height: 1.25;
}

/* Slightly reduce label prominence */
.flipStatLabel {
  opacity: 0.6;
  font-size: 11px;
}

/* Improve spacing inside stat cards */
.flipStatCard {
  padding: 12px 14px;
}

/* Balance spacing under summary text */
.flipBodyCopy {
  margin-top: 10px;
  opacity: 0.82;
}

/* --- Section breathing room for Selected Candidate --- */

.flipSelectionPanel {
  margin-top: 22px;
  margin-bottom: 22px;
}

/* Slightly separate the table from the preview area */
.flipCandidatesTableWrap {
  margin-bottom: 18px;
}

/* Ensure stacked preview panels maintain consistent spacing */
.flipPreviewPanel + .flipPreviewPanel {
  margin-top: 16px;
}

/* ------------------------------------------------ */
/* Flip Analysis — final micro polish improvements  */
/* (CSS-only, zero behavior changes)                */
/* ------------------------------------------------ */

/* Ensure preview panels have consistent vertical spacing */
.flipPreviewGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 14px;
}

/* Slightly soften inactive path nodes for clearer hierarchy */
.flipPathNode {
  opacity: 0.52;
}

/* Improve visual emphasis on active path nodes */
.flipPathNode.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 0 0 1px rgba(140,255,180,0.08),
    0 4px 14px rgba(0,0,0,0.20);
}

/* Slightly thicken path connectors for readability */
.flipPathConnector {
  height: 6px;
}

/* Improve connector contrast when active */
.flipPathConnector.is-active::after {
  width: 100%;
  opacity: 0.95;
}

/* What-if flip summary highlight */
.whatifStatusLine {
  color: rgba(0, 255, 140, 0.95);
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* =========================================================
   Scenario Controls Layout Improvements
   ========================================================= */

.scenario-row-dual {
  display: flex;
  gap: 20px;
  margin-top: 6px;
  align-items: center;
}

.scenario-row-dual .scenario-control {
  flex: 1;
}

/* Stretch scenario controls column to fill height */

#sec-scenarios .scenarioGrid {
    align-items: stretch;
}

#sec-scenarios .scenarioGrid .scenarioCard {
    display: flex;
    flex-direction: column;
}

#sec-scenarios .scenarioGrid .scenarioCard .cardLike {
    flex: 1;
}
