/* ── Player Hub styles (base theme/layout from tv.css) ── */
.container { max-width: 600px; width: 100%; margin: 0 auto; flex: 1; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; margin-bottom: 1rem; }

/* Auth panel */
.auth-tabs { display: none; } /* Legacy — no longer rendered */
.auth-tab { flex: 1; padding: 0.65rem 0.5rem; background: var(--bg); border: none; color: var(--text-muted); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s; }
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-tab:first-child { border-radius: 9px 0 0 9px; }
.auth-tab:last-child  { border-radius: 0 9px 9px 0; }

/* Unified resolve flow */
.resolve-back-btn { margin-bottom: 1rem; }
.resolve-found-msg { font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.resolve-matches-list { list-style: none; padding: 0; margin: 0 0 1.25rem 0; }
.resolve-match-item { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; padding: 0.55rem 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.4rem; font-size: 0.88rem; }
.resolve-match-type { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); white-space: nowrap; }
.resolve-match-name { font-weight: 600; color: var(--text); }
.resolve-match-player { color: var(--text-muted); font-size: 0.84rem; }
.resolve-create-prompt { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1rem; }

/* Passphrase reveal box */
.passphrase-reveal-box {
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.passphrase-text {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  word-break: break-all;
}
.passphrase-hidden { filter: blur(5px); user-select: none; }

/* Compact passphrase strip */
.passphrase-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.passphrase-strip-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.passphrase-strip-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  word-break: break-all;
  flex: 1;
}

.passphrase-strip-success {
  width: 100%;
}

/* Profile bar */
.profile-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-bar-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.profile-bar-name {
  font-weight: 700;
  font-size: 1.15rem;
  word-break: break-word;
}

.profile-bar-name-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.profile-bar-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.profile-elo-row { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-left: auto; }

.elo-chip {
  font-size: 0.75rem;
  border-radius: 6px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
}

.elo-chip--rated {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--accent, #0078d4);
}

.elo-chip--rated strong {
  font-weight: 700;
}

.elo-chip-count {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profile-bar-meta { font-size: 0.8rem; color: var(--text-muted); }

/* Compact global stats scope card (Global / Community / Club) */
.player-scope-sentinel {
  /* Invisible 1px sentinel observed by IntersectionObserver to detect when
     the sticky scope card has scrolled past the viewport top. */
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.player-scope-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  margin: 0 0 0.8rem;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: padding 0.18s ease, box-shadow 0.18s ease, border-radius 0.18s ease;
}

/* When the sentinel above has scrolled out of view, the card is pinned.
   Collapse to head-only and add a subtle elevation so it visibly floats. */
.player-scope-card.is-stuck {
  padding: 0.4rem 0.65rem;
  border-radius: 0 0 10px 10px;
  border-top-color: transparent;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.25);
  background: color-mix(in srgb, var(--surface) 96%, var(--accent) 4%);
}

.player-scope-card.is-stuck .player-scope-clubs,
.player-scope-card.is-stuck .player-scope-communities {
  display: none;
}

.player-scope-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.player-scope-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.player-scope-select {
  margin-left: auto;
  padding: 0.2rem 0.45rem;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  max-width: 75%;
  cursor: pointer;
}

.player-scope-clubs {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.player-scope-communities {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.player-scope-community-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
}

.player-scope-community-tag.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}

.player-scope-club-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--text);
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0.16rem 0.48rem;
  cursor: pointer;
}

.player-scope-club-tag.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.player-scope-club-name {
  font-weight: 700;
}

.player-scope-club-community {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.75;
}

.player-scope-club-stats {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Inline badge that shows the active scope inside scoped section headings
   (career stats, best results, ELO ratings) so the filter context stays
   visible even when the sticky bar is collapsed. */
.scope-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.08rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 999px;
  vertical-align: middle;
}

