.stock-moving-average,
.stock-quadratic-confidence {
  max-width: 1100px;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stock-moving-average__header,
.stock-quadratic-confidence__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #fbfdff;
}
.stock-moving-average__header h2,
.stock-quadratic-confidence__header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.stock-moving-average__header p,
.stock-quadratic-confidence__header p {
  max-width: 760px;
  margin: 7px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}
.stock-moving-average__header code,
.stock-quadratic-confidence__header code {
  padding: 1px 4px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
}

.stock-moving-average__kicker,
.stock-quadratic-confidence__kicker {
  margin-bottom: 6px;
  color: #0891b2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stock-quadratic-confidence__kicker {
  color: #0066ff;
}

.stock-moving-average__range {
  flex: 0 0 auto;
  min-width: 136px;
  text-align: right;
}
.stock-moving-average__range span,
.stock-moving-average__range strong {
  display: block;
}
.stock-moving-average__range span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stock-moving-average__range strong {
  margin-top: 5px;
  color: #0f172a;
  font-size: 13px;
}

.stock-moving-average__metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 0;
}

.stock-moving-average__metric,
.stock-quadratic-confidence__metric {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #e5e7eb;
  border-top-width: 3px;
  border-radius: 14px;
  background: #ffffff;
}
.stock-moving-average__metric span,
.stock-moving-average__metric strong,
.stock-moving-average__metric small,
.stock-quadratic-confidence__metric span,
.stock-quadratic-confidence__metric strong,
.stock-quadratic-confidence__metric small {
  display: block;
}
.stock-moving-average__metric span,
.stock-quadratic-confidence__metric span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stock-moving-average__metric strong,
.stock-quadratic-confidence__metric strong {
  margin-top: 6px;
  color: #0f172a;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.stock-moving-average__metric small,
.stock-quadratic-confidence__metric small {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.35;
}

.stock-moving-average__metric--price {
  border-top-color: #0f172a;
}

.stock-moving-average__metric--ma-20 {
  border-top-color: #0891b2;
}

.stock-moving-average__metric--ema-20 {
  border-top-color: #059669;
}

.stock-moving-average__metric--ma-50 {
  border-top-color: #d97706;
}

.stock-moving-average__metric--ma-200 {
  border-top-color: #7c3aed;
}

.stock-moving-average__chart,
.stock-quadratic-confidence__chart {
  min-width: 0;
  padding: 14px 18px 8px;
}
.stock-moving-average__chart canvas,
.stock-moving-average__chart svg,
.stock-quadratic-confidence__chart canvas,
.stock-quadratic-confidence__chart svg {
  max-width: 100%;
}

.stock-moving-average__footer,
.stock-quadratic-confidence__footer {
  padding: 0 20px 16px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}
.stock-moving-average__footer code,
.stock-quadratic-confidence__footer code {
  color: #334155;
  font-size: 10px;
}

.stock-moving-average__empty,
.stock-quadratic-confidence__empty {
  padding: 34px 20px;
  text-align: center;
}
.stock-moving-average__empty strong,
.stock-moving-average__empty span,
.stock-quadratic-confidence__empty strong,
.stock-quadratic-confidence__empty span {
  display: block;
}
.stock-moving-average__empty strong,
.stock-quadratic-confidence__empty strong {
  color: #334155;
  font-size: 14px;
}
.stock-moving-average__empty span,
.stock-quadratic-confidence__empty span {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 12px;
}
.stock-moving-average__empty code,
.stock-quadratic-confidence__empty code {
  font-size: 11px;
}

.stock-quadratic-confidence__status {
  flex: 0 0 auto;
  min-width: 168px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  text-align: right;
}
.stock-quadratic-confidence__status span,
.stock-quadratic-confidence__status strong {
  display: block;
}
.stock-quadratic-confidence__status span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stock-quadratic-confidence__status strong {
  margin-top: 5px;
  color: #334155;
  font-size: 13px;
}

.stock-quadratic-confidence__status--below_lower {
  border-color: #ff8fa3;
  background: #fff1f3;
}
.stock-quadratic-confidence__status--below_lower strong {
  color: #d50032;
}

.stock-quadratic-confidence__status--within_bands {
  border-color: #7dd3fc;
  background: #effaff;
}
.stock-quadratic-confidence__status--within_bands strong {
  color: #0066ff;
}

.stock-quadratic-confidence__status--above_upper {
  border-color: #69f0ae;
  background: #edfff5;
}
.stock-quadratic-confidence__status--above_upper strong {
  color: #008f3d;
}

.stock-quadratic-confidence__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 0;
}

.stock-quadratic-confidence__metric {
  border-top-color: #ff2bd6;
}

.stock-quadratic-confidence__metric--fit {
  border-top-color: #0066ff;
}

.stock-quadratic-confidence__metric--lower {
  border-top-color: #ff1744;
}

.stock-quadratic-confidence__metric--upper {
  border-top-color: #00c853;
}

.stock-quadratic-confidence__alert {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 20px 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}
.stock-quadratic-confidence__alert strong {
  flex: 0 0 auto;
}

