/* ==========================================================================
   Long Equity: Sector Comparison Tool
   ========================================================================== */

.sc-subtitle {
  margin: 8px auto 0;
  max-width: 760px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text2);
}

.sc-search-input {
  flex: 1;
  width: 100%;
  height: 40px;
  padding: 8px 14px 8px 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sc-search-input:focus {
  border-color: #1C1917;
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08);
}

.sc-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sc-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
}

.sc-fy-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 9999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
}

.sc-sector-match-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  background: #e6f7f3;
  border: 1px solid rgba(52, 181, 157, 0.35);
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #1b7c69;
}

.sc-sync-notice {
  border-radius: 12px;
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
}

/* Colour Key */
.sc-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}

.sc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sc-legend-swatch {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
}

.sc-legend-swatch.is-company {
  background: #34B59D;
}

.sc-legend-swatch.is-peer-sector {
  background: #0F172A;
}

.sc-legend-swatch.is-sector {
  background: #94A3B8;
}

/* Four Bar Charts on One Row */
#sc-workspace-root.rf-workspace {
  max-width: 1680px;
}

.sc-charts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.sc-chart-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px 12px;
  min-width: 0;
}

.sc-chart-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-height: 82px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.sc-chart-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text);
}

.sc-chart-desc {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.38;
  color: var(--text2);
}

.sc-chart-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #e6f7f3;
  border: 1px solid rgba(52, 181, 157, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #1b7c69;
  white-space: nowrap;
}

.sc-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 420px;
}

/* Sector Benchmark Reference Table */
.sc-table-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sc-table-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text);
}

.sc-table-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text2);
}

.sc-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.sc-bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.sc-bench-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text2);
  white-space: nowrap;
}

.sc-bench-table th.sc-sortable-th {
  padding: 0;
}

.sc-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.14s ease, background 0.14s ease;
}

.sc-sort-btn.is-num {
  justify-content: flex-end;
}

.sc-sort-btn:hover {
  color: var(--text);
  background: rgba(28, 25, 23, 0.03);
}

.sc-sortable-th.is-sorted .sc-sort-btn {
  color: #1b7c69;
}

.sc-sort-ind {
  font-size: 11px;
  opacity: 0.45;
}

.sc-sortable-th.is-sorted .sc-sort-ind {
  opacity: 1;
  color: #1b7c69;
}

.sc-bench-table th.num-col,
.sc-bench-table td.num-col {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.sc-bench-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.sc-bench-table tbody tr:last-child td {
  border-bottom: none;
}

.sc-bench-table tbody tr:hover {
  background: #faf9f7;
}

.sc-bench-table tbody tr.is-peer-row {
  background: #f0fdfa;
}

.sc-sector-name {
  font-weight: 700;
  color: var(--text);
}

.sc-constituent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sc-ticker-chip {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text2);
  border-radius: 9999px;
  padding: 2px 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.sc-ticker-chip:hover {
  border-color: #34B59D;
  color: #1b7c69;
  background: #e6f7f3;
}

.sc-ticker-chip.is-active {
  background: #1C1917;
  border-color: #1C1917;
  color: #ffffff;
}

.sc-count-note {
  font-size: 10.5px;
  color: var(--text3);
  margin-left: 4px;
}

.sc-methodology-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text3);
  padding: 0 4px;
}

@media (max-width: 1180px) {
  .sc-charts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .sc-charts-grid {
    grid-template-columns: 1fr;
  }

  .sc-chart-header {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .sc-chart-canvas-wrap {
    height: 360px;
  }

  .sc-bench-table th,
  .sc-bench-table td,
  .sc-sort-btn {
    padding: 8px 10px;
    font-size: 12px;
  }
}