.profile-email-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.profile-verify-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.badge-verify-pending {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.player-profile-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.player-logout-btn {
  margin-left: auto;
}

.player-verification-card {
  margin-top: 0.15rem;
}

.player-verification-title {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.player-verification-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* Section headings */
.section-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 1.25rem 0 0.65rem;
}

/* Entry cards */
.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.65rem;
}
.entry-card.finished { opacity: 0.75; }
.entry-card-info { min-width: 0; }
.entry-card-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.entry-card-unlink-inline {
  background: none;
  border: none;
  color: var(--red, #ef4444);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.4rem;
  min-height: 2rem;
  cursor: pointer;
  opacity: 0.5;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  transition: opacity 0.15s;
}
.entry-card-unlink-inline:hover { opacity: 1; }
.entry-card-path-row { margin-top: 0.55rem; }
.entry-card-path-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  min-height: 2rem;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.entry-card-path-btn:hover { border-color: var(--accent); color: var(--accent); }
.entry-card-name--link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.entry-card-name--link:hover { text-decoration: underline; }
.entry-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-card-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }
.entry-card-stats { font-size: 0.78rem; color: var(--accent); font-weight: 600; margin-top: 0.2rem; letter-spacing: 0.01em; }
.entry-card-social { font-size: 0.73rem; color: var(--text-muted); margin-top: 0.22rem; line-height: 1.45; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; }
.entry-card-social em { color: var(--accent); font-style: normal; font-weight: 600; }
.entry-card-social-sep { white-space: pre; }
@media (max-width: 480px) {
  .entry-card-social { flex-direction: column; gap: 0.15rem; }
  .entry-card-social-sep { display: none; }
}
.entry-card-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }

.entry-path-panel {
  margin-top: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.entry-path-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.entry-path-list {
  display: flex;
  flex-direction: column;
}

.entry-path-row {
  position: relative;
  padding: 0.55rem 0.65rem 0.55rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  line-height: 1.35;
}

.entry-path-row:first-child {
  border-top: 0;
}

.entry-path-row::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.7rem;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.entry-path-row.is-sitout {
  opacity: 0.55;
  font-style: italic;
}
.entry-path-row.is-sitout::before {
  background: var(--text-muted);
}
.entry-path-row--up::before   { background: var(--green); }
.entry-path-row--down::before { background: var(--red); }
.entry-path-row--same::before { background: var(--text-muted); }
.entry-path-row--best {
  background: color-mix(in srgb, var(--green) 9%, transparent);
}

.entry-path-head {
  margin-bottom: 0.2rem;
}

.entry-path-head-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
}

.entry-path-round {
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-path-eliminated-badge {
  display: inline-flex;
  margin-left: 0.35rem;
  padding: 0.02rem 0.35rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--red) 45%, var(--border));
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.entry-path-chips {
  display: flex;
  gap: 0.25rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.entry-path-chips--perf {
  justify-content: center;
}

.entry-path-chips--rank {
  justify-content: flex-end;
}

.entry-path-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
  color: var(--text-muted);
  background: var(--surface);
}

.entry-path-chip strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}

.entry-path-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.entry-path-team {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-path-side-label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text-muted) 88%, var(--accent));
  font-weight: 700;
}

.entry-path-team-names {
  display: flex;
  align-items: center;
  gap: 0.02rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-path-team-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-path-team-name + .entry-path-team-name::before {
  content: ", ";
  color: var(--text-muted);
}

.entry-path-team--opponents {
  text-align: left;
  justify-self: start;
}

.entry-path-team--player {
  text-align: right;
  justify-self: end;
}

.entry-path-score-center {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}

/* Points delta inside chip */
.entry-path-pts-delta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
}

/* Rank trend arrow inside chip */
.entry-path-rank-arrow {
  font-size: 0.72rem;
  font-weight: 700;
}
.entry-path-rank-arrow--up   { color: var(--green); }
.entry-path-rank-arrow--down { color: var(--red); }
.entry-path-rank-arrow--same { color: var(--text-muted); }