.stock-quadratic-confidence__distance {
  margin-left: auto;
  color: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.stock-quadratic-confidence__alert--below_lower {
  border-color: #ff8fa3;
  background: #fff1f3;
  color: #b0002a;
}

.stock-quadratic-confidence__alert--within_bands {
  border-color: #7dd3fc;
  background: #effaff;
  color: #0057d9;
}

.stock-quadratic-confidence__alert--above_upper {
  border-color: #69f0ae;
  background: #edfff5;
  color: #007a34;
}

.stock-quadratic-confidence__legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 20px 0;
}

.stock-quadratic-confidence__legend-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #f8fafc;
}
.stock-quadratic-confidence__legend-item strong,
.stock-quadratic-confidence__legend-item small {
  display: block;
}
.stock-quadratic-confidence__legend-item strong {
  color: #263548;
  font-size: 12px;
  line-height: 1.3;
}
.stock-quadratic-confidence__legend-item small {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
}

.stock-quadratic-confidence__legend-swatch {
  position: relative;
  display: block;
  width: 30px;
  height: 12px;
  margin-top: 3px;
}
.stock-quadratic-confidence__legend-swatch::before {
  position: absolute;
  top: 4px;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  content: "";
}
.stock-quadratic-confidence__legend-swatch::after {
  position: absolute;
  top: 0;
  left: 11px;
  width: 9px;
  height: 9px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 1px currentColor;
  content: "";
}

.stock-quadratic-confidence__legend-swatch--actual {
  color: #ff2bd6;
}

.stock-quadratic-confidence__legend-swatch--fit {
  color: #0066ff;
}

.stock-quadratic-confidence__legend-swatch--lower {
  color: #ff1744;
}

.stock-quadratic-confidence__legend-swatch--upper {
  color: #00c853;
}

.stock-quadratic-confidence__coefficient-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
}

.stock-quadratic-confidence__legend-item--coefficient-positive {
  border-color: #69f0ae;
  background: #edfff5;
  color: #00a844;
}
.stock-quadratic-confidence__legend-item--coefficient-positive strong,
.stock-quadratic-confidence__legend-item--coefficient-positive small {
  color: #007a34;
}

.stock-quadratic-confidence__legend-item--coefficient-negative {
  border-color: #ff8fa3;
  background: #fff1f3;
  color: #ff1744;
}
.stock-quadratic-confidence__legend-item--coefficient-negative strong,
.stock-quadratic-confidence__legend-item--coefficient-negative small {
  color: #b0002a;
}

.stock-quadratic-confidence__legend-item--coefficient-flat {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

@media (max-width: 1100px) {
  .stock-quadratic-confidence__legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .stock-moving-average__metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .stock-moving-average__metrics,
  .stock-quadratic-confidence__metrics,
  .stock-quadratic-confidence__legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .stock-moving-average,
  .stock-quadratic-confidence {
    margin-right: 0;
    margin-left: 0;
  }
  .stock-moving-average__header,
  .stock-quadratic-confidence__header {
    display: block;
    padding: 16px;
  }
  .stock-moving-average__range,
  .stock-quadratic-confidence__status {
    margin-top: 12px;
    text-align: left;
  }
  .stock-moving-average__metrics,
  .stock-quadratic-confidence__metrics,
  .stock-quadratic-confidence__legend {
    grid-template-columns: 1fr;
    padding-right: 16px;
    padding-left: 16px;
  }
  .stock-moving-average__chart,
  .stock-quadratic-confidence__chart {
    padding-right: 8px;
    padding-left: 8px;
  }
  .stock-moving-average__footer,
  .stock-quadratic-confidence__footer {
    padding-right: 16px;
    padding-left: 16px;
  }
  .stock-quadratic-confidence__alert {
    align-items: flex-start;
    flex-direction: column;
    margin-right: 16px;
    margin-left: 16px;
  }
  .stock-quadratic-confidence__distance {
    margin-left: 0;
  }
}
.stock-adaptive-bands {
  max-width: 1480px;
  margin: 18px auto;
  overflow: hidden;
  border: 1px solid rgba(165, 180, 252, 0.55);
  border-radius: 18px;
  background: radial-gradient(circle at 4% 0%, rgba(255, 43, 214, 0.07), transparent 28%), radial-gradient(circle at 96% 8%, rgba(0, 230, 118, 0.08), transparent 30%), linear-gradient(135deg, #ffffff 0%, #f8fbff 48%, #fff9fd 100%);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stock-adaptive-bands__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 20px;
  border-bottom: 1px solid rgba(165, 180, 252, 0.42);
  background: linear-gradient(120deg, rgba(255, 43, 214, 0.08), rgba(56, 189, 248, 0.065) 50%, rgba(0, 230, 118, 0.075)), #fbfdff;
}
.stock-adaptive-bands__header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.stock-adaptive-bands__header p {
  max-width: 780px;
  margin: 7px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.stock-adaptive-bands__kicker {
  margin-bottom: 6px;
  background: linear-gradient(90deg, #c026ff, #0891b2, #00a86b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stock-adaptive-bands__header-meta {
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid rgba(165, 180, 252, 0.38);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  text-align: right;
}
.stock-adaptive-bands__header-meta span,
.stock-adaptive-bands__header-meta strong,
.stock-adaptive-bands__header-meta small {
  display: block;
}
.stock-adaptive-bands__header-meta span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stock-adaptive-bands__header-meta strong {
  margin-top: 5px;
  color: #0f172a;
  font-size: 14px;
}
.stock-adaptive-bands__header-meta small {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}

.stock-adaptive-bands__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 0;
}

.stock-adaptive-bands__metric {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.9));
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.stock-adaptive-bands__metric span,
.stock-adaptive-bands__metric strong,
.stock-adaptive-bands__metric small {
  display: block;
}
.stock-adaptive-bands__metric span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stock-adaptive-bands__metric strong {
  margin-top: 6px;
  overflow: hidden;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-adaptive-bands__metric small {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.4;
}

.stock-adaptive-bands__metric--actual {
  border-color: rgba(255, 43, 214, 0.22);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(253, 242, 255, 0.9));
}

.stock-adaptive-bands__metric--lower {
  border-color: rgba(255, 23, 68, 0.22);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 241, 242, 0.92));
}

