.phase-five {
  --orb-gold: #f2c86b;
  --orb-gold-rgb: 242, 200, 107;
  --orb-teal: #72ddd1;
  --orb-teal-rgb: 114, 221, 209;
  --orb-coral: #ff8e78;
  --orb-cream: #fff5d8;
  --orb-slate: #8292a7;
  background:
    radial-gradient(circle at 87% 3%, rgba(var(--orb-gold-rgb), .14), transparent 31rem),
    radial-gradient(circle at 9% 30%, rgba(var(--orb-teal-rgb), .08), transparent 28rem),
    linear-gradient(180deg, #0d0d0e 0%, #12140f 47%, #080c0c 100%);
}

.phase-five .article-shell { width: min(1060px, 100%); }
.orb-explorer-page .page-shell { width: min(1280px, calc(100% - 36px)); }
.orb-explorer-page .article-shell { width: min(1180px, 100%); }
.phase-five + .page-footer,
.phase-five .page-footer { width: min(1060px, calc(100% - 36px)); margin: 80px auto 0; padding-bottom: 34px; }

.orb-hero {
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(var(--orb-gold-rgb), .28);
  background:
    radial-gradient(circle at 86% 12%, rgba(var(--orb-gold-rgb), .14), transparent 23rem),
    linear-gradient(140deg, rgba(31, 28, 20, .98), rgba(11, 25, 24, .96));
}

.orb-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .42;
  background-image:
    linear-gradient(rgba(var(--orb-gold-rgb), .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--orb-gold-rgb), .06) 1px, transparent 1px),
    linear-gradient(118deg, transparent 49.6%, rgba(var(--orb-teal-rgb), .21) 50%, transparent 50.4%);
  background-size: 48px 48px, 48px 48px, 210px 210px;
  mask-image: linear-gradient(104deg, #000 7%, transparent 84%);
}

.orb-hero .eyebrow,
.phase-five .brand-mark { color: var(--orb-gold); }
.orb-hero .hero-proof { border-color: rgba(var(--orb-gold-rgb), .3); }
.orb-hero .proof-number {
  color: var(--orb-cream);
  text-shadow: 0 0 48px rgba(var(--orb-gold-rgb), .22);
}

.orb-glyph {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 25px 0;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.orb-glyph i {
  display: block;
  min-width: 26px;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--orb-gold-rgb), .2), var(--orb-gold));
}
.orb-glyph b {
  position: relative;
  display: block;
  width: 44px;
  height: 56px;
  border: 1px solid rgba(var(--orb-gold-rgb), .55);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(var(--orb-gold-rgb), .13), rgba(var(--orb-teal-rgb), .045));
  box-shadow: inset 0 0 20px rgba(var(--orb-gold-rgb), .05), 0 0 22px rgba(var(--orb-gold-rgb), .07);
}
.orb-glyph b::before,
.orb-glyph b::after {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  height: 1px;
  background: var(--orb-gold);
}
.orb-glyph b::before { top: 0; }
.orb-glyph b::after { bottom: 0; background: var(--orb-teal); }

