/* ============================================================
   Stock Analysis Tab — stockanalysis.css
   Dark theme matching AlphaDCF colour palette.
   ============================================================ */

/* ---- Tab background override ---- */
#dbtab-stockanalysis { background: #000 !important; }
#dbtab-stockanalysis .sa-container { background: #000; }

/* ---- Container & Layout ---- */
.sa-container {
  padding: 20px 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  color: #e5e5ea;
  background: #000;
}

/* ---- Search Row ---- */
.sa-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.sa-search-input {
  flex: 1;
  max-width: 340px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #ccc;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.2s;
}
.sa-search-input:focus {
  border-color: #bf5af2;
}
.sa-search-input::placeholder {
  color: #555;
}

.sa-search-btn {
  background: #bf5af2;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  cursor: pointer;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sa-search-btn:hover { opacity: 0.85; }
.sa-search-btn:active { opacity: 0.7; }
.sa-search-btn.loading { opacity: 0.6; pointer-events: none; }

.sa-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sa-spin 0.7s linear infinite;
  display: none;
}
.sa-spinner.active { display: inline-block; }

@keyframes sa-spin {
  to { transform: rotate(360deg); }
}

/* ---- Error message ---- */
.sa-error {
  background: rgba(255,69,58,0.12);
  border: 1px solid rgba(255,69,58,0.25);
  border-radius: 8px;
  color: #ff453a;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 16px;
  display: none;
}
.sa-error.visible { display: flex; align-items: center; gap: 12px; }
.sa-error-retry {
  background: rgba(255,69,58,0.2);
  border: 1px solid rgba(255,69,58,0.4);
  color: #ff6961;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.sa-error-retry:hover { background: rgba(255,69,58,0.35); }

/* ---- Section Card ---- */
.sa-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.sa-section-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* Iter 12AK.9 — unified panel header colour across Stock Analysis (matches other pages). */
  color: #ffffff80;
  margin: 0 0 14px 0;
}