.stock-adaptive-bands__metric--upper {
  border-color: rgba(0, 230, 118, 0.25);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(236, 253, 245, 0.94));
}

.stock-adaptive-bands__metric--status-below {
  border-color: rgba(255, 23, 68, 0.34);
  background: linear-gradient(145deg, #fff7f8, #ffe9ee);
}
.stock-adaptive-bands__metric--status-below strong {
  color: #d90429;
}

.stock-adaptive-bands__metric--status-within {
  border-color: rgba(14, 165, 233, 0.3);
  background: linear-gradient(145deg, #f7fcff, #e8f7ff);
}
.stock-adaptive-bands__metric--status-within strong {
  color: #0369a1;
}

.stock-adaptive-bands__metric--status-above {
  border-color: rgba(0, 230, 118, 0.34);
  background: linear-gradient(145deg, #f6fff9, #e5faee);
}
.stock-adaptive-bands__metric--status-above strong {
  color: #008f4c;
}

.stock-adaptive-bands__legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 20px 0;
}

.stock-adaptive-bands__legend-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 13px;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}
.stock-adaptive-bands__legend-item strong,
.stock-adaptive-bands__legend-item small {
  display: block;
}
.stock-adaptive-bands__legend-item strong {
  color: #334155;
  font-size: 12px;
  line-height: 1.25;
}
.stock-adaptive-bands__legend-item small {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
}

.stock-adaptive-bands__legend-item--actual {
  border-color: rgba(255, 43, 214, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(252, 231, 255, 0.7));
}

.stock-adaptive-bands__legend-item--lower {
  border-color: rgba(255, 23, 68, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 228, 230, 0.72));
}

.stock-adaptive-bands__legend-item--upper {
  border-color: rgba(0, 230, 118, 0.22);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(220, 252, 231, 0.72));
}

.stock-adaptive-bands__legend-swatch {
  position: relative;
  display: block;
  width: 30px;
  height: 10px;
  margin-top: 3px;
}
.stock-adaptive-bands__legend-swatch::before {
  position: absolute;
  top: 4px;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  content: "";
}
.stock-adaptive-bands__legend-swatch::after {
  position: absolute;
  top: 1px;
  left: 12px;
  width: 8px;
  height: 8px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  content: "";
}

.stock-adaptive-bands__legend-swatch--actual::before {
  background: linear-gradient(90deg, #ff2bd6, #c026ff, #7c3aed);
  box-shadow: 0 0 8px rgba(255, 43, 214, 0.34);
}
.stock-adaptive-bands__legend-swatch--actual::after {
  background: #ff2bd6;
  box-shadow: 0 0 0 1px #ff2bd6, 0 0 7px rgba(255, 43, 214, 0.42);
}

.stock-adaptive-bands__legend-swatch--lower::before {
  background: linear-gradient(90deg, #ff1744, #ff3d00, #ff6d00);
  box-shadow: 0 0 8px rgba(255, 23, 68, 0.3);
}
.stock-adaptive-bands__legend-swatch--lower::after {
  background: #ff1744;
  box-shadow: 0 0 0 1px #ff1744, 0 0 7px rgba(255, 23, 68, 0.38);
}

.stock-adaptive-bands__legend-swatch--upper::before {
  background: linear-gradient(90deg, #00e676, #00d4aa, #00b8d9);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.3);
}
.stock-adaptive-bands__legend-swatch--upper::after {
  background: #00e676;
  box-shadow: 0 0 0 1px #00b96b, 0 0 7px rgba(0, 230, 118, 0.38);
}

.stock-adaptive-bands__segment-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 20px 0;
  padding: 10px 12px;
  border: 1px solid rgba(125, 211, 252, 0.58);
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(239, 246, 255, 0.95), rgba(240, 253, 250, 0.9));
  color: #475569;
}
.stock-adaptive-bands__segment-note p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}
.stock-adaptive-bands__segment-note strong {
  color: #334155;
}

.stock-adaptive-bands__segment-note-icon {
  flex: 0 0 auto;
  color: #0284c7;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.stock-adaptive-bands__chart {
  min-width: 0;
  margin: 14px 20px 18px;
  padding: 12px 10px 8px;
  overflow: hidden;
  border: 1px solid rgba(165, 180, 252, 0.42);
  border-radius: 16px;
  background: radial-gradient(circle at 8% 5%, rgba(255, 43, 214, 0.07), transparent 25%), radial-gradient(circle at 92% 5%, rgba(0, 230, 118, 0.08), transparent 28%), linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.96));
  box-shadow: 0 12px 30px rgba(30, 41, 59, 0.075), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.stock-adaptive-bands__chart canvas,
