/* Apple-inspired aesthetic: SF Pro stack, near-black on warm-light bg,
   minimal borders, tight letter-spacing on headings, generous whitespace. */
:root {
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: #e8f1fc;
  --good: #00875a;
  --good-soft: #e3f5ec;
  --bad: #d70015;
  --bad-soft: #fde7e9;
  --ink: #1d1d1f;
  --ink-soft: #424245;
  --muted: #86868b;
  --line: #d2d2d7;
  --hairline: #ebebeb;
  --bg: #f5f5f7;
  --card: #ffffff;
  --tabs-bg: rgba(245, 245, 247, 0.85);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 14px rgba(0,0,0,0.06);
  --tag-purple-bg: #f1ecfb;
  --tag-purple-fg: #7232c3;
  --tag-amber-bg: #fff4d9;
  --tag-amber-fg: #8c5b00;
  --tag-neutral-bg: #ebebeb;
  --tag-neutral-fg: #424245;
  --dns-bg: rgba(0,0,0,0.015);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #2997ff;
    --accent-hover: #4ba6ff;
    --accent-soft: rgba(41, 151, 255, 0.16);
    --good: #30d158;
    --good-soft: rgba(48, 209, 88, 0.16);
    --bad: #ff453a;
    --bad-soft: rgba(255, 69, 58, 0.16);
    --ink: #f5f5f7;
    --ink-soft: #d1d1d6;
    --muted: #98989d;
    --line: #48484a;
    --hairline: #2c2c2e;
    --bg: #000000;
    --card: #1c1c1e;
    --tabs-bg: rgba(28, 28, 30, 0.78);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-hover: 0 4px 14px rgba(0,0,0,0.6);
    --tag-purple-bg: rgba(155, 89, 255, 0.18);
    --tag-purple-fg: #c89dff;
    --tag-amber-bg: rgba(255, 159, 10, 0.18);
    --tag-amber-fg: #ffb84d;
    --tag-neutral-bg: rgba(255,255,255,0.08);
    --tag-neutral-fg: #d1d1d6;
    --dns-bg: rgba(255,255,255,0.025);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { display: flex; min-height: 100vh; }

/* ---------- Season Sidebar ---------- */
.season-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 60px;
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1.2rem;
  gap: 0.25rem;
  z-index: 20;
  box-shadow: 1px 0 4px rgba(0,0,0,0.03);
}
.season-sidebar-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.season-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.season-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.season-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}
.season-btn.current::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
}
.season-btn.current.active::after {
  background: #fff;
}
.season-btn {
  position: relative;
}
.season-btn.empty {
  opacity: 0.5;
}
.season-btn.empty:hover {
  opacity: 1;
}

.main-wrapper {
  flex: 1;
  margin-left: 60px;
  min-width: 0;
}

@media (max-width: 600px) {
  .season-sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 52px;
    flex-direction: row;
    justify-content: center;
    padding-top: 0;
    padding: 0.35rem 1rem;
    gap: 0.5rem;
    border-right: none;
    border-top: 1px solid var(--hairline);
    box-shadow: 0 -1px 4px rgba(0,0,0,0.03);
  }
  .season-sidebar-label {
    display: none;
  }
  .season-btn {
    width: 40px;
    height: 38px;
    font-size: 0.78rem;
  }
  .main-wrapper {
    margin-left: 0;
    padding-bottom: 56px;
  }
}

/* ---------- Header ---------- */
.page-header {
  background: var(--card);
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
}
.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}
.team-logo {
  height: 120px;
  width: auto;
  max-width: min(380px, 80%);
  object-fit: contain;
  display: block;
  margin-bottom: 0.5rem;
  border-radius: 16px;
  background: white;
  padding: 8px 14px;
}
.page-header-text { min-width: 0; }
.page-header h1 {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.026em;
  line-height: 1.05;
}
.page-header .subtitle {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: -0.005em;
}

@media (prefers-color-scheme: dark) {
  /* The logo image has a white background; rounded corners + a soft shadow
     make it read as a card floating on the dark header instead of a bright
     stripe across the whole top. */
  .team-logo {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- Tabs ---------- */
.tabs {
  background: var(--tabs-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 10;
}
.tabs-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 0.85rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  letter-spacing: -0.005em;
  transition: color 0.15s;
}
.tab-btn::after {
  content: '';
  position: absolute;
  left: 0.95rem;
  right: 0.95rem;
  bottom: 0;
  height: 2px;
  background: transparent;
  border-radius: 2px;
  transition: background 0.15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--ink);
  font-weight: 500;
}
.tab-btn.active::after { background: var(--ink); }

/* ---------- Main ---------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

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

h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.75rem 0 0.85rem;
  letter-spacing: -0.018em;
}
h2:first-child { margin-top: 0; }

/* ---------- Cards & sections ---------- */
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}