/* Summary bar */
.entry-path-summary {
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.entry-path-summary-delta {
  font-weight: 700;
}
.entry-path-summary-delta--up   { color: var(--green); }
.entry-path-summary-delta--down { color: var(--red); }
.entry-path-summary-delta--same { color: var(--text-muted); }

.entry-path-meta {
  color: var(--text-muted);
}

.entry-path-meta-block {
  display: flex;
  gap: 0.35rem;
}

.entry-path-label {
  min-width: 4.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.entry-path-empty {
  padding: 0.6rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Badges */
.badge { display: inline-block; font-size: 0.72rem; padding: 0.12rem 0.45rem; border-radius: 999px; font-weight: 700; }
.badge-sport  { background: var(--accent); color: var(--color-on-primary); }
.badge-type   { background: var(--surface2, var(--border)); color: var(--text-muted); }
.badge-active { background: var(--green); color: var(--color-on-success); }
.badge-finished { background: var(--border); color: var(--text-muted); }

/* Empty states */
.empty-state { text-align: center; color: var(--text-muted); font-size: 0.88rem; padding: 1.5rem 0; }

/* Global career stats card */
.global-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}
.global-stats-grid > .global-stats-cell {
  flex: 1 1 58px;
  min-width: 58px;
}
.global-stats-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0.3rem 0.15rem;
}
.global-stats-cell {
  background: var(--bg);
  border-radius: 8px;
  padding: 0.6rem 0.3rem;
  text-align: center;
}
.global-stats-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
}
.global-stats-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.global-stats-tournament {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  margin: 0.15rem auto 0;
  opacity: 0.7;
  text-align: center;
  width: 100%;
}

/* Best results — trophy list */
.best-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.best-results-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}
.best-results-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
}
.best-results-detail {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.35rem;
}
.best-results-value {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}
.best-results-tournament {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.best-results-tag {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  white-space: nowrap;
}

.global-stats-sport-section {
  margin-bottom: 0.6rem;
  padding: 0.4rem 0.65rem;
  background: var(--color-primary-highlight);
  border: 1px solid color-mix(in srgb, var(--color-primary) 20%, var(--border));
  border-radius: 6px;
}

.global-stats-sport-section:last-of-type {
  margin-bottom: 0;
}

.global-stats-sport-section[data-sport="tennis"] {
  background: color-mix(in srgb, var(--color-sport-tennis) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-sport-tennis) 25%, var(--border));
}

.global-stats-sport-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.global-stats-sport-section[data-sport="tennis"] > .global-stats-sport-label {
  color: var(--sport-tennis);
}

/* ELO ratings card */
.elo-ratings-grid {
  justify-content: center;
}

.elo-rating-cell {
  min-width: 90px;
  flex: 0 1 140px;
}

.elo-rating-sport-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

[data-sport="tennis"] > .elo-rating-sport-label {
  color: var(--sport-tennis);
}

/* ELO trend chart */
.elo-chart-section {
  margin-top: 1rem;
}

.elo-chart-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding: 0 0.2rem;
}

.elo-chart-heading {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.elo-chart-count {
  font-weight: 400;
  font-size: 0.78rem;
}

/* Sport toggle pills (shared between chart + history) */
.elo-sport-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}

