:root {
  --intel-gold: #e4c777;
  --intel-cream: #f3f0e5;
  --intel-mint: #72e5aa;
  --intel-warn: #e3a96b;
  --intel-line: rgba(221, 195, 116, 0.17);
  --intel-panel: rgba(13, 16, 12, 0.82);
}

.intelligence-page { background: #060805; color: var(--intel-cream); }
.intelligence-page .workspace { min-width: 0; }
.intelligence-scroll { padding: 52px clamp(22px, 3vw, 54px) 70px; }

.intelligence-actions { gap: 10px; }
.intelligence-actions label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(220, 199, 128, 0.14);
  border-radius: 11px;
  background: rgba(9, 12, 9, 0.72);
}
.intelligence-actions label > span {
  font: 400 8px/1 "DM Mono", monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #7f827a;
}
.intelligence-actions select {
  max-width: 155px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #d9d8ce;
  font: 500 10px/1.2 "DM Mono", monospace;
}
.intelligence-actions option { background: #10130f; }

.intelligence-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  min-height: 310px;
  margin-bottom: 28px;
  padding: 32px clamp(8px, 3vw, 34px);
  overflow: hidden;
}
.intelligence-hero::before {
  content: "";
  position: absolute;
  inset: 9% 12% auto 34%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 197, 112, .32), transparent);
  box-shadow: 0 0 45px rgba(226, 197, 112, .18);
}
.hero-copy { position: relative; z-index: 1; max-width: 850px; }
.hero-copy h1 {
  max-width: 770px;
  margin: 18px 0 22px;
  font: 600 clamp(42px, 5.4vw, 78px)/.96 "Plus Jakarta Sans", sans-serif;
  letter-spacing: -.065em;
  color: #f2f0e7;
}
.hero-copy h1 em { display: block; color: var(--intel-gold); font-style: normal; }
.hero-copy > p:last-child { max-width: 690px; color: #8e9289; font-size: 14px; line-height: 1.8; }

.confidence-orbit {
  position: relative;
  width: 190px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: end;
}
.confidence-orbit::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(222, 196, 116, .12), transparent 65%);
  box-shadow: 0 0 90px rgba(223, 193, 106, .08);
}
.confidence-ring { position: absolute; border: 1px solid rgba(218, 190, 105, .28); border-radius: 50%; }
.confidence-ring-a { inset: 12%; transform: rotate(24deg) scaleY(.52); animation: intel-orbit-a 14s linear infinite; }
.confidence-ring-b { inset: 4%; transform: rotate(-41deg) scaleY(.38); border-color: rgba(112, 212, 162, .2); animation: intel-orbit-b 18s linear infinite; }
.confidence-core {
  position: relative;
  z-index: 2;
  width: 112px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(225, 199, 121, .2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(226, 197, 112, .13), rgba(8, 11, 8, .94) 68%);
  box-shadow: inset 0 0 30px rgba(217, 188, 102, .06), 0 0 36px rgba(217, 188, 102, .06);
}
.confidence-core small, .confidence-core span { font: 400 7px/1.2 "DM Mono", monospace; letter-spacing: .13em; text-transform: uppercase; color: #777c72; }
.confidence-core strong { margin: 5px 0 4px; font: 500 28px/1 "DM Mono", monospace; color: #e6ce88; }
.confidence-core span { max-width: 72px; text-align: center; color: #73bc92; }

.currency-warning {
  align-items: center;
  gap: 14px;
  margin: -8px 0 22px;
  padding: 13px 16px;
  border: 1px solid rgba(226, 169, 107, .24);
  border-radius: 12px;
  background: rgba(93, 59, 28, .13);
}
.currency-warning:not([hidden]) { display: flex; }
.currency-warning > span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid rgba(226, 169, 107, .35); border-radius: 50%; color: var(--intel-warn); }
.currency-warning strong, .currency-warning small { display: block; }
.currency-warning strong { font-size: 11px; }
.currency-warning small { margin-top: 3px; color: #8e8c82; font-size: 9px; }

.metric-ribbon {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 22px;
  border: 1px solid var(--intel-line);
  border-radius: 18px;
  background: linear-gradient(130deg, rgba(21, 23, 17, .87), rgba(8, 11, 8, .88));
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .2);
}
.metric-ribbon article { min-width: 0; padding: 22px 20px 20px; border-right: 1px solid rgba(224, 199, 119, .1); }
.metric-ribbon article:last-child { border-right: 0; }
.metric-ribbon span, .metric-ribbon small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-ribbon span { font: 400 8px/1.2 "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: #6f746b; }
.metric-ribbon strong { display: block; margin: 13px 0 8px; font: 500 clamp(20px, 2vw, 29px)/1 "DM Mono", monospace; letter-spacing: -.06em; color: #eae7dc; }
.metric-ribbon small { font-size: 8px; color: #696e66; }
.metric-ribbon strong.is-positive { color: var(--intel-mint); }
.metric-ribbon strong.is-negative { color: #e28d7e; }

.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 22px; margin-bottom: 22px; }
.intelligence-panel {
  border: 1px solid var(--intel-line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(18, 21, 16, .9), rgba(8, 11, 8, .92));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .015);
}
.intelligence-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 25px 16px; }
.intelligence-panel h2 { margin: 7px 0 0; font: 600 19px/1.2 "Plus Jakarta Sans", sans-serif; letter-spacing: -.04em; }
.panel-kicker { margin: 0; font: 400 8px/1.2 "DM Mono", monospace; letter-spacing: .15em; text-transform: uppercase; color: #77796d; }
.chart-legend { display: flex; gap: 15px; padding-top: 4px; color: #777b72; font: 400 8px/1 "DM Mono", monospace; text-transform: uppercase; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 6px; height: 6px; border-radius: 50%; }
.equity-dot { background: var(--intel-gold); box-shadow: 0 0 8px rgba(228, 199, 119, .6); }
.drawdown-dot { background: #b87869; }
.chart-stage { position: relative; min-height: 340px; padding: 0 10px; }
#equity-chart { display: block; width: 100%; height: 330px; overflow: visible; }
.chart-grid { stroke: rgba(191, 185, 157, .08); stroke-width: 1; }
.chart-zero { stroke: rgba(224, 199, 118, .18); stroke-width: 1; stroke-dasharray: 4 6; }
.chart-area { fill: url(#equity-fill); }
.chart-line { fill: none; stroke: #e0c577; stroke-width: 2; filter: drop-shadow(0 0 5px rgba(224, 197, 119, .25)); }
.drawdown-area { fill: rgba(184, 105, 89, .12); stroke: rgba(199, 119, 101, .55); stroke-width: 1.2; }
.chart-point { fill: #f0d690; stroke: #0a0c09; stroke-width: 2; }
.chart-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #747970; }
.chart-empty[hidden] { display: none; }
.chart-empty span { width: 45px; height: 1px; margin-bottom: 15px; background: linear-gradient(90deg, transparent, #af9555, transparent); box-shadow: 0 0 14px #8e753d; }
.chart-empty strong { color: #c6c4b9; font-size: 12px; }
.chart-empty small { margin-top: 7px; font-size: 9px; }
.curve-panel footer { display: flex; justify-content: space-between; padding: 12px 25px 20px; border-top: 1px solid rgba(223, 197, 116, .08); color: #656a62; font: 400 8px/1 "DM Mono", monospace; }
.curve-panel footer strong { color: #8d8e82; font-weight: 400; text-transform: uppercase; letter-spacing: .12em; }

.live-mark { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid rgba(109, 224, 165, .18); border-radius: 999px; color: #74c69a; font: 400 7px/1 "DM Mono", monospace; text-transform: uppercase; }
.live-mark i { width: 4px; height: 4px; border-radius: 50%; background: #72e5aa; box-shadow: 0 0 8px #72e5aa; }
.insight-stack { padding: 2px 22px 22px; }
.insight-card { position: relative; padding: 16px 14px 16px 18px; border-top: 1px solid rgba(225, 198, 116, .1); }
.insight-card::before { content: ""; position: absolute; left: 0; top: 19px; width: 5px; height: 5px; border-radius: 50%; background: #7b7e73; }
.insight-card.is-positive::before { background: #70dca4; box-shadow: 0 0 8px rgba(112, 220, 164, .55); }
.insight-card.is-warning::before { background: #dda264; box-shadow: 0 0 8px rgba(221, 162, 100, .4); }
.insight-card span { font: 400 7px/1.2 "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: #696e65; }
.insight-card strong { display: block; margin: 7px 0 5px; font-size: 11px; line-height: 1.45; color: #d6d4ca; }
.insight-card p { margin: 0; color: #767b72; font-size: 9px; line-height: 1.6; }
.insight-loading, .edge-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 160px; color: #747970; font: 400 9px/1 "DM Mono", monospace; }
.insight-loading span, .edge-loading span { width: 7px; height: 7px; border: 1px solid #ab9252; border-radius: 50%; animation: intel-pulse 1.4s ease-in-out infinite; }

.edge-panel { margin-bottom: 22px; overflow: hidden; }
.edge-head { align-items: center !important; padding-bottom: 22px !important; }
.edge-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.edge-tabs button { min-height: 31px; padding: 0 12px; border: 1px solid rgba(218, 194, 118, .12); border-radius: 9px; background: rgba(5, 8, 5, .55); color: #777c73; font: 400 8px/1 "DM Mono", monospace; cursor: pointer; }
.edge-tabs button:hover, .edge-tabs button.is-active { border-color: rgba(226, 201, 122, .4); background: rgba(219, 190, 101, .08); color: #dac579; }
.edge-table { border-top: 1px solid rgba(221, 195, 116, .1); }
.edge-table-head, .edge-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) .5fr .65fr .75fr .8fr .65fr; align-items: center; gap: 18px; padding: 0 25px; }
.edge-table-head { min-height: 48px; color: #5f655d; font: 400 7px/1 "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.edge-row { position: relative; min-height: 67px; border-top: 1px solid rgba(221, 195, 116, .07); color: #aaa99f; font: 400 10px/1.3 "DM Mono", monospace; }
.edge-row::before { content: ""; position: absolute; left: 25px; bottom: 0; width: var(--edge-width, 0%); height: 1px; background: linear-gradient(90deg, rgba(222, 195, 112, .52), transparent); }
.edge-row.is-negative::before { background: linear-gradient(90deg, rgba(197, 107, 89, .55), transparent); }
.edge-segment strong { display: block; color: #dddacf; font: 600 12px/1.2 "Manrope", sans-serif; }
.edge-segment small { display: block; margin-top: 4px; color: #61665e; font-size: 7px; text-transform: uppercase; letter-spacing: .11em; }
.edge-result { color: #d8d5ca; }
.edge-result.is-positive { color: #72dca5; }
.edge-result.is-negative { color: #dc8b79; }
.reliability-pill { justify-self: start; padding: 5px 7px; border: 1px solid rgba(211, 190, 122, .14); border-radius: 999px; color: #797d74; font-size: 7px; text-transform: uppercase; letter-spacing: .1em; }
.reliability-pill.is-measured { border-color: rgba(105, 216, 158, .22); color: #6fc594; }
.reliability-pill.is-forming { color: #c3ae6d; }

.operating-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.operating-card { padding: 23px 24px; }
.operating-card h2 { margin-bottom: 23px; }
.streak-display { display: flex; align-items: flex-end; gap: 12px; margin: 30px 0 25px; }
.streak-display strong { font: 500 46px/1 "DM Mono", monospace; letter-spacing: -.08em; color: #e9d18a; }
.streak-display span { padding-bottom: 5px; color: #747970; font-size: 9px; }
.split-stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(220, 195, 117, .1); }
.split-stats > span { padding-top: 15px; }
.split-stats > span + span { padding-left: 16px; border-left: 1px solid rgba(220, 195, 117, .1); }
.split-stats small, .split-stats strong { display: block; }
.split-stats small { color: #646960; font: 400 7px/1.3 "DM Mono", monospace; text-transform: uppercase; }
.split-stats strong { margin-top: 8px; color: #c7c5ba; font: 500 15px/1 "DM Mono", monospace; }
.execution-stat { display: flex; align-items: flex-end; justify-content: space-between; margin: 34px 0 25px; }
.execution-stat span { color: #747970; font-size: 9px; }
.execution-stat strong { color: #e9d18a; font: 500 27px/1 "DM Mono", monospace; }
.coverage-row { display: flex; justify-content: space-between; margin: 16px 0 8px; color: #747970; font-size: 9px; }
.coverage-row strong { color: #c9c7bd; font: 500 9px/1 "DM Mono", monospace; }
.coverage-track { height: 3px; overflow: hidden; border-radius: 99px; background: rgba(220, 200, 128, .07); }
.coverage-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6aa47e, #d4ba70); box-shadow: 0 0 10px rgba(188, 171, 102, .22); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.intelligence-footnote { display: flex; align-items: center; gap: 12px; margin: 24px 2px 0; color: #5f645c; font: 400 8px/1.5 "DM Mono", monospace; }
.intelligence-footnote span { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: #a58d4e; box-shadow: 0 0 8px rgba(165, 141, 78, .45); }

@keyframes intel-orbit-a { to { transform: rotate(384deg) scaleY(.52); } }
@keyframes intel-orbit-b { to { transform: rotate(-401deg) scaleY(.38); } }
@keyframes intel-pulse { 50% { transform: scale(1.6); box-shadow: 0 0 12px rgba(218, 187, 93, .6); } }

@media (max-width: 1250px) {
  .metric-ribbon { grid-template-columns: repeat(3, 1fr); }
  .metric-ribbon article:nth-child(3) { border-right: 0; }
  .metric-ribbon article:nth-child(-n+3) { border-bottom: 1px solid rgba(224, 199, 119, .1); }
  .analysis-grid { grid-template-columns: 1fr; }
  .insight-stack { display: grid; grid-template-columns: repeat(2, 1fr); }
  .insight-card:nth-child(2) { border-left: 1px solid rgba(225, 198, 116, .1); padding-left: 25px; }
  .edge-table-head, .edge-row { grid-template-columns: minmax(160px, 1.2fr) .45fr .6fr .7fr .75fr .65fr; }
}

@media (max-width: 900px) {
  .intelligence-actions .concept-badge { display: none; }
  .intelligence-hero { grid-template-columns: 1fr 160px; min-height: 265px; }
  .confidence-orbit { width: 150px; }
  .confidence-core { width: 94px; }
  .operating-grid { grid-template-columns: 1fr; }
  .edge-head { align-items: flex-start !important; flex-direction: column; }
  .edge-table { overflow-x: auto; }
  .edge-table-head, .edge-row { min-width: 760px; }
}

@media (max-width: 680px) {
  .intelligence-scroll { padding: 27px 15px 55px; }
  .intelligence-actions { width: 100%; }
  .intelligence-actions label { flex: 1; justify-content: space-between; padding: 0 9px; }
  .intelligence-actions select { max-width: 105px; font-size: 8px; }
  .intelligence-hero { grid-template-columns: 1fr; padding: 22px 6px 20px; }
  .hero-copy h1 { font-size: clamp(40px, 13vw, 58px); }
  .hero-copy > p:last-child { font-size: 12px; }
  .confidence-orbit { width: 130px; margin-top: 24px; justify-self: start; }
  .confidence-core { width: 84px; }
  .confidence-core strong { font-size: 23px; }
  .metric-ribbon { grid-template-columns: repeat(2, 1fr); }
  .metric-ribbon article { border-bottom: 1px solid rgba(224, 199, 119, .1); }
  .metric-ribbon article:nth-child(2n) { border-right: 0; }
  .metric-ribbon article:nth-child(n+5) { border-bottom: 0; }
  .metric-ribbon strong { font-size: 20px; }
  .chart-legend { flex-direction: column; gap: 7px; }
  .chart-stage { min-height: 280px; }
  #equity-chart { height: 280px; }
  .insight-stack { display: block; }
  .insight-card:nth-child(2) { border-left: 0; padding-left: 18px; }
  .edge-tabs { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .edge-tabs button { padding: 0 7px; }
  .curve-panel footer { padding-inline: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .confidence-ring, .insight-loading span, .edge-loading span { animation: none !important; }
}