.stat-section { margin-bottom: 1.75rem; }
.stat-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-left: 0.15rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.stat {
  background: var(--card);
  border-radius: 18px;
  padding: 1.4rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 130px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.stat .label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat .value {
  font-size: 2.2rem;
  font-weight: 600;
  margin-top: 0.55rem;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat .sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.55rem;
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.stat .medal {
  margin-right: 0.4rem;
  font-size: 1.7rem;
  vertical-align: middle;
}

/* ---------- Meet cards ---------- */
.meet-card { padding: 0; overflow: hidden; }
.meet-card-header {
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.meet-card-header .meet-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 0.2rem;
  letter-spacing: -0.012em;
}
.meet-card-header .meet-date {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: -0.005em;
}

.score-pill {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.score-pill.win { background: var(--good-soft); color: var(--good); }
.score-pill.loss { background: var(--bad-soft); color: var(--bad); }
.score-pill.time-trial { background: var(--tag-purple-bg); color: var(--tag-purple-fg); }
.score-pill.upcoming { background: var(--tag-amber-bg); color: var(--tag-amber-fg); }
.score-pill.tentative { background: var(--tag-amber-bg); color: var(--tag-amber-fg); }
.score-pills-group { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* ---------- Tables ---------- */
table.races {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
table.races th, table.races td {
  padding: 0.75rem 1.4rem;
  text-align: right;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.92rem;
  letter-spacing: -0.005em;
}
table.races th {
  background: transparent;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}
table.races td:first-child, table.races th:first-child { text-align: left; }
table.races tr:last-child td { border-bottom: none; }
table.races .delta-good { color: var(--good); font-weight: 500; }
table.races .delta-bad { color: var(--bad); font-weight: 500; }
table.races .relay-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dns-row td {
  color: var(--muted);
  background: var(--dns-bg);
  font-style: italic;
}
.dns-tag {
  display: inline-block;
  background: var(--tag-neutral-bg);
  color: var(--tag-neutral-fg);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-style: normal;
}

/* Standalone PB table — make it card-like */
.pbs-table {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.pbs-table th, .pbs-table td { text-align: left; }
.pbs-table th:nth-child(2),
.pbs-table td:nth-child(2),
.pbs-table th:nth-child(5),
.pbs-table td:nth-child(5) { text-align: right; }
.pbs-table th { padding-top: 1rem; padding-bottom: 0.75rem; }
.pbs-table td { padding-top: 1rem; padding-bottom: 1rem; }
.pbs-footnote {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  letter-spacing: -0.005em;
}

.set-at-name { font-weight: 500; }
.set-at-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.seed-tag {
  display: inline-block;
  background: var(--tag-purple-bg);
  color: var(--tag-purple-fg);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.medal-cell { white-space: nowrap; }

/* ---------- Charts ---------- */
.chart-wrap {
  background: var(--card);
  border-radius: 18px;
  padding: 1.4rem 1.5rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}
.chart-wrap h3 {
  margin: 0 0 0.85rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.chart-wrap .empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.5rem 0;
}
.chart-wrap canvas { max-height: 260px; }

/* ---------- Empty state ---------- */
.no-data {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--card);
  border-radius: 18px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-card);
}
.no-data h3 {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}
.no-data p {
  margin: 0;
  font-size: 0.88rem;
}

/* ---------- Mobile ---------- */
.meet-gallery {
  padding: 1.1rem 1.4rem 1.25rem;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.meet-photo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.meet-photo img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 14px;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.meet-photo img:hover { opacity: 0.92; }
.meet-photo figcaption {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: -0.005em;
}

/* ---------- Per-meet import control ---------- */
.meet-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.meet-import {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.meet-import-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.btn-secondary:disabled {
  color: var(--muted);
  cursor: not-allowed;
  background: transparent;
  opacity: 0.6;
}
.import-status {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.import-status:empty { display: none; }
.import-status.busy { color: var(--ink-soft); }
.import-status.ok { color: var(--good); }
.import-status.err { color: var(--bad); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
  cursor: zoom-out;
  opacity: 1;
  transition: opacity 0.24s ease-out, backdrop-filter 0.24s ease-out;
  animation: lightbox-fade 0.24s ease-out;
}
.lightbox.closing {
  opacity: 0;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  animation: none;
}
@keyframes lightbox-fade {
  from { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
  to   { opacity: 1; }
}
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  cursor: default;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  will-change: transform;
}
.lightbox-caption {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  margin-top: 1rem;
  text-align: center;
  cursor: default;
  max-width: 600px;
  letter-spacing: -0.005em;
  animation: caption-fade 0.32s ease-out 0.12s both;
}
@keyframes caption-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.lightbox.closing .lightbox-caption { animation: none; opacity: 0; transition: opacity 0.18s; }

/* ---------- Footer (deliberately low-contrast) ---------- */
.page-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--hairline);
  letter-spacing: 0.01em;
  padding: 2.5rem 1rem 0.75rem;
  user-select: none;
}
.page-footer:empty { display: none; }
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .page-header-inner { padding: 1.6rem 1.2rem 1.4rem; }
  .team-logo { height: 88px; margin-bottom: 0.25rem; }
  .page-header h1 { font-size: 1.85rem; }
  .page-header .subtitle { font-size: 0.92rem; }
  main { padding: 1.5rem 1.2rem 2.5rem; }
  .stat { padding: 1.15rem 1.2rem 1.25rem; min-height: 110px; }
  .stat .value { font-size: 1.85rem; }
  table.races th, table.races td { padding: 0.6rem 0.8rem; font-size: 0.88rem; }
  .meet-card-header { padding: 1rem 1.1rem; }
  .pbs-table th, .pbs-table td { padding: 0.7rem 0.8rem; }
  .chart-wrap { padding: 1.1rem 1.2rem 1.2rem; }
  .meet-gallery { padding: 0.9rem 1.1rem 1.1rem; }
  .meet-photo img { max-height: 420px; }
}

/* Records tab */
.records-source {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.records-card { margin-bottom: 1rem; }
.records-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--hairline);
}
.records-age-group {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--tag-neutral-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
.records-event-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.records-table { margin: 0; }
.records-table td {
  font-size: 0.85rem;
  padding: 0.5rem 0.7rem;
}
.records-rank {
  font-weight: 600;
  color: var(--muted);
  width: 2.2rem;
  text-align: center;
}
.records-time {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.records-year {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}
.records-diff {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
  width: 4rem;
}
tr.records-austin-row {
  background: var(--bg);
}
tr.records-austin-row td {
  font-weight: 600;
  color: var(--ink-soft);
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
tr.records-austin-row.records-austin-top10 {
  background: var(--accent-soft);
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
}
tr.records-austin-row.records-austin-top10 td {
  font-weight: 700;
  color: var(--accent);
}
tr.records-austin-row .records-rank {
  color: inherit;
}
tr.records-austin-row .records-diff {
  color: inherit;
  font-weight: 600;
}
.records-targets {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 1.2rem;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}
.records-target {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.records-target-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.records-target-value {
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}


/* Goal level colors */
.goal-stat.goal-gold .goal-level { color: #b8860b; }
.goal-stat.goal-silver .goal-level { color: #6b7280; }
.goal-stat.goal-blue .goal-level { color: #2563eb; }
.goal-stat.goal-green .goal-level { color: #16a34a; }
.goal-stat.goal-none .goal-level { color: var(--muted); }
.goal-stat.goal-gold { border-left: 3px solid #b8860b; }
.goal-stat.goal-silver { border-left: 3px solid #9ca3af; }
.goal-stat.goal-blue { border-left: 3px solid #2563eb; }
.goal-stat.goal-green { border-left: 3px solid #16a34a; }









/* PB level + next columns */
.pb-lvl-current { font-weight: 700; }
.pb-lvl-gold { color: #b8860b; }
.pb-lvl-silver { color: #6b7280; }
.pb-lvl-blue { color: #2563eb; }
.pb-lvl-green { color: #16a34a; }
.pb-next-cell { font-size: 0.82rem; white-space: nowrap; font-weight: 700; }
.pb-lvl-gold-text { color: #b8860b; }
.pb-lvl-silver-text { color: #6b7280; }
.pb-lvl-blue-text { color: #2563eb; }
.pb-lvl-green-text { color: #16a34a; }
.pb-next-gap { color: var(--bad); font-weight: 400; display: block; font-size: 0.75rem; margin-top: 0.15rem; }

/* Levels tab */
.level-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  border: 1px solid var(--hairline);
}
.level-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}
.level-card-event {
  font-size: 1.1rem;
  font-weight: 700;
}
.level-card-pb {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.level-row-inline {
  display: flex;
  gap: 0.5rem;
}
.level-item {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  border-radius: 8px;
  border-top: 3px solid var(--hairline);
}
.level-item.lvl-gold { border-top-color: #b8860b; }
.level-item.lvl-silver { border-top-color: #9ca3af; }
.level-item.lvl-blue { border-top-color: #2563eb; }
.level-item.lvl-green { border-top-color: #16a34a; }
.level-item.level-achieved { background: var(--bg); }
.level-item:not(.level-achieved) { opacity: 0.5; }
.level-name {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.lvl-gold .level-name { color: #b8860b; }
.lvl-silver .level-name { color: #6b7280; }
.lvl-blue .level-name { color: #2563eb; }
.lvl-green .level-name { color: #16a34a; }
.level-time {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0.15rem 0;
}
.level-status-achieved {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--good);
}
.level-status-gap {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--bad);
}

/* PB table vertical alignment */
.pbs-table td, .pbs-table th { vertical-align: top; }

/* Relay members list */
.relay-members-list { margin: 0.4rem 0 0.8rem; }
.relay-members-entry { display: flex; gap: 0.5rem; font-size: 0.78rem; padding: 0.15rem 0; color: var(--ink-soft); }
.relay-members-date { font-weight: 600; min-width: 4rem; color: var(--muted); }
.relay-members-names { font-variant-numeric: tabular-nums; }