.orb-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.orb-stat-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 146px;
  background:
    linear-gradient(145deg, rgba(var(--orb-gold-rgb), .065), transparent 61%),
    rgba(20, 27, 25, .82);
}
.orb-stat-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -34px;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(var(--orb-gold-rgb), .16);
  border-radius: 50%;
}
.metric-label {
  display: block;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .085em;
  text-transform: uppercase;
}
.orb-stat-card strong {
  display: block;
  margin: 12px 0 7px;
  color: var(--orb-cream);
  font-size: clamp(1.55rem, 3.5vw, 2.35rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.05em;
  line-height: 1;
  overflow-wrap: anywhere;
}
.orb-stat-card > span:last-child { color: var(--dim); font-size: .73rem; }

.phase-five .answer-box {
  border-color: rgba(var(--orb-gold-rgb), .25);
  background: linear-gradient(130deg, rgba(var(--orb-gold-rgb), .085), rgba(var(--orb-teal-rgb), .035));
}
.phase-five .proof-label { color: var(--orb-gold); }
.phase-five .proof-panel {
  border-color: rgba(var(--orb-gold-rgb), .3);
  background: linear-gradient(145deg, rgba(var(--orb-gold-rgb), .07), rgba(var(--orb-teal-rgb), .025));
}
.phase-five .method-panel {
  border-color: rgba(var(--orb-teal-rgb), .2);
  background: linear-gradient(145deg, rgba(28, 27, 20, .86), rgba(9, 28, 27, .78));
}
.phase-five .method-item { background: linear-gradient(145deg, rgba(var(--orb-gold-rgb), .035), rgba(0, 0, 0, .11)); }
.phase-five .orb-limitations { border-left-color: var(--orb-coral); }
.phase-five .table-wrap { scrollbar-color: rgba(var(--orb-gold-rgb), .45) rgba(255, 255, 255, .04); }
.phase-five tbody tr:hover { background: rgba(var(--orb-gold-rgb), .035); }
.phase-five .source-table code {
  display: block;
  max-width: 390px;
  overflow-wrap: anywhere;
  color: #f6dc9f;
  line-height: 1.45;
}
.orb-outcome-table td:nth-child(3) { color: var(--orb-teal); }
.orb-outcome-table td:nth-child(4) { color: var(--orb-coral); }
.orb-outcome-table td:nth-child(5),
.orb-outcome-table td:nth-child(6) { color: #aab4c2; }

.proof-audit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.proof-audit-grid span {
  padding: 13px;
  border: 1px solid rgba(var(--orb-gold-rgb), .13);
  border-radius: 13px;
  background: rgba(0, 0, 0, .13);
  color: var(--muted);
  font-size: .72rem;
}
.proof-audit-grid strong { display: block; margin-bottom: 3px; color: var(--orb-teal); font-size: 1.25rem; }
.orb-button { border-color: rgba(var(--orb-gold-rgb), .34); background: rgba(var(--orb-gold-rgb), .1); color: var(--orb-cream); }

.orb-lab {
  margin: 44px 0;
  padding: clamp(22px, 4vw, 39px);
  border: 1px solid rgba(var(--orb-gold-rgb), .26);
  border-radius: 27px;
  background:
    radial-gradient(circle at 95% 1%, rgba(var(--orb-gold-rgb), .13), transparent 27rem),
    linear-gradient(145deg, rgba(28, 28, 21, .97), rgba(7, 26, 25, .97));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .25);
}

.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: 290px;
  padding: 8px 12px;
  border: 1px solid rgba(var(--orb-gold-rgb), .25);
  border-radius: 999px;
  background: rgba(var(--orb-gold-rgb), .07);
  color: #f7dda3;
  font-size: .67rem;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}
.confidence-chip[data-state='error'] { border-color: rgba(255, 142, 120, .38); background: rgba(255, 142, 120, .08); color: #ffc2b6; }

.orb-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 13px;
  margin: 29px 0;
}
.orb-controls fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 10, 10, .34);
}
.orb-controls fieldset:nth-child(-n+3) { grid-column: span 2; }
.orb-controls fieldset:nth-child(n+4) { grid-column: span 3; }
.orb-controls legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .085em;
  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 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .7rem;
  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(--orb-gold-rgb), .36);
  background: linear-gradient(145deg, rgba(var(--orb-gold-rgb), .14), rgba(var(--orb-teal-rgb), .075));
  color: var(--orb-cream);
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}
.segment button:focus-visible { outline: 2px solid var(--orb-gold); outline-offset: 2px; }

.explorer-output { min-height: 500px; transition: opacity .16s ease; }
.explorer-output[aria-busy='true'] { opacity: .68; }
.explorer-output .orb-stat-grid { margin-bottom: 22px; }
.explorer-output .orb-stat-card:nth-child(3) { border-color: rgba(var(--orb-teal-rgb), .27); }
.explorer-output .orb-stat-card:nth-child(4) { border-color: rgba(255, 142, 120, .25); }

.outcome-visual {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(0, 10, 11, .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: 55px;
  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: #06100e;
  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, .4); }
.outcome-segment.continuation { background: linear-gradient(90deg, #43bbaa, var(--orb-teal)); }
.outcome-segment.opposite { background: linear-gradient(90deg, #dc6c59, var(--orb-coral)); }
.outcome-segment.ambiguous { background: linear-gradient(90deg, #cba143, var(--orb-gold)); }
.outcome-segment.unresolved { background: linear-gradient(90deg, #667589, #99a7b7); }
.outcome-segment span { padding: 0 8px; overflow: hidden; }
.outcome-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  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(--orb-teal); }
.outcome-legend .opposite { --legend-color: var(--orb-coral); }
.outcome-legend .ambiguous { --legend-color: var(--orb-gold); }
.outcome-legend .unresolved { --legend-color: var(--orb-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(12, 24, 22, .72);
}
.explorer-detail-grid h3 { margin: 0 0 15px; }
.explorer-detail-grid dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 18px;
  margin: 0;
}
.explorer-detail-grid dt { min-width: 0; color: var(--muted); font-size: .73rem; }
.explorer-detail-grid dd { margin: 0; color: #f5f6ef; font-size: .78rem; font-weight: 850; font-variant-numeric: tabular-nums; text-align: right; }

@media (max-width: 980px) {
  .orb-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-audit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orb-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orb-controls fieldset:nth-child(n) { grid-column: auto; }
  .orb-controls fieldset:nth-child(3) { grid-column: 1 / -1; }
}

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

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

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