/* Leaderboard page styles — uses site CSS variables for light/dark theme support. */

/* ── Hero ── */
.lb-hero { padding: 2.5rem 0 1.5rem; border-bottom: 1px solid var(--border, #d5d0c8); margin-bottom: 2rem; }
.lb-hero h1 { font-size: 2.2rem; margin: 0.3rem 0 0.5rem; color: var(--text, #1a1a1a); }
.lb-lede { max-width: 65ch; color: var(--muted, #555); line-height: 1.6; font-size: 1.05rem; }
.lb-stats { display: flex; gap: 2.5rem; list-style: none; padding: 1.2rem 0 0; margin: 0; flex-wrap: wrap; }
.lb-stats li { display: flex; flex-direction: column; }
.lb-stats strong { font-size: 1.8rem; color: var(--text, #1a1a1a); }
.lb-stats span { font-size: 0.9rem; color: var(--muted, #555); }

/* ── Sections ── */
.lb-section { margin: 2.5rem 0; }
.lb-section h2 { font-size: 1.6rem; margin: 0.5rem 0; color: var(--text, #1a1a1a); }
.lb-section-desc { color: var(--muted, #555); max-width: 70ch; line-height: 1.6; margin-bottom: 1.2rem; font-size: 1rem; }
.lb-overline, .overline { color: var(--accent, #1e5d83); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Table ── */
.lb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 1rem; color: var(--text, #1a1a1a); }
.lb-table th {
  text-align: left; padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border, #d5d0c8);
  color: var(--muted, #555); font-weight: 700; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap; background: var(--bg-band, #f3efe8);
}
.lb-table th[title] { cursor: help; border-bottom-style: dotted; }
.lb-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-faint, #e8e4dc);
  color: var(--text, #1a1a1a); font-size: 1rem;
  vertical-align: middle;
}
.lb-table tr:hover td { background: var(--accent-soft, #e4eef4); }

/* ── Cell styles ── */
.lb-rank { color: var(--muted, #555); text-align: center; width: 3rem; font-weight: 600; }
.lb-name { font-weight: 600; }
.lb-name a { color: var(--text, #1a1a1a); text-decoration: none; }
.lb-name a:hover { color: var(--accent, #1e5d83); text-decoration: underline; }
.lb-ind, .lb-jur { color: var(--muted, #555); font-size: 0.9rem; }
.lb-count { color: var(--muted, #555); text-align: center; }
.lb-score { white-space: nowrap; color: var(--text, #1a1a1a); font-weight: 500; }
.lb-arr { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; color: var(--text, #1a1a1a); }
.lb-risk { font-variant-numeric: tabular-nums; color: #c0392b; font-weight: 700; white-space: nowrap; }
.lb-pct { font-variant-numeric: tabular-nums; color: var(--muted, #555); white-space: nowrap; }
.lb-src { max-width: 24ch; font-size: 0.85rem; }
.lb-src a { color: var(--muted, #555); text-decoration: none; }
.lb-src a:hover { color: var(--accent, #1e5d83); text-decoration: underline; }
.lb-self {
  display: inline-block; margin-left: 0.4rem; padding: 0.15rem 0.5rem;
  font-size: 0.7rem; background: var(--accent-soft, #e4eef4); color: var(--accent, #1e5d83);
  border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em;
}

/* ── Grade chips ── */
.cc-chip {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 4px;
  font-weight: 700; font-size: 0.85rem; text-align: center; min-width: 1.8rem;
}
.cc-chip-good { background: #e6f9ed; color: #1a7f37; }
.cc-chip-mid  { background: #fef3cd; color: #856404; }
.cc-chip-bad  { background: #fde8e8; color: #c0392b; }

@media (prefers-color-scheme: dark) {
  .cc-chip-good { background: rgba(74,222,128,0.15); color: #4ade80; }
  .cc-chip-mid  { background: rgba(251,191,36,0.15); color: #fbbf24; }
  .cc-chip-bad  { background: rgba(248,113,113,0.15); color: #f87171; }
  .lb-risk { color: #f87171; }
}

/* ── Methodology ── */
.lb-methodology {
  background: var(--bg-band, #f3efe8); padding: 1.8rem; border-radius: 8px;
  border: 1px solid var(--border, #d5d0c8);
}
.lb-methodology h2 { color: var(--text, #1a1a1a); }
.lb-methodology p, .lb-methodology li { color: var(--muted, #555); font-size: 1rem; line-height: 1.7; }
.lb-methodology code {
  background: var(--accent-soft, #e4eef4); padding: 0.2rem 0.5rem;
  border-radius: 3px; font-size: 0.95rem; color: var(--accent, #1e5d83);
}
.lb-methodology ul { line-height: 1.7; }
.lb-note { color: var(--muted, #555); font-size: 0.9rem; margin-top: 1rem; }

/* ── Self-listing form ── */
.lb-submit {
  background: var(--bg-band, #f3efe8); padding: 2rem; border-radius: 8px;
  border: 1px solid var(--border, #d5d0c8);
}
.lb-submit h2 { color: var(--text, #1a1a1a); }
.lb-submit p { color: var(--muted, #555); font-size: 1rem; }
.lb-form { margin-top: 1.5rem; }
.lb-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.lb-form label { display: flex; flex-direction: column; font-size: 0.9rem; color: var(--muted, #555); gap: 0.3rem; }
.lb-form input {
  padding: 0.7rem 0.9rem; background: var(--bg-elev, #fff); border: 1px solid var(--border, #d5d0c8);
  border-radius: 5px; color: var(--text, #1a1a1a); font-size: 1rem;
}
.lb-form input::placeholder { color: var(--muted, #999); }
.lb-form input:focus { outline: none; border-color: var(--accent, #1e5d83); }
.lb-submit-btn {
  padding: 0.8rem 1.8rem; background: var(--accent, #1e5d83); color: var(--accent-ink, #fff);
  border: none; border-radius: 5px; font-weight: 700; cursor: pointer; font-size: 1rem;
}
.lb-submit-btn:hover { opacity: 0.9; }
.lb-submit-btn:disabled { opacity: 0.5; cursor: wait; }
.lb-form-note { color: var(--muted, #555); font-size: 0.85rem; margin-top: 0.8rem; line-height: 1.5; }
.lb-form-msg { margin-top: 0.8rem; font-size: 0.95rem; }
.lb-form-msg.ok { color: #1a7f37; }
.lb-form-msg.err { color: #c0392b; }

@media (prefers-color-scheme: dark) {
  .lb-form-msg.ok { color: #4ade80; }
  .lb-form-msg.err { color: #f87171; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .lb-stats { gap: 1.5rem; }
  .lb-stats strong { font-size: 1.4rem; }
  .lb-form-grid { grid-template-columns: 1fr; }
  .lb-table { font-size: 0.9rem; }
  .lb-table th { font-size: 0.75rem; padding: 0.5rem 0.6rem; }
  .lb-table td { padding: 0.5rem 0.6rem; font-size: 0.9rem; }
}