.elo-sport-pill {
  background: transparent;
  border: none;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.elo-sport-pill:not(:last-child) {
  border-right: 1px solid var(--border);
}

.elo-sport-pill:hover {
  background: var(--bg);
}

.elo-sport-pill--active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.elo-sport-pill--active[data-sport="tennis"] {
  background: var(--sport-tennis);
}

.elo-sport-toggle-standalone {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
  margin-top: 1rem;
  margin-left: auto;
}

.elo-chart-container {
  position: relative;
  height: 200px;
  max-height: 220px;
  width: 100%;
}

@media (max-width: 480px) {
  .elo-chart-container {
    height: 160px;
  }
}

/* ELO history inline (inside card) */
.elo-history-inline-details {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.elo-history-inline-summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.elo-history-inline-summary::-webkit-details-marker { display: none; }

.elo-history-inline-details[open] > .elo-history-inline-summary .player-history-chevron {
  transform: rotate(90deg);
}

.elo-history-inline-body {
  padding: 0 0.8rem 0.8rem;
  border-top: 1px solid var(--border);
}

.player-participant-explorer {
  margin-top: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: 10px;
  background: transparent;
}

.player-participant-summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.player-participant-summary::-webkit-details-marker {
  display: none;
}

.player-participant-chevron {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.72em;
  transition: transform 0.15s;
}

.player-participant-explorer[open] .player-participant-chevron {
  transform: rotate(90deg);
}

.player-participant-body {
  padding: 0 0.8rem 0.8rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.player-participant-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.55rem;
  align-items: end;
  margin-bottom: 0.65rem;
}

.player-participant-search {
  margin-bottom: 0;
}

.player-participant-sort-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  justify-self: end;
}

.player-participant-sort {
  width: auto;
  min-width: 180px;
  justify-self: end;
}

.player-participant-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.player-participant-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 1fr 1fr;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.77rem;
  border-top: 1px solid var(--border);
  align-items: center;
}

.player-participant-row:first-child {
  border-top: 0;
}

.player-participant-row-header {
  background: var(--bg);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.player-participant-name {
  font-weight: 600;
}

.player-participant-mobile-label {
  display: none;
}

.player-participant-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.55rem;
  text-align: center;
}

.player-participant-explorer .is-hidden {
  display: none;
}