/* ---- Header Strip ---- */
.sa-header-strip {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sa-header-left {
  flex: 1;
  min-width: 200px;
}

.sa-company-name {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #e5e5ea;
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.sa-ticker-badge {
  display: inline-block;
  background: rgba(191,90,242,0.12);
  border: 1px solid rgba(191,90,242,0.3);
  color: #bf5af2;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

.sa-exchange-badge {
  display: inline-block;
  background: rgba(255,255,255,0.06);
  border: 1px solid #2a2a2a;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
}

.sa-sector-industry {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

.sa-header-right {
  text-align: right;
  min-width: 140px;
}

.sa-price-large {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #e5e5ea;
  line-height: 1;
}

.sa-price-change {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}
.sa-price-change.up   { color: #30d158; }
.sa-price-change.down { color: #ff453a; }

.sa-market-cap {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* ---- KPI Grid ---- */
.sa-grid { /* alias */ }
.sa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.sa-kpi-grid-2 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.sa-kpi-card {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}

.sa-kpi-value {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #e5e5ea;
  line-height: 1.1;
}

.sa-kpi-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #555;
  margin-top: 4px;
}

/* ---- 52-Week Range Bar ---- */
.sa-week-range {
  padding: 8px 0 0;
}
.sa-week-range-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 6px;
}
.sa-week-range-track {
  position: relative;
  height: 4px;
  background: #2a2a2a;
  border-radius: 2px;
}
.sa-week-range-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #30d158; /* Iter 12AK.10 — 52-week range bar recoloured to site green */
  border-radius: 2px;
}
.sa-week-range-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: #30d158; /* Iter 12AK.10 — 52-week range dot recoloured to site green */
  border: 2px solid #1a1a1a;
  border-radius: 50%;
}
.sa-week-range-ends {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #888;
  margin-top: 5px;
}

/* ---- Moat Gauge ---- */
.sa-moat-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.sa-moat-gauge-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sa-moat-gauge svg {
  display: block;
}
.sa-moat-score-label {
  /* Iter 12AK.12 — fix faded/unreadable moat label below the donut: bump size, force
     full opacity, lift above the SVG arc, uppercase for clarity against dark panel. */
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  opacity: 1;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.sa-moat-score-label.wide   { color: #30d158; }
.sa-moat-score-label.narrow { color: #ffd60a; }
.sa-moat-score-label.none   { color: #ff453a; }

.sa-moat-breakdown {
  flex: 1;
  min-width: 220px;
}
.sa-moat-row {
  margin-bottom: 9px;
}
.sa-moat-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 3px;
}
.sa-moat-factor-name {
  color: #e5e5ea;
  font-weight: 600;
}
.sa-moat-factor-score {
  color: #888;
}
.sa-moat-note {
  font-size: 10px;
  color: #888;
  margin-bottom: 4px;
}
.sa-factor-bar-track {
  height: 4px;
  background: #2a2a2a;
  border-radius: 2px;
  overflow: hidden;
}
.sa-factor-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
  background: #bf5af2;
}
.sa-factor-bar-fill.zero { background: #2a2a2a; }

/* ---- DCF Selector ---- */
.sa-dcf-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding-bottom: 0;
}
.sa-dcf-tab-btn {
  background: transparent;
  border: none;
  color: #555;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.sa-dcf-tab-btn:hover { color: #aaa; }
.sa-dcf-tab-btn.active {
  background: #bf5af2;
  color: #fff;
}

.sa-dcf-panel {
  display: none;
}
.sa-dcf-panel.active {
  display: block;
}

.sa-dcf-values {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  align-items: start;
}
.sa-dcf-value-block {
  text-align: left;
  padding: 0 16px 0 0;
  border-right: 1px solid #2a2a2a;
}
.sa-dcf-value-block:last-child {
  border-right: none;
  padding-right: 0;
}
.sa-dcf-value-num {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #e5e5ea;
  margin-bottom: 4px;
}
.sa-dcf-value-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  margin-top: 2px;
}
.sa-dcf-upside {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
}
.sa-dcf-upside.up   { color: #30d158; }
.sa-dcf-upside.down { color: #ff453a; }

/* ---- Verdict Badge ---- */
.sa-verdict {
  display: inline-block;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
}
.sa-verdict.undervalued {
  background: rgba(48,209,88,0.15);
  border: 1px solid rgba(48,209,88,0.3);
  color: #30d158;
}
.sa-verdict.fairly-valued {
  background: rgba(255,214,10,0.12);
  border: 1px solid rgba(255,214,10,0.3);
  color: #ffd60a;
}
.sa-verdict.overvalued {
  background: rgba(255,69,58,0.12);
  border: 1px solid rgba(255,69,58,0.3);
  color: #ff453a;
}

/* ---- Analyst Section ---- */
.sa-analyst-layout {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.sa-analyst-left {
  min-width: 160px;
  text-align: center;
}

.sa-rec-badge {
  display: inline-block;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  border-radius: 6px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.sa-rec-badge.strong-buy  { background: rgba(48,209,88,0.15);  border: 1px solid rgba(48,209,88,0.3);  color: #30d158; }
.sa-rec-badge.buy         { background: rgba(48,209,88,0.1);   border: 1px solid rgba(48,209,88,0.25); color: #30d158; }
.sa-rec-badge.hold        { background: rgba(255,214,10,0.12); border: 1px solid rgba(255,214,10,0.3); color: #ffd60a; }
.sa-rec-badge.sell        { background: rgba(255,69,58,0.12);  border: 1px solid rgba(255,69,58,0.3);  color: #ff453a; }
.sa-rec-badge.strong-sell { background: rgba(255,69,58,0.18);  border: 1px solid rgba(255,69,58,0.35); color: #ff453a; }

.sa-analyst-count {
  font-size: 11px;
  color: #888;
}

.sa-analyst-bar-wrap {
  flex: 1;
  min-width: 200px;
}

.sa-analyst-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888;
  margin-bottom: 5px;
}

.sa-analyst-bar {
  position: relative;
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  margin-bottom: 10px;
}

.sa-analyst-bar-range {
  position: absolute;
  height: 100%;
  background: rgba(191,90,242,0.25);
  border-radius: 3px;
}

.sa-analyst-bar-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
}
.sa-analyst-bar-dot.current { background: #e5e5ea; }
.sa-analyst-bar-dot.mean    { background: #bf5af2; }

.sa-analyst-prices {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888;
  margin-top: 3px;
}

/* Upgrades/Downgrades Table */
.sa-upgrades-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 12px;
}
.sa-upgrades-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  padding: 5px 8px 8px;
  border-bottom: 1px solid #2a2a2a;
}
.sa-upgrades-table td {
  padding: 7px 8px;
  color: #e5e5ea;
  border-bottom: 1px solid rgba(42,42,42,0.5);
}
.sa-upgrades-table tr:last-child td { border-bottom: none; }

.sa-action-upgrade   { color: #30d158; font-weight: 600; }
.sa-action-downgrade { color: #ff453a; font-weight: 600; }
.sa-action-maintain  { color: #888; font-weight: 600; }
.sa-action-init      { color: #ffd60a; font-weight: 600; }

/* ---- Charts Section ---- */
.sa-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.sa-charts-grid-wide {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.sa-chart-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 16px;
}

.sa-chart-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff80; /* Iter 12AK.9 — unified panel header colour */
  margin: 0 0 12px 0;
}

.sa-chart-canvas-wrap {
  position: relative;
  height: 180px;
}

/* ---- Balance Sheet ---- */
.sa-bs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.sa-bs-bar-section {
  margin-top: 8px;
}
.sa-bs-bars {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  height: 80px;
}
.sa-bs-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.sa-bs-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}
.sa-bs-bar.assets      { background: rgba(10,132,255,0.5); }
.sa-bs-bar.liabilities { background: rgba(255,69,58,0.5); }
.sa-bs-bar.equity      { background: rgba(48,209,88,0.4); }
.sa-bs-bar-label {
  font-size: 10px;
  color: #888;
  text-align: center;
}
.sa-bs-bar-value {
  font-size: 10px;
  font-weight: 700;
  color: #e5e5ea;
  text-align: center;
}

/* ---- Bear/Bull Grid ---- */
.sa-bull-bear-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.sa-bear-card {
  background: rgba(255,69,58,0.06);
  border: 1px solid rgba(255,69,58,0.2);
  border-radius: 10px;
  padding: 16px;
}
.sa-bull-card {
  background: rgba(48,209,88,0.06);
  border: 1px solid rgba(48,209,88,0.2);
  border-radius: 10px;
  padding: 16px;
}

.sa-bear-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ff453a;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sa-bull-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #30d158;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sa-bear-text, .sa-bull-text {
  font-size: 12px;
  line-height: 1.6;
  color: #e5e5ea;
}

.sa-ai-verdict-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #2a2a2a;
  font-size: 12px;
  color: #888;
}

.sa-ai-verdict-badge {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}
.sa-ai-verdict-badge.buy,
.sa-ai-verdict-badge.strong-buy  { background: rgba(48,209,88,0.15);  color: #30d158; border: 1px solid rgba(48,209,88,0.3); }
.sa-ai-verdict-badge.hold        { background: rgba(255,214,10,0.12); color: #ffd60a; border: 1px solid rgba(255,214,10,0.3); }
.sa-ai-verdict-badge.sell,
.sa-ai-verdict-badge.caution,
.sa-ai-verdict-badge.strong-sell { background: rgba(255,69,58,0.12);  color: #ff453a; border: 1px solid rgba(255,69,58,0.3); }

.sa-ai-confidence {
  font-size: 11px;
  color: #888;
}

/* ---- News Items ---- */
.sa-news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sa-news-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s;
}
.sa-news-item:hover {
  border-color: rgba(191,90,242,0.3);
}

.sa-news-thumb {
  width: 52px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #2a2a2a;
}

.sa-news-body {
  flex: 1;
  min-width: 0;
}

.sa-news-title {
  font-size: 12px;
  font-weight: 600;
  color: #e5e5ea;
  line-height: 1.4;
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sa-news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #888;
}

.sa-sentiment-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
}
.sa-sentiment-badge.bullish {
  background: rgba(48,209,88,0.15);
  color: #30d158;
  border: 1px solid rgba(48,209,88,0.25);
}
.sa-sentiment-badge.bearish {
  background: rgba(255,69,58,0.12);
  color: #ff453a;
  border: 1px solid rgba(255,69,58,0.25);
}
.sa-sentiment-badge.neutral {
  background: rgba(255,255,255,0.06);
  color: #888;
  border: 1px solid #2a2a2a;
}

/* ---- Skeleton Loading ---- */
@keyframes sa-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.sa-skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, rgba(255,255,255,0.03) 50%, #1a1a1a 75%);
  background-size: 600px 100%;
  animation: sa-shimmer 1.4s infinite linear;
  border-radius: 4px;
  color: transparent !important;
}

.sa-skeleton-text {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.sa-skeleton-text.wide { width: 70%; }
.sa-skeleton-text.short { width: 35%; }
.sa-skeleton-block {
  border-radius: 8px;
}

/* ---- Analyst bar rating breakdown ---- */
.sa-rating-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 11px;
}
.sa-rating-bar-label {
  width: 70px;
  color: #888;
  text-align: right;
  flex-shrink: 0;
}
.sa-rating-bar-track {
  flex: 1;
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  overflow: hidden;
}
.sa-rating-bar-fill.strong-buy  { background: #30d158; }
.sa-rating-bar-fill.buy         { background: #30d158; }
.sa-rating-bar-fill.hold        { background: #ffd60a; }
.sa-rating-bar-fill.sell        { background: #ff453a; }
.sa-rating-bar-fill.strong-sell { background: #ff453a; }
.sa-rating-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.sa-rating-bar-count {
  width: 24px;
  text-align: right;
  color: #e5e5ea;
  font-weight: 600;
  flex-shrink: 0;
}

/* ---- Initially hidden content ---- */
#sa-results { display: none; }
#sa-results.visible { display: block; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sa-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .sa-kpi-grid-2 {
    grid-template-columns: repeat(3, 1fr);
  }
  .sa-charts-grid {
    grid-template-columns: 1fr;
  }
  .sa-charts-grid-wide {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .sa-container {
    padding: 14px 14px 32px;
  }
  .sa-kpi-grid,
  .sa-kpi-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .sa-charts-grid-wide {
    grid-template-columns: 1fr;
  }
  .sa-bull-bear-grid {
    grid-template-columns: 1fr;
  }
  .sa-header-strip {
    flex-direction: column;
  }
  .sa-header-right {
    text-align: left;
  }
  .sa-price-large {
    font-size: 22px;
  }
  .sa-bs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sa-moat-layout {
    flex-direction: column;
  }
  .sa-analyst-layout {
    flex-direction: column;
  }
}

/* ---- Bullet points for bear/bull ---- */
.sa-bullet {
  display: flex;
  gap: 6px;
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 5px;
  color: #e5e5ea;
}
.sa-bullet-dot {
  flex-shrink: 0;
  color: #555;
}

/* ---- Moat qualitative paragraph ---- */
.sa-moat-qualitative {
  font-size: 12px;
  color: #888;
  line-height: 1.6;
  border-top: 1px solid #2a2a2a;
  padding-top: 12px;
  margin-top: 14px;
}

/* ---- DCF link row ---- */
.sa-dcf-link-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #2a2a2a;
}
.sa-dcf-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #bf5af2;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.sa-dcf-link:hover { opacity: 1; }

/* ============================================================
   Enhancement Pack — Health Scores, Peers, Share Count, Insider
   ============================================================ */

/* ---- Health Scores Grid ---- */
.sa-health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 14px;
}
@media (max-width: 900px) { .sa-health-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sa-health-grid { grid-template-columns: 1fr; } }

.sa-health-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 14px;
}
.sa-health-block-title {
  font-family: 'Inter Tight', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff80; /* Iter 12AK.9 — unified panel header colour */
  margin-bottom: 10px;
}

/* Piotroski */
.sa-piotroski-score-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.sa-piotroski-num { font-family: 'Inter Tight', sans-serif; font-size: 26px; font-weight: 800; }
.sa-piotroski-num.strong   { color: #30d158; }
.sa-piotroski-num.moderate { color: #ffd60a; }
.sa-piotroski-num.weak     { color: #ff453a; }
.sa-piotroski-label { font-size: 12px; font-weight: 600; }
.sa-piotroski-label.strong   { color: #30d158; }
.sa-piotroski-label.moderate { color: #ffd60a; }
.sa-piotroski-label.weak     { color: #ff453a; }
.sa-piotroski-dots { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.sa-pio-dot { width: 12px; height: 12px; border-radius: 50%; }
.sa-pio-dot.pass { background: #30d158; }
.sa-pio-dot.fail { background: rgba(255,255,255,0.08); border: 1px solid #2a2a2a; }
.sa-piotroski-checks { display: flex; flex-direction: column; gap: 6px; }
.sa-pio-group-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: #ffffff80; margin-bottom: 3px; margin-top: 4px; } /* Iter 12AK.9 — unified panel header colour */
.sa-pio-check { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.sa-pio-icon { font-size: 10px; flex-shrink: 0; width: 14px; }
.sa-pio-check.pass .sa-pio-icon { color: #30d158; }
.sa-pio-check.fail .sa-pio-icon { color: #ff453a; }
.sa-pio-check.fail { color: #555; }

/* Earnings Quality */
.sa-eq-grade-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.sa-eq-grade { font-family: 'Inter Tight', sans-serif; font-size: 36px; font-weight: 900; }
.sa-eq-grade.grade-A { color: #30d158; }
.sa-eq-grade.grade-B { color: #30d158; }
.sa-eq-grade.grade-C { color: #ffd60a; }
.sa-eq-grade.grade-D { color: #f2994a; }
.sa-eq-grade.grade-F { color: #ff453a; }
.sa-eq-label { font-size: 12px; font-weight: 600; color: #888; }
.sa-eq-metric { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 11px; }
.sa-eq-metric:last-child { border-bottom: none; }
.sa-eq-metric-label { color: #888; }
.sa-eq-metric-val { font-weight: 600; }
.sa-eq-metric-val.good { color: #30d158; }
.sa-eq-metric-val.bad  { color: #ff453a; }

/* Earnings Surprise Streak */
.sa-streak-summary { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sa-streak-num.good     { color: #30d158; }
.sa-streak-num.moderate { color: #ffd60a; }
.sa-streak-current { color: #888; font-size: 11px; font-weight: 400; }
.sa-streak-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.sa-surprise-dot { width: 16px; height: 16px; border-radius: 3px; }
.sa-surprise-dot.beat   { background: rgba(48,209,88,0.7); }
.sa-surprise-dot.miss   { background: rgba(255,69,58,0.6); }
.sa-surprise-dot.inline { background: rgba(255,255,255,0.15); }

/* ---- Peer Comparison Table ---- */
.sa-peers-table-wrap { overflow-x: auto; }
.sa-peers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.sa-peers-table th {
  text-align: right;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  border-bottom: 1px solid #2a2a2a;
  white-space: nowrap;
}
.sa-peers-table th:first-child { text-align: left; }
.sa-peers-table td {
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(42,42,42,0.5);
  color: #e5e5ea;
  white-space: nowrap;
}
.sa-peers-table td:first-child { text-align: left; }
.sa-peers-table tr:last-child td { border-bottom: none; }
.sa-peers-table tr.sa-peer-current td { background: rgba(191,90,242,0.05); }
.sa-peers-table tr:hover td { background: rgba(255,255,255,0.02); }
.sa-peers-table td.positive { color: #30d158; }
.sa-peers-table td.negative { color: #ff453a; }
.sa-moat-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.sa-moat-badge.moat-wide   { background: rgba(48,209,88,0.15);  color: #30d158; }
.sa-moat-badge.moat-narrow { background: rgba(255,214,10,0.15); color: #ffd60a; }
.sa-moat-badge.moat-none   { background: rgba(255,69,58,0.1);   color: #ff453a; }

/* ---- Share Count / Buyback ---- */
.sa-trend-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.sa-trend-badge.buyback  { background: rgba(48,209,88,0.15);  color: #30d158; }
.sa-trend-badge.diluting { background: rgba(255,69,58,0.12);  color: #ff453a; }
.sa-trend-badge.neutral  { background: rgba(255,255,255,0.06); color: #888; }
.sa-buyback-yield { font-size: 11px; color: #888; margin-top: 6px; text-align: center; }

/* ---- Insider Ownership ---- */
.sa-insider-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.sa-insider-badge.buying  { background: rgba(48,209,88,0.15);  color: #30d158; }
.sa-insider-badge.selling { background: rgba(255,69,58,0.12);  color: #ff453a; }
.sa-insider-badge.neutral { background: rgba(255,255,255,0.06); color: #888; }
.sa-insider-kpis { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.sa-insider-kpi { text-align: center; min-width: 70px; }
.sa-kpi-value.buying  { color: #30d158; }
.sa-kpi-value.selling { color: #ff453a; }
.sa-insider-table-wrap { overflow-x: auto; }
.sa-insider-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.sa-insider-table th { text-align: left; padding: 5px 8px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #555; border-bottom: 1px solid #2a2a2a; }
.sa-insider-table td { padding: 6px 8px; border-bottom: 1px solid rgba(42,42,42,0.4); color: #e5e5ea; }
.sa-insider-table tr:last-child td { border-bottom: none; }

/* ---- Company identity: logo left of name+ticker ---- */
.sa-header-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sa-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---- Company Logo ---- */
.sa-company-logo-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.sa-company-logo {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: contain;
  background: #111;
  border: 1px solid #2a2a2a;
  padding: 6px;
}
.sa-company-logo-fallback {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: #111;
  border: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter Tight', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #bf5af2;
  flex-shrink: 0;
}

/* ============================================================
   Info Icon & Tooltip System
   ============================================================ */

/* Title rows — flex to place icon next to title */
.sa-section-title-row,
.sa-chart-title-row,
.sa-health-block-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Info button */
.sa-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: #555;
  flex-shrink: 0;
  line-height: 0;
  transition: color 0.15s;
  border-radius: 50%;
}
.sa-info-btn:hover { color: #bf5af2; }
.sa-info-btn:focus-visible { outline: 1px solid #bf5af2; }

/* Info icon SVG */
.sa-info-icon {
  display: block;
}

/* Tooltip */
.sa-tooltip {
  position: fixed;
  z-index: 99999;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 1.65;
  color: #e0e0e0;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(191,90,242,0.08);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  display: none;
}
.sa-tooltip.visible {
  display: block;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

/* Subtle purple top border accent */
.sa-tooltip::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #bf5af2 40%, #bf5af2 60%, transparent);
  border-radius: 1px;
}

/* Tooltips use position:fixed (moved to body on open) — no relative needed on cards */

/* ============================================================
   DCF — 7-Model Layout
   ============================================================ */
.sa-dcf-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.sa-dcf-left {
  flex-shrink: 0;
  width: 420px;
  min-width: 0;
}
.sa-dcf-right {
  flex: 1;
  min-width: 240px;
}
.sa-dcf-right-wide {
  flex: 1;
  min-width: 240px;
}
@media (max-width: 1050px) {
  .sa-dcf-layout { flex-direction: column; }
  .sa-dcf-right,
  .sa-dcf-right-wide { width: 100%; }
}

/* Tab group label */

.sa-dcf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  align-items: center;
}
.sa-dcf-tab-btn {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #888;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.sa-dcf-tab-btn:hover { color: #e5e5ea; border-color: #444; }
.sa-dcf-tab-btn.active { background: #bf5af2; border-color: #bf5af2; color: #fff; }
.sa-dcf-tab-btn.na { opacity: 0.45; }

/* Scenario breakdown */
.sa-dcf-scenario-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #2a2a2a;
}
.sa-dcf-scenario-item { text-align: center; flex: 1; }
.sa-dcf-scenario-val { font-family: 'Inter Tight', sans-serif; font-size: 15px; font-weight: 700; }
.sa-dcf-scenario-lbl { font-size: 10px; color: #555; margin-top: 2px; }
.sa-dcf-scenario-item.bull .sa-dcf-scenario-val { color: #30d158; }
.sa-dcf-scenario-item.base .sa-dcf-scenario-val { color: #e5e5ea; }
.sa-dcf-scenario-item.bear .sa-dcf-scenario-val { color: #ff453a; }

/* N/A panel */
.sa-dcf-na {
  font-size: 12px;
  color: #555;
  padding: 12px 0;
  line-height: 1.6;
}

/* Explanation panel */
.sa-dcf-explain {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px;
}
.sa-dcf-explain-title {
  font-family: 'Inter Tight', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #bf5af2;
  margin-bottom: 10px;
  line-height: 1.3;
}
.sa-dcf-explain-body {
  font-size: 11px;
  color: #888;
  line-height: 1.7;
  margin-bottom: 12px;
}
.sa-dcf-explain-inputs {
  border-top: 1px solid #2a2a2a;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sa-dcf-explain-inp {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Piotroski check with note */
.sa-pio-check { align-items: flex-start !important; }
.sa-pio-check-text { display: flex; flex-direction: column; gap: 1px; }
.sa-pio-check-name { font-size: 11px; }
.sa-pio-check-note { font-size: 10px; color: #555; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }

/* SEC Form 4 link in insider table */
.sa-form4-link {
  color: var(--accent, #4F98A3);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}
.sa-form4-link:hover { text-decoration: underline; }

/* ============================================================
   MI Rank Section — Stock Analysis
   ============================================================ */
.sa-mi-rank-card { margin-bottom: 16px; }
.mi-sa-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-top: 12px;
}
.mi-sa-badge-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.mi-sa-big-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 22px;
  border-radius: 10px;
  text-align: center;
}
.mi-sa-icon { font-size: 22px; line-height: 1; }
.mi-sa-rank-num { font-size: 20px; font-weight: 800; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: 0.04em; }
.mi-sa-rank-label { font-size: 11px; font-weight: 600; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.06em; }
.mi-sa-change { font-size: 11px; font-weight: 700; }
.mi-sa-change.up { color: #22c55e; }
.mi-sa-change.down { color: #C24A4A; }
.mi-sa-percentile { font-size: 11px; color: #888; }
.mi-sa-percentile strong { color: #ccc; }
.mi-sector-ctx { font-size: 11px; color: #666; text-align: center; }
.mi-sector-label { color: #888; }
.mi-sector-pos { color: #aaa; font-weight: 600; }

.mi-sa-factors { flex: 1; min-width: 0; }
.mi-sa-factors-title { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; font-weight: 600; }
.mi-factor-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.mi-factor-label { width: 110px; font-size: 11px; color: #aaa; flex-shrink: 0; }
.mi-factor-weight { color: #555; font-size: 10px; }
.mi-factor-bar-wrap {
  flex: 1;
  height: 8px;
  background: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
}
.mi-factor-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.mi-factor-val { width: 28px; text-align: right; font-size: 11px; color: #888; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 600; }

@media (max-width: 600px) {
  .mi-sa-layout { flex-direction: column; align-items: stretch; }
  .mi-sa-badge-area { flex-direction: row; align-items: center; gap: 12px; }
  .mi-sa-big-badge { flex-direction: row; padding: 10px 16px; gap: 8px; }
  .mi-factor-label { width: 80px; }
}

/* ============================================================
   Iter 12AK — Stock Analysis redesign
   Statistics TTM block, Latest Insights chart grid,
   compact Moat + Analyst panels
   ============================================================ */

/* ---- Statistics (TTM) grouped tables ---- */
.sa-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.sa-stats-col { display: flex; flex-direction: column; }
.sa-stats-col-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #ffffff80;
  margin: 0 0 8px;
  font-weight: 600;
}
.sa-stats-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sa-stats-table tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.sa-stats-table tr:last-child { border-bottom: none; }
.sa-stats-table td { padding: 6px 0; line-height: 1.35; }
.sa-stat-k { color: #888; }
.sa-stat-v {
  color: #e5e5ea;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ---- Section divider between Header/DCF row and Latest Insights ---- */
.sa-section-divider {
  border: none;
  height: 2px;
  background: #e5e5e0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
  margin: 24px 0;
}

/* ---- Latest Insights header + toggle pills ---- */
.sa-li-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.sa-li-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff80; /* Iter 12AK.9 — unified panel header colour */
  font-family: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  letter-spacing: -0.01em;
}
.sa-li-toggle {
  display: flex;
  gap: 4px;
  background: #1d1d22;
  border: 1px solid #2a2a30;
  border-radius: 20px;
  padding: 2px;
}
.sa-li-pill {
  background: transparent;
  border: none;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.sa-li-pill:hover { color: #cdcdcd; }
.sa-li-pill.active { background: #1aa978; color: #fff; }
.sa-li-pill.active:hover { color: #fff; }

/* ---- 14-chart 4-up grid ---- */
.sa-li-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.sa-li-grid .sa-chart-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
}
/* Iter 12AK.2 — chart card header: title left, expand button right, divider below */
.sa-li-grid .sa-chart-title {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 10px;
  padding: 0 30px 8px 0; /* right-pad so the absolute button doesn't overlap text */
  font-weight: 600;
  border-bottom: 1px solid #2a2a2a;
  min-height: 22px;
  line-height: 14px;
  display: flex;
  align-items: center;
}
.sa-li-grid .sa-chart-canvas-wrap {
  position: relative;
  height: 150px;
  flex: 1 1 auto;
}
.sa-li-grid canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 1100px) {
  .sa-li-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .sa-li-grid { grid-template-columns: 1fr; }
  .sa-stats-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ---- Compact Moat panel (Iter 12AK) ---- */
.sa-moat-compact .sa-moat-layout { gap: 14px; }
.sa-moat-compact .sa-moat-gauge svg {
  transform: scale(0.78);
  transform-origin: top center;
  /* Iter 12AK.13 — collapse the empty whitespace the scale leaves behind so the
     label below the donut sits closer and is never clipped by the panel. */
  margin-bottom: -22px;
}
.sa-moat-compact .sa-moat-gauge {
  /* Iter 12AK.13 — was max-height:130px + overflow:hidden, which clipped the
     “WIDE MOAT” / “NARROW MOAT” / “NO MOAT” label below the scaled donut.
     Drop the clip and let the column grow naturally. */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Compact Analyst panel (Iter 12AK) ---- */
.sa-analyst-compact .sa-analyst-layout { gap: 14px; }
.sa-analyst-compact .sa-upgrades-table tr:nth-child(n+5) { display: none; }

/* ============================================================
   Iter 12AK.1 — Chart card maximise button + 90vw modal overlay
   ============================================================ */
.sa-chart-card { position: relative; } /* anchor for the maximise button */

.sa-chart-maximize-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(29,29,34,0.6);
  border: 1px solid #2a2a30;
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.sa-chart-maximize-btn:hover {
  color: #e5e5ea;
  background: #1d1d22;
  border-color: #3a3a42;
}
.sa-chart-maximize-btn:focus-visible {
  outline: 2px solid #1aa978;
  outline-offset: 1px;
}

/* Modal backdrop */
.sa-chart-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sa-chart-modal-fade 140ms ease-out;
}
@keyframes sa-chart-modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal panel — 90% of viewport, centred */
.sa-chart-modal-panel {
  position: relative;
  width: 90vw;
  height: 90vh;
  max-width: 90vw;
  max-height: 90vh;
  background: #0e0e10;
  border: 1px solid #2a2a30;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sa-chart-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #2a2a30;
  border-radius: 6px;
  color: #888;
  cursor: pointer;
  padding: 0;
  z-index: 3;
}
.sa-chart-modal-close:hover { color: #e5e5ea; background: #1d1d22; }

/* Iter 12AK.7 — cloned modal chart: independent canvas inside the panel.
   Replaces the old .sa-chart-card-maximized DOM-move approach. */
.sa-chart-modal-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff80; /* Iter 12AK.9 — unified panel header colour */
  margin: 0 0 12px;
  padding: 0 36px 10px 0;
  border-bottom: 1px solid #2a2a2a;
}
.sa-chart-modal-canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.sa-chart-modal-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Prevent background scroll while modal open */
body.sa-no-scroll { overflow: hidden; }
