.phase-four {
  --breakout-cyan: #78e8ff;
  --breakout-cyan-rgb: 120, 232, 255;
  --breakout-violet: #b69cff;
  --breakout-violet-rgb: 182, 156, 255;
  --breakout-green: #6ce5b1;
  --breakout-red: #ff8b7b;
  --breakout-amber: #f7ca68;
  --breakout-slate: #7f91a6;
  background:
    radial-gradient(circle at 88% 4%, rgba(var(--breakout-violet-rgb), .15), transparent 31rem),
    radial-gradient(circle at 8% 24%, rgba(var(--breakout-cyan-rgb), .1), transparent 29rem),
    linear-gradient(180deg, #050b16 0%, #06141a 48%, #040c12 100%);
}

.phase-four .article-shell { width: min(1040px, 100%); }
.breakout-explorer-page .page-shell { width: min(1260px, calc(100% - 36px)); }
.breakout-explorer-page .article-shell { width: min(1160px, 100%); }
.phase-four + .page-footer,
.phase-four .page-footer { width: min(1040px, calc(100% - 36px)); margin: 80px auto 0; padding-bottom: 34px; }

.breakout-hero {
  isolation: isolate;
  border-color: rgba(var(--breakout-cyan-rgb), .3);
  background:
    radial-gradient(circle at 82% 20%, rgba(var(--breakout-violet-rgb), .15), transparent 22rem),
    linear-gradient(142deg, rgba(12, 29, 48, .98), rgba(6, 26, 30, .95));
}

.breakout-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .4;
  background-image:
    linear-gradient(rgba(var(--breakout-cyan-rgb), .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--breakout-cyan-rgb), .055) 1px, transparent 1px),
    linear-gradient(118deg, transparent 49.5%, rgba(var(--breakout-violet-rgb), .2) 50%, transparent 50.5%);
  background-size: 44px 44px, 44px 44px, 190px 190px;
  mask-image: linear-gradient(105deg, #000 8%, transparent 82%);
}

.breakout-hero .eyebrow,
.phase-four .brand-mark { color: var(--breakout-cyan); }
.breakout-hero .hero-proof { border-color: rgba(var(--breakout-cyan-rgb), .3); }
.breakout-hero .proof-number {
  color: #f8fcff;
  text-shadow: 0 0 48px rgba(var(--breakout-cyan-rgb), .26);
}

.range-glyph {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 56px auto;
  gap: 3px 12px;
  align-items: center;
  margin: 23px 0;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.range-glyph i {
  position: relative;
  grid-column: 2;
  grid-row: 1 / 4;
  display: block;
  width: 2px;
  height: 100%;
  justify-self: center;
  background: linear-gradient(var(--breakout-green), rgba(var(--breakout-cyan-rgb), .3), var(--breakout-red));
  box-shadow: 0 0 18px rgba(var(--breakout-cyan-rgb), .25);
}

.range-glyph i::before,
.range-glyph i::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 42px;
  height: 1px;
  transform: translateX(-50%);
}
.range-glyph i::before { top: 0; background: var(--breakout-green); }
.range-glyph i::after { bottom: 0; background: var(--breakout-red); }
.range-high { grid-column: 1; grid-row: 1; color: var(--breakout-green); }
.range-low { grid-column: 1; grid-row: 3; color: var(--breakout-red); }
.range-glyph b {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  transform: translateX(21px);
  color: var(--breakout-cyan);
  font-size: 1.35rem;
  line-height: 1;
}