/* Form */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.form-group small { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 0.95rem; box-sizing: border-box;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,130,246,0.25); }
.btn { padding: 0.6rem 1.2rem; border-radius: 8px; border: none; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.82rem; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-danger-outline { border: 1px solid var(--red, #ef4444); color: var(--red, #ef4444); background: transparent; }
.error-msg { color: var(--red, #ef4444); font-size: 0.83rem; margin-top: 0.4rem; }
.success-msg { color: var(--green); font-size: 0.83rem; margin-top: 0.4rem; }

.required-mark { color: var(--red); }

.player-auth-create-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.player-edit-actions,
.player-link-modal-actions {
  display: flex;
  gap: 0.5rem;
}

/* Save-button success flash */
.btn-save-success {
  background: var(--green, #22c55e) !important;
  border-color: var(--green, #22c55e) !important;
  color: #fff !important;
  pointer-events: none;
  transition: background 0.25s, border-color 0.25s, opacity 0.4s;
}
.btn-save-success.fade-out {
  opacity: 0.6;
}

.player-link-existing-btn {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--border));
  color: var(--accent);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  min-height: 36px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.player-link-existing-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ── Tournaments card (active + past combined) ── */
.player-tournaments-card {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.player-tournaments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
}
.player-tournaments-header .section-heading { margin: 0; }
.player-tournaments-body {
  padding: 0 0.8rem 0.8rem;
  border-top: 1px solid var(--border);
}
.player-tournaments-sub-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0.75rem 0 0.35rem;
}
.player-tournaments-sub-label--inline { margin: 0; }

/* ── Past tournaments (collapsible inside tournaments card) ── */
.player-history-panel {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.player-history-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.8rem;
  user-select: none;
}

.player-history-summary::-webkit-details-marker { display: none; }

.player-history-chevron {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.72em;
  transition: transform 0.15s;
}

.player-history-panel[open] .player-history-chevron { transform: rotate(90deg); }

.player-history-body {
  padding: 0 0.8rem 0.8rem;
  border-top: 1px solid var(--border);
}

.player-elo-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin: 0.6rem 0 0.7rem;
}

.player-elo-control-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.player-elo-control-select {
  width: auto;
  min-width: 64px;
  padding: 0.3rem 0.45rem;
  font-size: 0.76rem;
}

.elo-player-delta {
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.1rem;
  vertical-align: baseline;
}

.elo-player-rating {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-left: 0.2rem;
  vertical-align: baseline;
}

.elo-player-rating::before { content: '('; }
.elo-player-rating::after  { content: ')'; }

@media (max-width: 480px) {
  .elo-player-rating { display: none; }
}

.elo-vs-sep {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin: 0 0.2rem;
}

.elo-score-sep {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
}

.elo-log {
  display: flex;
  flex-direction: column;
}

.elo-log-row {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.elo-log-row:last-child {
  border-bottom: none;
}

.elo-log-row--manual {
  background-color: rgba(59, 130, 246, 0.05);
  border-left: 3px solid var(--accent);
  padding: 0.4rem 0.5rem;
  margin: 0.2rem 0;
  border-radius: 0 4px 4px 0;
}

.elo-manual-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  cursor: help;
  letter-spacing: 0.01em;
}

.elo-manual-admin {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  font-style: italic;
}

.elo-manual-delta {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.8;
}

.elo-manual-reason {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  padding-left: 0.25rem;
}

.elo-log-main {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.elo-log-name {
  font-weight: 600;
  font-size: 0.84rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.elo-log-name:hover { text-decoration: underline; }

.elo-log-dim {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.elo-transition {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  background: var(--bg);
}

.elo-transition--gain {
  color: #22863a;
  border-color: rgba(34, 134, 58, 0.35);
  background: rgba(34, 134, 58, 0.1);
}

.elo-transition--loss {
  color: #cb2431;
  border-color: rgba(203, 36, 49, 0.35);
  background: rgba(203, 36, 49, 0.1);
}

.elo-transition--neutral {
  color: var(--text-muted);
}

.elo-log-score {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
}

.elo-log-delta {
  font-size: 0.78rem;
  white-space: nowrap;
  min-width: 2.2rem;
  text-align: right;
}

.elo-log-teams {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.3rem;
  align-items: center;
}

.elo-team {
  min-width: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.25rem;
  align-items: baseline;
}

.elo-team--a {
  justify-content: flex-end;
  text-align: right;
}

.elo-team--b {
  justify-content: flex-start;
  text-align: left;
}

.elo-team-player {
  display: inline-flex;
  align-items: baseline;
  gap: 0.06rem;
}

.elo-team-join {
  margin-left: 0.08rem;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .elo-log-main {
    gap: 0.3rem;
  }

  .elo-transition {
    font-size: 0.68rem;
    padding: 0.04rem 0.36rem;
    margin-right: auto;
  }

  .elo-team {
    display: block;
  }

  .elo-team-player {
    display: block;
  }

  .elo-team-join {
    display: none;
  }

  .elo-vs-sep,
  .elo-score-sep {
    margin: 0;
  }
}

.elo-delta--gain {
  color: #22863a;
  font-weight: 600;
}

.elo-delta--loss {
  color: #cb2431;
  font-weight: 600;
}

.elo-delta--neutral {
  color: var(--text-muted);
  font-weight: 600;
}

.elo-delta--dim {
  color: var(--text-muted);
  font-weight: 400;
}

.section-heading-inline { margin: 0; }
.section-heading-card { margin: 0 0 0.75rem; }
.entry-card-social-spaced { margin-top: 0.75rem; }

.player-link-modal-help {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.player-link-modal-submit {
  flex: 1;
  min-height: 36px;
}

/* Login recovery panel */
.player-recover {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.player-recover-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.7rem 0.8rem;
  line-height: 1.35;
}
.player-recover-summary::-webkit-details-marker { display: none; }
.player-recover-chevron {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.7em;
  transition: transform 0.15s;
}
.player-recover[open] .player-recover-chevron { transform: rotate(90deg); }
.player-recover-body {
  margin-top: 0;
  padding: 0 0.8rem 0.8rem;
  border-top: 1px solid var(--border);
}
.player-recover-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.65rem 0 0.5rem;
  line-height: 1.45;
}
.player-recover-input { margin-bottom: 0.5rem; }
.player-recover-sent {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
}

@media (max-width: 600px) {
  .profile-bar {
    padding: 0.8rem;
  }

  .profile-bar-header {
    flex-wrap: wrap;
  }

  .profile-bar-name-row {
    width: 100%;
  }

  .player-profile-actions {
    width: 100%;
  }

  .player-profile-actions .btn {
    flex: 1;
  }

  .player-scope-head {
    flex-wrap: wrap;
  }

  .player-scope-select {
    margin-left: 0;
    max-width: 100%;
    width: 100%;
  }

  .player-logout-btn {
    margin-left: 0;
  }

  .player-link-existing-btn {
    width: 100%;
    min-height: 44px;
  }

  .player-verification-actions .btn {
    width: 100%;
  }

  .entry-path-head {
    gap: 0.35rem;
  }

  .entry-path-head-top {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.35rem;
  }

  .entry-path-chips--rank {
    justify-content: flex-end;
  }

  .entry-path-chips--perf {
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .entry-path-chips--perf::-webkit-scrollbar { display: none; }

  .entry-path-match {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.35rem;
  }

  .entry-path-team--player { text-align: right; }
  .entry-path-score-center { text-align: center; }
  .entry-path-team--opponents { text-align: left; }

  .entry-path-score-center {
    font-size: 0.74rem;
  }

  .entry-path-meta-block {
    flex-direction: column;
    gap: 0.08rem;
  }

  .entry-path-label {
    min-width: 0;
  }

  .player-participant-controls {
    grid-template-columns: 1fr;
  }

  .player-elo-controls {
    flex-wrap: wrap;
  }

  .player-elo-control-select {
    width: auto;
    min-width: 64px;
  }

  .player-participant-sort-label,
  .player-participant-sort {
    justify-self: start;
  }

  .player-participant-sort {
    min-width: 0;
    width: 100%;
  }

  .player-participant-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .player-participant-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
  }

  .player-participant-mobile-label {
    display: inline;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .player-participant-row-header {
    display: none;
  }

  .player-recover-summary {
    min-height: 44px;
    padding: 0.75rem 0.8rem;
  }

  .player-participant-summary {
    min-height: 44px;
  }

  .player-history-summary {
    min-height: 44px;
  }

  .player-leaderboard-summary {
    min-height: 44px;
  }

  .elo-history-inline-summary {
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .entry-path-head-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.22rem 0.3rem;
  }

  .entry-path-round {
    flex: 1 0 100%;
    text-align: center;
  }

  .entry-path-chips--rank {
    justify-content: flex-start;
  }

  .entry-path-chips--perf {
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .entry-path-chips--perf::-webkit-scrollbar { display: none; }

  .entry-path-match {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.28rem;
  }

  .entry-path-team--opponents,
  .entry-path-team--player,
  .entry-path-score-center {
    text-align: center;
  }

  .entry-path-team--player { text-align: right; }
  .entry-path-team--opponents { text-align: left; }

  .entry-path-team {
    font-size: 0.74rem;
  }

  .entry-path-team-names {
    flex-direction: column;
    align-items: inherit;
    gap: 0.08rem;
    white-space: normal;
    overflow: visible;
  }

  .entry-path-team-name + .entry-path-team-name::before {
    content: "";
  }
}

/* Modal (link existing) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.5rem; width: 100%; max-width: 420px;
}
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }

/* Inline edit row */
.edit-row { display: flex; gap: 0.5rem; align-items: center; }
.edit-row input { flex: 1; }

h1 { font-size: 1.5rem; margin-bottom: 0.3rem; text-align: center; }
.subtitle { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-bottom: 1.5rem; }

/* Hub info panel (benefits) */
.hub-info-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 1rem; margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.45rem; }
.hub-info-item { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.84rem; color: var(--text-muted); line-height: 1.35; }
.hub-info-bullet { flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 0.45em; }

/* ── Leaderboard panel (details-based, matches history panel) ── */
.player-leaderboard-panel {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.player-leaderboard-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.8rem;
  user-select: none;
  overflow: hidden;
}
.player-leaderboard-summary::-webkit-details-marker { display: none; }
.player-leaderboard-panel[open] .player-history-chevron { transform: rotate(90deg); }
.player-leaderboard-body {
  padding: 0 0.8rem 0.8rem;
  border-top: 1px solid var(--border);
}
.leaderboard-sport-toggle { display: flex; gap: 0; margin: 0 0 0 auto; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; width: fit-content; }
.leaderboard-community-select { display: block; margin: 0; padding: 0.3rem 0.5rem; font-size: 0.82rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); max-width: 220px; cursor: pointer; }
/* Controls row: community selector + sport toggle on the same line */
.leaderboard-controls-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.leaderboard-pill { background: transparent; border: none; padding: 0.3rem 0.75rem; font-size: 0.8rem; cursor: pointer; color: var(--text-muted); transition: background 0.15s, color 0.15s; }
.leaderboard-pill:not(:last-child) { border-right: 1px solid var(--border); }
.leaderboard-pill--active { background: var(--accent); color: #fff; font-weight: 600; }
.leaderboard-pill--active[data-sport="tennis"] { background: var(--sport-tennis); }
.leaderboard-sport { margin-bottom: 0.75rem; }
.leaderboard-sport:last-child { margin-bottom: 0; }
.leaderboard-sport-label { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-muted); }
.leaderboard-empty { font-size: 0.85rem; color: var(--text-muted); text-align: center; padding: 0.75rem 0; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; table-layout: fixed; }
.leaderboard-sport-toggle + .leaderboard-table { margin-top: 0.5rem; }
.leaderboard-table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 0.78rem; padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--border); }
.leaderboard-table td { padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--border); }
.leaderboard-col-rank { width: 2.2rem; text-align: center; }
.leaderboard-col-name { text-align: left; }
.leaderboard-col-elo { width: 4rem; text-align: right; font-weight: 600; }
.leaderboard-col-matches { width: 4rem; text-align: right; color: var(--text-muted); }
.leaderboard-table th.leaderboard-col-rank { text-align: center; }
.leaderboard-table th.leaderboard-col-elo { text-align: right; }
.leaderboard-table th.leaderboard-col-matches { text-align: right; }
.leaderboard-row--me { background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.leaderboard-name--unlinked { color: var(--text-muted); }

/* ── ELO info popup overlay ── */
#elo-info-overlay {
  display: none;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9990;
}
#elo-info-dialog {
  display: none;
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: min(580px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  z-index: 9991;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
#elo-info-dialog h3 { color: var(--accent); font-size: 1rem; margin: 0 0 0.4rem; }
#elo-info-dialog p { font-size: 0.86rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 0.5rem; }
#elo-info-dialog p:last-child { margin-bottom: 0; }
.format-info-close-btn {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  margin: -0.2rem -0.2rem 0 0;
  padding: 0;
}
.format-info-close-btn:hover { color: var(--text); }

/* Info-block styling (mirrors admin.css) */
.info-block {
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  margin: 0.4rem 0 0.6rem;
}
.info-block strong { display: block; font-size: 0.86rem; color: var(--text); margin-bottom: 0.2rem; }
.info-block p { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 0; line-height: 1.5; }

/* Formula display blocks */
.info-formulas {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
}
.info-formulas code {
  display: block;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  color: var(--text);
  letter-spacing: 0.02em;
  width: fit-content;
}
.info-formula-legend {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.45rem;
  margin-bottom: 0;
}