.stock-adaptive-bands__chart svg {
  max-width: 100%;
}

.stock-adaptive-bands__segments {
  margin: 0 20px 20px;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.9);
}
.stock-adaptive-bands__segments summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #f8fafc, #f0f9ff);
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}
.stock-adaptive-bands__segments summary::-webkit-details-marker {
  display: none;
}
.stock-adaptive-bands__segments summary span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}
.stock-adaptive-bands__segments[open] summary {
  border-bottom: 1px solid #e2e8f0;
}

.stock-adaptive-bands__segment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.stock-adaptive-bands__segment-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 11px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
}
.stock-adaptive-bands__segment-card code {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  overflow-x: auto;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}

.stock-adaptive-bands__segment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stock-adaptive-bands__segment-card-header strong {
  color: #334155;
  font-size: 11px;
}
.stock-adaptive-bands__segment-card-header span {
  color: #94a3b8;
  font-size: 10px;
}

.stock-adaptive-bands__empty {
  padding: 44px 20px;
  text-align: center;
}
.stock-adaptive-bands__empty strong {
  display: block;
  color: #334155;
  font-size: 15px;
}
.stock-adaptive-bands__empty p {
  max-width: 560px;
  margin: 7px auto 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1040px) {
  .stock-adaptive-bands__metrics,
  .stock-adaptive-bands__legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .stock-adaptive-bands__header {
    display: block;
    padding: 16px;
  }
  .stock-adaptive-bands__header-meta {
    margin-top: 12px;
    text-align: left;
  }
  .stock-adaptive-bands__metrics,
  .stock-adaptive-bands__legend,
  .stock-adaptive-bands__segment-grid {
    grid-template-columns: 1fr;
  }
  .stock-adaptive-bands__metrics,
  .stock-adaptive-bands__legend {
    padding-right: 16px;
    padding-left: 16px;
  }
  .stock-adaptive-bands__segment-note,
  .stock-adaptive-bands__segments,
  .stock-adaptive-bands__chart {
    margin-right: 16px;
    margin-left: 16px;
  }
  .stock-adaptive-bands__chart {
    padding-right: 4px;
    padding-left: 4px;
  }
}
/* Unified bright analytical chart system: moving averages, adaptive bands, and regime response. */
.stock-analysis-chart-panel,
.stock-adaptive-bands {
  position: relative;
  isolation: isolate;
  max-width: 1480px;
  margin: 22px auto;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 24px;
  background: radial-gradient(circle at 8% 0%, rgba(255, 43, 214, 0.09), transparent 27%), radial-gradient(circle at 92% 0%, rgba(0, 230, 118, 0.08), transparent 28%), linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.08);
}

.stock-analysis-chart-panel::before,
.stock-adaptive-bands::before {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff2bd6 0%, #0066ff 27%, #00e676 54%, #ffd600 76%, #7c3aed 100%);
  content: "";
}

.stock-analysis-chart-panel__header,
.stock-adaptive-bands__header {
  border-bottom-color: rgba(148, 163, 184, 0.28);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.88)), linear-gradient(90deg, rgba(255, 43, 214, 0.06), rgba(0, 230, 118, 0.05));
}

.stock-analysis-chart-panel__kicker,
.stock-adaptive-bands__kicker {
  background: linear-gradient(90deg, #ff2bd6, #0066ff, #00c853);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stock-analysis-chart-panel__chart,
.stock-adaptive-bands__chart {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  background: radial-gradient(circle at 10% 5%, rgba(255, 43, 214, 0.065), transparent 30%), radial-gradient(circle at 90% 12%, rgba(0, 230, 118, 0.06), transparent 30%), linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 32px rgba(15, 23, 42, 0.06);
}

.stock-analysis-chart-panel__footer,
.stock-adaptive-bands__footer {
  border-top-color: rgba(148, 163, 184, 0.24);
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.92), rgba(240, 249, 255, 0.78));
}

.stock-moving-average__range {
  border-color: rgba(0, 102, 255, 0.3);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(236, 254, 255, 0.92));
  box-shadow: 0 10px 24px rgba(0, 102, 255, 0.08);
}

.stock-moving-average__range small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.stock-moving-average__metrics,
.stock-quadratic-confidence__metrics {
  gap: 12px;
}

.stock-moving-average__metric,
.stock-quadratic-confidence__metric,
.stock-adaptive-bands__metric {
  position: relative;
  overflow: hidden;
  border-color: rgba(148, 163, 184, 0.28);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.055);
}

.stock-moving-average__metric::before,
.stock-quadratic-confidence__metric::before,
.stock-adaptive-bands__metric::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  content: "";
}

