/* Stock detail page — tabbed ratings UI */

/* API banner */
.detail-api-banner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--accent);
  background: rgba(244,185,66,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.detail-api-banner svg { flex-shrink: 0; }

/* Nav back */
.nav-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
  padding: 6px 10px;
  border-radius: 6px;
}

.nav-back:hover { color: var(--fg); background: var(--bg-surface); }

/* Empty state */
.detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 80px 48px;
}

.detail-empty-inner {
  text-align: center;
}

.detail-empty-ticker {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 48px;
  color: var(--fg-muted);
  opacity: 0.5;
  margin-bottom: 16px;
}

.detail-empty-inner p {
  font-size: 15px;
  color: var(--fg-muted);
  margin-bottom: 24px;
}

.detail-back-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.detail-back-btn:hover { opacity: 0.85; }

/* Detail page layout */
.detail-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 48px 80px;
}

/* Header */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.detail-identity {}

.detail-ticker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.detail-ticker {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1;
}

.detail-company {
  font-size: 18px;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.detail-meta {
  font-size: 13px;
  color: var(--fg-muted);
  opacity: 0.7;
}

.detail-price-block {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.detail-price {
  font-size: 28px;
  font-weight: 600;
  color: var(--fg);
}

.detail-mktcap {
  font-size: 13px;
  color: var(--fg-muted);
}

.detail-overall-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.detail-overall-grade {
  font-size: 16px;
}

/* Tab bar */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 0;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover { background: rgba(255,255,255,0.03); }

.tab-btn.active {
  border-bottom-color: var(--tab-grade-color, var(--accent));
  background: rgba(255,255,255,0.04);
}

.tab-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.2s;
}

.tab-btn.active .tab-label { color: var(--fg); }

.tab-grade {
  font-size: 13px;
  font-weight: 700;
}

/* Tab panels */
.tab-panel {
  display: none;
  padding: 40px 0 32px;
}

.tab-panel.active { display: block; }

/* Grade block */
.panel-grade-block {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-grade-letter {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 72px;
  line-height: 1;
  font-weight: 400;
}

.panel-grade-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-score-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.panel-score-val {
  font-size: 36px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
}

.panel-score-max {
  font-size: 18px;
  font-weight: 400;
  color: var(--fg-muted);
  margin-left: 2px;
}

/* Score bar */
.panel-score-bar {
  margin-bottom: 32px;
}

.panel-bar-track {
  height: 8px;
  background: var(--bg-surface);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.panel-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Section styling */
.panel-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 14px;
}

.panel-breakdown {
  margin-bottom: 32px;
  padding: 20px;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.panel-explanation {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Metrics */
.panel-metrics {
  margin-bottom: 32px;
}

.panel-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.panel-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.panel-metric-label {
  font-size: 11px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel-metric-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
}

/* No data */
.panel-no-data {
  padding: 48px;
  text-align: center;
  font-size: 14px;
  color: var(--fg-muted);
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px dashed var(--border);
}

/* All-dimensions section */
.detail-all-dims {
  padding-top: 40px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.all-dims-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 20px;
}

.all-dims-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.dim-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.dim-summary-card:hover {
  border-color: rgba(244,185,66,0.3);
  background: var(--bg-surface);
}

.dim-summary-grade {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.dim-summary-label {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
  text-align: center;
}

.dim-summary-score {
  font-size: 11px;
  color: var(--fg-muted);
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .detail-page { padding: 0 20px 60px; }
  .detail-api-banner { padding: 12px 20px; }
  .detail-header { flex-direction: column; gap: 20px; padding: 32px 0 24px; }
  .detail-price-block { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .all-dims-grid { grid-template-columns: repeat(3, 1fr); }
  .panel-grade-letter { font-size: 56px; }
  .panel-score-val { font-size: 28px; }
}

@media (max-width: 480px) {
  .all-dims-grid { grid-template-columns: repeat(2, 1fr); }
  .tab-btn { padding: 14px 16px; }
  .panel-metrics-grid { grid-template-columns: 1fr 1fr; }
}