.signal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-tile {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  background:
    linear-gradient(145deg, rgba(var(--breakout-cyan-rgb), .06), transparent 58%),
    rgba(8, 27, 34, .8);
}
.metric-tile::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  right: -36px;
  bottom: -36px;
  border: 1px solid rgba(var(--breakout-cyan-rgb), .17);
  border-radius: 50%;
}
.metric-label {
  display: block;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.metric-tile strong,
.explorer-metric strong {
  display: block;
  margin: 12px 0 6px;
  color: #f4fbff;
  font-size: clamp(1.65rem, 3.8vw, 2.5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.055em;
  line-height: 1;
}
.metric-tile > span:last-child,
.explorer-metric small { color: var(--dim); font-size: .75rem; }

.phase-four .answer-box {
  border-color: rgba(var(--breakout-violet-rgb), .28);
  background: linear-gradient(130deg, rgba(var(--breakout-violet-rgb), .09), rgba(var(--breakout-cyan-rgb), .035));
}
.phase-four .proof-label { color: var(--breakout-amber); }
.phase-four .proof-panel {
  border-color: rgba(var(--breakout-cyan-rgb), .32);
  background: linear-gradient(145deg, rgba(var(--breakout-cyan-rgb), .075), rgba(var(--breakout-violet-rgb), .03));
}
.phase-four .method-panel {
  border-color: rgba(var(--breakout-violet-rgb), .2);
  background: linear-gradient(145deg, rgba(12, 28, 41, .88), rgba(8, 27, 30, .78));
}
.phase-four .method-item {
  background: linear-gradient(145deg, rgba(var(--breakout-violet-rgb), .04), rgba(0, 0, 0, .1));
}
.phase-four .limitation-panel { border-left-color: var(--breakout-red); }

.phase-four .table-wrap {
  scrollbar-color: rgba(var(--breakout-cyan-rgb), .42) rgba(255, 255, 255, .04);
}
.phase-four tbody tr:hover { background: rgba(var(--breakout-cyan-rgb), .04); }
.phase-four .source-table code {
  display: block;
  max-width: 360px;
  overflow-wrap: anywhere;
  color: #bdeefa;
  line-height: 1.45;
}
.comparison-table tbody tr:first-child td,
.weekday-table .top-row td { background: rgba(var(--breakout-cyan-rgb), .045); }
.outcome-table td:nth-child(3) { color: var(--breakout-green); }
.outcome-table td:nth-child(4) { color: var(--breakout-red); }
.outcome-table td:nth-child(5),
.outcome-table td:nth-child(6) { color: #a6b1c1; }

.breakout-lab {
  margin: 44px 0;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(var(--breakout-cyan-rgb), .25);
  border-radius: 26px;
  background:
    radial-gradient(circle at 94% 2%, rgba(var(--breakout-violet-rgb), .12), transparent 26rem),
    linear-gradient(145deg, rgba(10, 31, 44, .95), rgba(5, 23, 27, .96));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .24);
}

.explorer-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}
.explorer-heading h2 { margin: 4px 0 10px; }
.explorer-heading p { max-width: 68ch; margin-bottom: 0; }
.confidence-chip {
  flex: 0 0 auto;
  max-width: 270px;
  padding: 8px 11px;
  border: 1px solid rgba(var(--breakout-cyan-rgb), .24);
  border-radius: 999px;
  background: rgba(var(--breakout-cyan-rgb), .06);
  color: #bfeef8;
  font-size: .67rem;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}
.confidence-chip[data-state="error"] {
  border-color: rgba(255, 139, 123, .35);
  background: rgba(255, 139, 123, .08);
  color: #ffc2ba;
}

.explorer-controls {
  display: grid;
  grid-template-columns: .82fr 1.55fr 1fr;
  gap: 14px;
  margin: 28px 0;
}
.explorer-controls fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(1, 12, 18, .36);
}
.explorer-controls legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.segment {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
}
.segment button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .72rem;
  font-weight: 850;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.segment button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .04);
  transform: translateY(-1px);
}
.segment button[aria-pressed="true"] {
  border-color: rgba(var(--breakout-cyan-rgb), .34);
  background: linear-gradient(145deg, rgba(var(--breakout-cyan-rgb), .13), rgba(var(--breakout-violet-rgb), .08));
  color: #e8fbff;
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

.explorer-output { min-height: 470px; }
.explorer-output[aria-busy="true"] { opacity: .72; }
.explorer-output .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.explorer-metric {
  min-height: 146px;
  background: linear-gradient(145deg, rgba(var(--breakout-cyan-rgb), .055), rgba(3, 16, 22, .65));
}
.explorer-metric:nth-child(3) { border-color: rgba(108, 229, 177, .26); }
.explorer-metric:nth-child(4) { border-color: rgba(255, 139, 123, .24); }

.outcome-visual {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(1, 12, 17, .38);
}
.outcome-visual h3 { margin: 0 0 6px; }
.outcome-visual p { margin-bottom: 18px; color: var(--muted); font-size: .8rem; }
.stacked-outcome {
  display: flex;
  width: 100%;
  min-height: 54px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 13px;
  background: rgba(255, 255, 255, .035);
  box-shadow: inset 0 1px 12px rgba(0, 0, 0, .25);
}
.outcome-segment {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 2px;
  color: #031110;
  font-size: .68rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.outcome-segment + .outcome-segment { border-left: 1px solid rgba(2, 14, 18, .38); }
.outcome-segment.continuation { background: linear-gradient(90deg, #45ba8c, var(--breakout-green)); }
.outcome-segment.opposite { background: linear-gradient(90deg, #df675d, var(--breakout-red)); }
.outcome-segment.ambiguous { background: linear-gradient(90deg, #dcae4f, var(--breakout-amber)); }
.outcome-segment.unresolved { background: linear-gradient(90deg, #66768c, #96a5b8); }
.outcome-segment span { padding: 0 8px; overflow: hidden; text-overflow: clip; }
.outcome-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}
.outcome-legend div {
  position: relative;
  padding-left: 15px;
  color: var(--muted);
  font-size: .67rem;
  line-height: 1.45;
}
.outcome-legend div::before {
  content: "";
  position: absolute;
  top: .35em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--legend-color);
}
.outcome-legend strong { display: block; font-size: .78rem; font-variant-numeric: tabular-nums; }
.outcome-legend .continuation { --legend-color: var(--breakout-green); }
.outcome-legend .opposite { --legend-color: var(--breakout-red); }
.outcome-legend .ambiguous { --legend-color: var(--breakout-amber); }
.outcome-legend .unresolved { --legend-color: var(--breakout-slate); }

.explorer-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.explorer-detail-grid article {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(6, 21, 28, .74);
}
.explorer-detail-grid h3 { margin: 0 0 15px; }
.explorer-detail-grid dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  margin: 0;
}
.explorer-detail-grid dt {
  min-width: 0;
  color: var(--muted);
  font-size: .74rem;
}
.explorer-detail-grid dd {
  margin: 0;
  color: #edf8fb;
  font-size: .78rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 980px) {
  .signal-grid,
  .explorer-output .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explorer-controls { grid-template-columns: 1fr 1fr; }
  .explorer-controls fieldset:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 720px) {
  .breakout-explorer-page .page-shell { width: calc(100% - 24px); }
  .explorer-heading { display: grid; }
  .confidence-chip { max-width: none; justify-self: start; text-align: left; }
  .explorer-controls { grid-template-columns: 1fr; }
  .explorer-controls fieldset:nth-child(2) { grid-column: auto; grid-row: auto; }
  .explorer-detail-grid { grid-template-columns: 1fr; }
  .outcome-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .signal-grid,
  .explorer-output .stat-grid { grid-template-columns: 1fr; }
  .breakout-lab { padding: 20px 14px; border-radius: 21px; }
  .segment { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #weekday-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #target-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .outcome-segment span { display: none; }
  .outcome-legend { grid-template-columns: 1fr; }
  .explorer-detail-grid dl { gap: 10px 12px; }
}

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