.stock-moving-average__metric--price::before,
.stock-quadratic-confidence__metric--actual::before,
.stock-adaptive-bands__metric--actual::before {
  background: linear-gradient(90deg, #ff2bd6, #7c3aed);
}

.stock-moving-average__metric--ma-20::before {
  background: linear-gradient(90deg, #00d4ff, #0066ff);
}

.stock-moving-average__metric--ema-20::before {
  background: linear-gradient(90deg, #a3ff12, #00e676, #00b8d9);
}

.stock-moving-average__metric--ma-50::before {
  background: linear-gradient(90deg, #ffd600, #ff9100, #ff3d00);
}

.stock-moving-average__metric--ma-200::before {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed, #ec4899);
}

.stock-quadratic-confidence__metric--fit::before {
  background: linear-gradient(90deg, #00d4ff, #0066ff, #4f46e5);
}

.stock-quadratic-confidence__metric--lower::before,
.stock-adaptive-bands__metric--lower::before {
  background: linear-gradient(90deg, #ff1744, #ff3d00, #ff9100);
}

.stock-quadratic-confidence__metric--upper::before,
.stock-adaptive-bands__metric--upper::before {
  background: linear-gradient(90deg, #a3ff12, #00e676, #00b8d9);
}

.stock-moving-average__legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 24px 18px;
}

.stock-moving-average__legend-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.9));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.stock-moving-average__legend-item strong,
.stock-moving-average__legend-item small {
  display: block;
}

.stock-moving-average__legend-item strong {
  color: #0f172a;
  font-size: 12px;
  line-height: 1.25;
}

.stock-moving-average__legend-item small {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}

.stock-moving-average__legend-swatch,
.stock-quadratic-confidence__legend-swatch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 42px;
  height: 5px;
  border-radius: 999px;
  box-shadow: 0 0 11px currentColor;
}

.stock-moving-average__legend-swatch::after,
.stock-quadratic-confidence__legend-swatch::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #ffffff;
  content: "";
  transform: translate(-50%, -50%);
}

.stock-moving-average__legend-swatch--price,
.stock-quadratic-confidence__legend-swatch--actual {
  background: linear-gradient(90deg, #ff2bd6, #7c3aed);
  color: #ff2bd6;
}

.stock-moving-average__legend-swatch--ma-20,
.stock-quadratic-confidence__legend-swatch--fit {
  background: linear-gradient(90deg, #00d4ff, #0066ff, #4f46e5);
  color: #0066ff;
}

.stock-moving-average__legend-swatch--ema-20,
.stock-quadratic-confidence__legend-swatch--upper {
  background: linear-gradient(90deg, #a3ff12, #00e676, #00b8d9);
  color: #00c853;
}

.stock-moving-average__legend-swatch--ma-50,
.stock-quadratic-confidence__legend-swatch--lower {
  background: linear-gradient(90deg, #ffd600, #ff9100, #ff3d00);
  color: #ff3d00;
}

.stock-moving-average__legend-swatch--ma-200 {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed, #ec4899);
  color: #7c3aed;
}

.stock-quadratic-confidence {
  background: radial-gradient(circle at 8% 0%, rgba(0, 102, 255, 0.1), transparent 28%), radial-gradient(circle at 92% 0%, rgba(255, 43, 214, 0.095), transparent 28%), linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.stock-quadratic-confidence__context {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 24px 0;
}

.stock-quadratic-confidence__context > div {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.84));
}

.stock-quadratic-confidence__context span,
.stock-quadratic-confidence__context strong {
  display: block;
}

.stock-quadratic-confidence__context span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stock-quadratic-confidence__context strong {
  margin-top: 5px;
  color: #0f172a;
  font-size: 14px;
}

.stock-quadratic-confidence__context-curvature--positive {
  border-color: rgba(0, 200, 83, 0.35) !important;
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(236, 254, 255, 0.92)) !important;
}

.stock-quadratic-confidence__context-curvature--positive strong {
  color: #009944;
}

.stock-quadratic-confidence__context-curvature--negative {
  border-color: rgba(255, 23, 68, 0.35) !important;
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.98), rgba(255, 247, 237, 0.92)) !important;
}

.stock-quadratic-confidence__context-curvature--negative strong {
  color: #e11d48;
}

.stock-quadratic-confidence__status {
  border-width: 1px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.stock-quadratic-confidence__status small {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.stock-quadratic-confidence__status--within_bands {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(236, 254, 255, 0.94));
}

.stock-quadratic-confidence__status--below_lower {
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.98), rgba(255, 247, 237, 0.94));
}

.stock-quadratic-confidence__status--above_upper {
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(236, 254, 255, 0.94));
}

.stock-quadratic-confidence__alert {
  position: relative;
  overflow: hidden;
  border-width: 1px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
}

.stock-quadratic-confidence__alert::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: currentColor;
  content: "";
  opacity: 0.72;
}

.stock-quadratic-confidence__alert-icon {
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px currentColor;
}

.stock-quadratic-confidence__legend {
  gap: 10px;
}

.stock-quadratic-confidence__legend-item {
  border-color: rgba(148, 163, 184, 0.28);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.9));
  box-shadow: 0 9px 22px rgba(15, 23, 42, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.stock-quadratic-confidence__legend-item:hover {
  border-color: rgba(0, 102, 255, 0.3);
  box-shadow: 0 13px 28px rgba(15, 23, 42, 0.075);
  transform: translateY(-2px);
}

.stock-quadratic-confidence__legend-item--coefficient-positive {
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(220, 252, 231, 0.9));
}

.stock-quadratic-confidence__legend-item--coefficient-negative {
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.98), rgba(255, 228, 230, 0.9));
}

.stock-quadratic-confidence__legend-item--coefficient-flat {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.92));
}

.stock-quadratic-confidence__coefficient-symbol {
  box-shadow: 0 0 18px currentColor;
}

@media (max-width: 1180px) {
  .stock-moving-average__legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stock-quadratic-confidence__context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .stock-analysis-chart-panel,
  .stock-adaptive-bands {
    margin: 16px 10px;
    border-radius: 18px;
  }
  .stock-moving-average__legend,
  .stock-quadratic-confidence__context {
    grid-template-columns: 1fr;
  }
  .stock-moving-average__legend {
    margin-right: 16px;
    margin-left: 16px;
  }
  .stock-moving-average__legend-item {
    padding: 11px 12px;
  }
}
/* Shared stock-chart palettes: the chart canvases read these exact values at runtime,
 * and the custom legend swatches use the same variables. This keeps every plotted
 * gradient, point, glow, and legend key visually synchronized. */
.stock-moving-average,
.stock-adaptive-bands,
.stock-quadratic-confidence {
  --stock-chart-actual-start: #ff2bd6;
  --stock-chart-actual-middle: #c026ff;
  --stock-chart-actual-end: #7c3aed;
  --stock-chart-actual-point: #ff2bd6;
  --stock-chart-actual-glow: rgba(255, 43, 214, 0.36);
  --stock-chart-blue-start: #00d4ff;
  --stock-chart-blue-middle: #0066ff;
  --stock-chart-blue-end: #4f46e5;
  --stock-chart-blue-point: #0066ff;
  --stock-chart-blue-glow: rgba(0, 102, 255, 0.32);
  --stock-chart-green-start: #a3ff12;
  --stock-chart-green-middle: #00e676;
  --stock-chart-green-end: #00b8d9;
  --stock-chart-green-point: #00e676;
  --stock-chart-green-glow: rgba(0, 230, 118, 0.3);
  --stock-chart-warm-start: #ffd600;
  --stock-chart-warm-middle: #ff9100;
  --stock-chart-warm-end: #ff3d00;
  --stock-chart-warm-point: #ff3d00;
  --stock-chart-warm-glow: rgba(255, 145, 0, 0.28);
  --stock-chart-lower-start: #ff1744;
  --stock-chart-lower-middle: #ff3d00;
  --stock-chart-lower-end: #ff9100;
  --stock-chart-lower-point: #ff1744;
  --stock-chart-lower-glow: rgba(255, 23, 68, 0.3);
  --stock-chart-violet-start: #8b5cf6;
  --stock-chart-violet-middle: #7c3aed;
  --stock-chart-violet-end: #ec4899;
  --stock-chart-violet-point: #7c3aed;
  --stock-chart-violet-glow: rgba(124, 58, 237, 0.28);
}

.stock-moving-average__legend-swatch,
.stock-quadratic-confidence__legend-swatch {
  --stock-legend-start: #94a3b8;
  --stock-legend-middle: #64748b;
  --stock-legend-end: #475569;
  --stock-legend-point: #64748b;
  --stock-legend-glow: rgba(100, 116, 139, 0.28);
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 42px;
  height: 12px;
  border-radius: 0;
  background: none;
  color: var(--stock-legend-point);
  box-shadow: none;
}

.stock-moving-average__legend-swatch::before,
.stock-quadratic-confidence__legend-swatch::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--stock-legend-start) 0%, var(--stock-legend-middle) 50%, var(--stock-legend-end) 100%);
  box-shadow: 0 0 11px var(--stock-legend-glow);
  content: "";
  transform: translateY(-50%);
}

.stock-moving-average__legend-swatch::after,
.stock-quadratic-confidence__legend-swatch::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border: 2px solid var(--stock-legend-point);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72), 0 0 9px var(--stock-legend-glow);
  content: "";
  transform: translate(-50%, -50%);
}

.stock-moving-average__legend-swatch--price,
.stock-quadratic-confidence__legend-swatch--actual {
  --stock-legend-start: var(--stock-chart-actual-start);
  --stock-legend-middle: var(--stock-chart-actual-middle);
  --stock-legend-end: var(--stock-chart-actual-end);
  --stock-legend-point: var(--stock-chart-actual-point);
  --stock-legend-glow: var(--stock-chart-actual-glow);
}

.stock-moving-average__legend-swatch--ma-20,
.stock-quadratic-confidence__legend-swatch--fit {
  --stock-legend-start: var(--stock-chart-blue-start);
  --stock-legend-middle: var(--stock-chart-blue-middle);
  --stock-legend-end: var(--stock-chart-blue-end);
  --stock-legend-point: var(--stock-chart-blue-point);
  --stock-legend-glow: var(--stock-chart-blue-glow);
}

.stock-moving-average__legend-swatch--ema-20,
.stock-quadratic-confidence__legend-swatch--upper {
  --stock-legend-start: var(--stock-chart-green-start);
  --stock-legend-middle: var(--stock-chart-green-middle);
  --stock-legend-end: var(--stock-chart-green-end);
  --stock-legend-point: var(--stock-chart-green-point);
  --stock-legend-glow: var(--stock-chart-green-glow);
}

.stock-moving-average__legend-swatch--ma-50 {
  --stock-legend-start: var(--stock-chart-warm-start);
  --stock-legend-middle: var(--stock-chart-warm-middle);
  --stock-legend-end: var(--stock-chart-warm-end);
  --stock-legend-point: var(--stock-chart-warm-point);
  --stock-legend-glow: var(--stock-chart-warm-glow);
}

.stock-quadratic-confidence__legend-swatch--lower {
  --stock-legend-start: var(--stock-chart-lower-start);
  --stock-legend-middle: var(--stock-chart-lower-middle);
  --stock-legend-end: var(--stock-chart-lower-end);
  --stock-legend-point: var(--stock-chart-lower-point);
  --stock-legend-glow: var(--stock-chart-lower-glow);
}

.stock-moving-average__legend-swatch--ma-200 {
  --stock-legend-start: var(--stock-chart-violet-start);
  --stock-legend-middle: var(--stock-chart-violet-middle);
  --stock-legend-end: var(--stock-chart-violet-end);
  --stock-legend-point: var(--stock-chart-violet-point);
  --stock-legend-glow: var(--stock-chart-violet-glow);
}

/* The quadratic response is dashed in the canvas, so its legend key is dashed too. */
.stock-quadratic-confidence__legend-swatch--fit::before {
  -webkit-mask-image: repeating-linear-gradient(90deg, #000000 0 10px, transparent 10px 15px);
  mask-image: repeating-linear-gradient(90deg, #000000 0 10px, transparent 10px 15px);
}

.stock-adaptive-bands__legend-swatch {
  --stock-legend-start: #94a3b8;
  --stock-legend-middle: #64748b;
  --stock-legend-end: #475569;
  --stock-legend-point: #64748b;
  --stock-legend-glow: rgba(100, 116, 139, 0.28);
  color: var(--stock-legend-point);
}

.stock-adaptive-bands__legend-swatch::before {
  background: linear-gradient(90deg, var(--stock-legend-start) 0%, var(--stock-legend-middle) 50%, var(--stock-legend-end) 100%);
  box-shadow: 0 0 8px var(--stock-legend-glow);
}

.stock-adaptive-bands__legend-swatch::after {
  border-color: #ffffff;
  background: var(--stock-legend-point);
  box-shadow: 0 0 0 1px var(--stock-legend-point), 0 0 7px var(--stock-legend-glow);
}

.stock-adaptive-bands__legend-swatch--actual {
  --stock-legend-start: var(--stock-chart-actual-start);
  --stock-legend-middle: var(--stock-chart-actual-middle);
  --stock-legend-end: var(--stock-chart-actual-end);
  --stock-legend-point: var(--stock-chart-actual-point);
  --stock-legend-glow: var(--stock-chart-actual-glow);
}

.stock-adaptive-bands__legend-swatch--lower {
  --stock-legend-start: var(--stock-chart-lower-start);
  --stock-legend-middle: var(--stock-chart-lower-middle);
  --stock-legend-end: var(--stock-chart-lower-end);
  --stock-legend-point: var(--stock-chart-lower-point);
  --stock-legend-glow: var(--stock-chart-lower-glow);
}

.stock-adaptive-bands__legend-swatch--upper {
  --stock-legend-start: var(--stock-chart-green-start);
  --stock-legend-middle: var(--stock-chart-green-middle);
  --stock-legend-end: var(--stock-chart-green-end);
  --stock-legend-point: var(--stock-chart-green-point);
  --stock-legend-glow: var(--stock-chart-green-glow);
}

/* Adaptive-band green balance: keep the upper boundary vivid while avoiding the
 * fluorescent lime block that Chart.js can produce when its native dataset fill
 * resolves a gradient too early. The canvas now draws a separate, soft envelope. */
.stock-adaptive-bands {
  --stock-chart-green-start: #4ade80;
  --stock-chart-green-middle: #00c98b;
  --stock-chart-green-end: #06b6d4;
  --stock-chart-green-point: #00c98b;
  --stock-chart-green-glow: rgba(0, 201, 139, 0.28);
  --stock-chart-envelope-upper: rgba(34, 197, 94, 0.13);
  --stock-chart-envelope-middle: rgba(14, 165, 233, 0.055);
  --stock-chart-envelope-lower: rgba(244, 63, 94, 0.09);
}

.stock-adaptive-bands__metric--upper::before {
  background: linear-gradient(90deg, #4ade80, #00c98b, #06b6d4);
}

.stock-polynomial-explorer {
  max-width: 1100px;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stock-polynomial-explorer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #fbfdff;
}
.stock-polynomial-explorer__header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.stock-polynomial-explorer__header p {
  max-width: 760px;
  margin: 7px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.stock-polynomial-explorer__kicker {
  margin-bottom: 6px;
  color: #0891b2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stock-polynomial-explorer__status {
  flex: 0 0 auto;
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  text-align: right;
}
.stock-polynomial-explorer__status span,
.stock-polynomial-explorer__status strong,
.stock-polynomial-explorer__status small {
  display: block;
}
.stock-polynomial-explorer__status span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stock-polynomial-explorer__status strong {
  margin-top: 5px;
  color: #334155;
  font-size: 13px;
}
.stock-polynomial-explorer__status small {
  margin-top: 4px;
  color: #64748b;
  font-size: 10px;
}
.stock-polynomial-explorer__status.is-positive {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.stock-polynomial-explorer__status.is-positive strong {
  color: #047857;
}
.stock-polynomial-explorer__status.is-negative {
  border-color: #fecaca;
  background: #fef2f2;
}
.stock-polynomial-explorer__status.is-negative strong {
  color: #b91c1c;
}
.stock-polynomial-explorer__status.is-flat {
  border-color: #fde68a;
  background: #fffbeb;
}
.stock-polynomial-explorer__status.is-flat strong {
  color: #92400e;
}

.stock-polynomial-explorer__form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f7;
}

.stock-polynomial-explorer__field {
  min-width: 0;
}
.stock-polynomial-explorer__field label {
  display: block;
  margin-bottom: 6px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}
.stock-polynomial-explorer__field select,
.stock-polynomial-explorer__field input {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  outline: none;
}
.stock-polynomial-explorer__field select:focus,
.stock-polynomial-explorer__field input:focus {
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.stock-polynomial-explorer__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #0891b2;
  border-radius: 10px;
  background: #0891b2;
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}
.stock-polynomial-explorer__button:hover, .stock-polynomial-explorer__button:focus {
  border-color: #0e7490;
  background: #0e7490;
  outline: none;
}
.stock-polynomial-explorer__button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.stock-polynomial-explorer__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 0;
}

.stock-polynomial-explorer__metric {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
}
.stock-polynomial-explorer__metric span,
.stock-polynomial-explorer__metric strong,
.stock-polynomial-explorer__metric small {
  display: block;
}
.stock-polynomial-explorer__metric span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stock-polynomial-explorer__metric strong {
  margin-top: 6px;
  overflow: hidden;
  color: #0f172a;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-polynomial-explorer__metric small {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.35;
}
.stock-polynomial-explorer__metric.is-positive strong {
  color: #047857;
}
.stock-polynomial-explorer__metric.is-negative strong {
  color: #b91c1c;
}
.stock-polynomial-explorer__metric.is-flat strong {
  color: #92400e;
}

.stock-polynomial-explorer__equation {
  margin: 12px 20px 0;
  padding: 11px 13px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.stock-polynomial-explorer__chart {
  position: relative;
  height: 390px;
  margin: 14px 20px 18px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
}
.stock-polynomial-explorer__chart canvas {
  max-width: 100%;
}

.stock-polynomial-explorer__loading,
.stock-polynomial-explorer__error {
  position: absolute;
  inset: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.stock-polynomial-explorer.is-loading .stock-polynomial-explorer__loading,
.stock-polynomial-explorer.is-error .stock-polynomial-explorer__error {
  display: flex;
}

.stock-polynomial-explorer__notes {
  display: grid;
  gap: 8px;
  padding: 0 20px 18px;
}

.stock-polynomial-explorer__note {
  padding: 9px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}
.stock-polynomial-explorer__note.is-warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.stock-polynomial-explorer__empty {
  padding: 34px 20px;
  color: #64748b;
  text-align: center;
}
.stock-polynomial-explorer__empty strong,
.stock-polynomial-explorer__empty span {
  display: block;
}
.stock-polynomial-explorer__empty strong {
  color: #334155;
  font-size: 14px;
}
.stock-polynomial-explorer__empty span {
  margin-top: 5px;
  font-size: 12px;
}

@media (max-width: 960px) {
  .stock-polynomial-explorer__form,
  .stock-polynomial-explorer__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .stock-polynomial-explorer {
    margin-right: 0;
    margin-left: 0;
  }
  .stock-polynomial-explorer__header {
    display: block;
    padding: 16px;
  }
  .stock-polynomial-explorer__status {
    margin-top: 12px;
    text-align: left;
  }
  .stock-polynomial-explorer__form,
  .stock-polynomial-explorer__metrics {
    grid-template-columns: 1fr;
    padding-right: 16px;
    padding-left: 16px;
  }
  .stock-polynomial-explorer__button {
    width: 100%;
  }
  .stock-polynomial-explorer__equation,
  .stock-polynomial-explorer__chart {
    margin-right: 16px;
    margin-left: 16px;
  }
  .stock-polynomial-explorer__chart {
    height: 320px;
  }
  .stock-polynomial-explorer__notes {
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* Gside/Propshaft integration. Component cosmetics above are compiled from Mila. */
.stock-mila-canvas { position: relative; width: 100%; min-width: 0; }
.stock-mila-canvas canvas { display: block; max-width: 100%; }
.stock-mila-ranges { max-width: 1480px; margin: 18px auto -8px; justify-content: flex-end; }
.stock-mila-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[data-controller="mila-chart"] [data-series-index] { cursor: pointer; }
[data-controller="mila-chart"] [data-series-index][aria-pressed="false"] { opacity: 0.4; }
[data-controller="mila-chart"] [data-series-index]:focus-visible,
[data-controller="mila-chart"] canvas:focus-visible,
.stock-polynomial-explorer canvas:focus-visible { outline: 2px solid #0891b2; outline-offset: 3px; }
.stock-mila-chart-error { padding: 12px; color: #b91c1c; font-size: 12px; }
.stock-mila-chart-error[hidden] { display: none; }
.stock-polynomial-explorer.is-loading .stock-polynomial-explorer__metrics { opacity: 0.55; }
.stock-polynomial-explorer__field input,
.stock-polynomial-explorer__field select,
.stock-polynomial-explorer__button { font-family: inherit; }
@media (prefers-reduced-motion: reduce) {
  .stock-quadratic-confidence__legend-item { transition: none; }
}
