/* Blueprint Cup — DCI design tokens.
   Light palette = dciagency.us (davis-web-shine/src/styles.css): Inter, radius 0.625rem, brand green
   #4CAF50 as primary. Dark palette = the shadcn neutral dark used by app.dciagency.us, with the same
   green. Sidebar follows command-center/src/components/layout/sidebar.tsx. */
:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.18 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.18 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.18 0 0);
  --primary: oklch(0.689 0.17 142.5);          /* brand green #4CAF50 */
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.18 0 0);
  --muted: oklch(0.965 0 0);
  --muted-foreground: oklch(0.45 0 0);
  --accent: oklch(0.95 0.05 142.5);
  --accent-foreground: oklch(0.25 0.08 142.5);
  --destructive: oklch(0.62 0.22 25);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.92 0 0);
  --input: oklch(0.92 0 0);
  --ring: oklch(0.689 0.17 142.5);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.18 0 0);
  --sidebar-primary: oklch(0.689 0.17 142.5);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.95 0.05 142.5);
  --sidebar-accent-foreground: oklch(0.25 0.08 142.5);
  --sidebar-border: oklch(0.92 0 0);
  --chart-1: oklch(0.689 0.17 142.5);
  --chart-2: oklch(0.55 0.12 142.5);
  --chart-muted: oklch(0.9 0.02 142.5);
  --bronze: #b87333; --silver: #8d99a6; --gold: #d4a017; --black: #1f2328;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: oklch(0.145 0 0); --foreground: oklch(0.985 0 0);
    --card: oklch(0.205 0 0); --card-foreground: oklch(0.985 0 0);
    --popover: oklch(0.205 0 0); --popover-foreground: oklch(0.985 0 0);
    --primary: oklch(0.72 0.17 142.5); --primary-foreground: oklch(0.145 0 0);
    --secondary: oklch(0.269 0 0); --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.269 0 0); --muted-foreground: oklch(0.708 0 0);
    --accent: oklch(0.3 0.05 142.5); --accent-foreground: oklch(0.92 0.08 142.5);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.72 0.17 142.5);
    --sidebar: oklch(0.205 0 0); --sidebar-foreground: oklch(0.985 0 0);
    --sidebar-primary: oklch(0.72 0.17 142.5); --sidebar-primary-foreground: oklch(0.145 0 0);
    --sidebar-accent: oklch(0.269 0 0); --sidebar-accent-foreground: oklch(0.985 0 0);
    --sidebar-border: oklch(1 0 0 / 10%);
    --chart-muted: oklch(0.3 0.02 142.5); --silver: #b6c0cb; --black: #e6e9ee;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --background: oklch(0.145 0 0); --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0); --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0); --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.72 0.17 142.5); --primary-foreground: oklch(0.145 0 0);
  --secondary: oklch(0.269 0 0); --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0); --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.3 0.05 142.5); --accent-foreground: oklch(0.92 0.08 142.5);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.72 0.17 142.5);
  --sidebar: oklch(0.205 0 0); --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.72 0.17 142.5); --sidebar-primary-foreground: oklch(0.145 0 0);
  --sidebar-accent: oklch(0.269 0 0); --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --chart-muted: oklch(0.3 0.02 142.5); --silver: #b6c0cb; --black: #e6e9ee;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  color-scheme: dark;
}

/* ── base ─────────────────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--background); color: var(--foreground); font: 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 24px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--primary); }
.muted { color: var(--muted-foreground); } .small { font-size: 12.5px; } .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
svg.i { width: 16px; height: 16px; flex: 0 0 16px; }

/* ── shell ────────────────────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 12px; background: var(--sidebar); color: var(--sidebar-foreground); border-right: 1px solid var(--sidebar-border); }
.brand { padding: 0 12px 20px; }
.brand-org { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: color-mix(in oklch, var(--sidebar-foreground) 45%, transparent); }
.brand-name { font-size: 14px; font-weight: 700; margin-top: 2px; }
.brand-tag { display: inline-block; margin-top: 8px; font-size: 11px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--sidebar-border); background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; border: 0; background: none; font: inherit; font-size: 14px; color: color-mix(in oklch, var(--sidebar-foreground) 70%, transparent); cursor: pointer; text-align: left; width: 100%; }
.nav-item:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.nav-item.is-active { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); font-weight: 600; }
.sidebar-foot { border-top: 1px solid var(--sidebar-border); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; cursor: pointer; border: 0; background: none; font: inherit; color: inherit; text-align: left; width: 100%; }
.me-row:hover { background: var(--sidebar-accent); }
.me-row.is-active { background: var(--sidebar-accent); }
.me-name { font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub { font-size: 11.5px; color: var(--muted-foreground); }
.me-text { min-width: 0; }

.topbar { display: none; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; align-items: center; gap: 12px; height: 52px; padding: 0 16px; background: var(--sidebar); border-bottom: 1px solid var(--sidebar-border); }
.topbar .brand { padding: 0; } .topbar .brand-tag { display: none; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); cursor: pointer; }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.4); z-index: 25; }

.main { min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1240px; width: 100%; }
.view { min-width: 0; }   /* flex item: let wide tables scroll inside their cards instead of widening the page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted-foreground); margin-top: 4px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar { position: fixed; top: 0; left: 0; z-index: 30; width: min(84vw, 300px); transform: translateX(-104%); transition: transform .2s ease; box-shadow: 0 10px 40px rgb(0 0 0 / 0.3); padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
  .sidebar.is-open { transform: none; }
  .main { padding: 16px 16px 40px; }
}

/* ── primitives ───────────────────────────────────────────────────────────────────────── */
.card { min-width: 0; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-weight: 600; font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; line-height: 1.2; border: 1px solid var(--border); background: var(--card); color: var(--foreground); cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--secondary); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); font-weight: 600; }
.btn-primary:hover { background: color-mix(in oklch, var(--primary) 88%, black); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { color: var(--foreground); background: var(--secondary); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--destructive); }
input, select { font: inherit; color: var(--foreground); background: var(--card); border: 1px solid var(--input); border-radius: 8px; padding: 8px 11px; outline: none; min-width: 0; }
input:focus, select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 25%, transparent); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted-foreground); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-error { color: var(--destructive); min-height: 1.2em; font-size: 13px; }
.form-error.ok { color: var(--accent-foreground); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--secondary); color: var(--muted-foreground); }
.pill.active { background: var(--accent); color: var(--accent-foreground); }
.badge { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--secondary); color: var(--muted-foreground); margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
.segment { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segment button { border: 0; background: var(--card); color: var(--muted-foreground); padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.segment button + button { border-left: 1px solid var(--border); }
.segment button.is-on { background: var(--accent); color: var(--accent-foreground); font-weight: 600; }

.medal { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.medal::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--border)); box-shadow: 0 0 0 3px color-mix(in oklch, var(--c, var(--border)) 25%, transparent); }
.medal.Bronze { --c: var(--bronze); } .medal.Silver { --c: var(--silver); } .medal.Gold { --c: var(--gold); } .medal.Black { --c: var(--black); }
.bar { display: inline-block; vertical-align: middle; width: 140px; min-width: 100px; position: relative; height: 8px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--primary); border-radius: 999px; }
.bar.done > i { background: var(--gold); }
.bar-lbl { font-size: 11.5px; color: var(--muted-foreground); margin-left: 8px; white-space: nowrap; }

.avatar { --size: 32px; width: var(--size); height: var(--size); border-radius: 50%; flex: 0 0 var(--size); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--accent); color: var(--accent-foreground); font-weight: 700; font-size: calc(var(--size) * 0.38); letter-spacing: 0.02em; border: 1px solid var(--border); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-cell .nm { font-weight: 500; white-space: nowrap; }
#myChTbl td.ch { min-width: 240px; white-space: nowrap; }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 10px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--muted-foreground); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; background: var(--muted); }
.tbl th.sortable { cursor: pointer; user-select: none; } .tbl th.sortable:hover { color: var(--foreground); }
.tbl th .arrow { font-size: 10px; margin-left: 4px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in oklch, var(--muted) 60%, transparent); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.exhibition td { color: var(--muted-foreground); }
.tbl tr.is-me td { background: color-mix(in oklch, var(--accent) 45%, transparent); }
.empty-box { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted-foreground); font-size: 13px; padding: 26px 16px; }
.empty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.note { font-size: 12.5px; color: var(--muted-foreground); }

/* ── login ────────────────────────────────────────────────────────────────────────────── */
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: var(--muted); }
.login-card { width: 100%; max-width: 400px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }

/* ── home ─────────────────────────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 12px; color: var(--muted-foreground); font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-sub { font-size: 12px; color: var(--muted-foreground); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.team-card-body { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; }
.team-rank { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.team-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.team-stat { display: flex; flex-direction: column; gap: 2px; }
.team-stat b { font-size: 16px; font-variant-numeric: tabular-nums; }
.team-top { display: flex; flex-direction: column; gap: 8px; }
.team-top-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.team-top-row .pos { width: 18px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.team-top-row .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* (old bar chart rules superseded below) */




.chart-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.link-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; border-color: var(--primary); }
@media (max-width: 720px) { .link-card { grid-template-columns: minmax(0, 1fr); } }
.link-form { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.link-form select { max-width: 100%; }
.greeting { display: flex; align-items: center; gap: 16px; }
.greeting .avatar { --size: 48px; }

/* ── team page ────────────────────────────────────────────────────────────────────────── */
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; }
.team-head .ttl { display: flex; align-items: center; gap: 12px; }
.stat-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { color: var(--muted-foreground); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
@media (max-width: 900px) { .stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .podium { grid-template-columns: minmax(0, 1fr); } }
.podium-card { padding: 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; position: relative; }
.podium-card .avatar { --size: 72px; }
.podium-card.p1 { border-color: var(--gold); } .podium-card.p2 { border-color: var(--silver); } .podium-card.p3 { border-color: var(--bronze); }
.podium-pos { position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 700; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--secondary); color: var(--foreground); }
.podium-card.p1 .podium-pos { background: var(--gold); color: #1f2328; } .podium-card.p2 .podium-pos { background: var(--silver); color: #1f2328; } .podium-card.p3 .podium-pos { background: var(--bronze); color: #fff; }
.podium-name { font-weight: 600; font-size: 15px; }
.podium-steps { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.podium-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted-foreground); flex-wrap: wrap; justify-content: center; }

/* ── challenges page ──────────────────────────────────────────────────────────────────── */
.tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }
.tier { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); }
.tier:last-child { border-right: 0; }
.tier-steps { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.tier-count { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tier:nth-child(2) { border-right: 0; } }
.challenge-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.challenge-pick select { min-width: 260px; max-width: 100%; }

/* ── profile / admin ──────────────────────────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .profile-grid, .admin-grid { grid-template-columns: minmax(0, 1fr); } }
.photo-row { display: flex; align-items: center; gap: 16px; }
.photo-row .avatar { --size: 72px; }
.pull-note { max-width: 420px; white-space: normal; font-size: 12px; color: var(--muted-foreground); }
.st-success { color: var(--accent-foreground); } .st-failed { color: var(--destructive); } .st-running { color: var(--gold); }
.person-out { font: 12.5px var(--font-mono); color: var(--muted-foreground); display: flex; flex-direction: column; gap: 4px; }
.person-out b { color: var(--foreground); }
.tbl td.actions .btn { margin: 2px 4px 2px 0; }
.inline-form { display: inline-flex; gap: 4px; align-items: center; }
.inline-form input { padding: 4px 8px; width: 150px; font-size: 12.5px; }

/* ── layout rhythm: every view and data block stacks with one gap, no inline margins ──── */
.view, .stack { display: flex; flex-direction: column; gap: 16px; }
.rank-block { text-align: right; }

/* ── challenge rows (Home) ────────────────────────────────────────────────────────────── */
.ch-list { display: flex; flex-direction: column; }
.ch-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 16px 20px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.ch-row:last-child { border-bottom: 0; }
.ch-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.ch-prog { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ch-prog .bar { width: 100%; min-width: 0; display: block; }
.ch-prog .bar-lbl { margin: 0; }
.ch-facts { display: flex; gap: 18px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.ch-fact { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ch-fact .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); }
.ch-fact .val { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .ch-row { grid-template-columns: 1fr; } .ch-facts { justify-content: flex-start; } .ch-fact { align-items: flex-start; } }

/* ── steps chart (smooth area line) ───────────────────────────────────────────────────── */
.chart-box { padding: 8px 20px 12px; }
.chart-summary { font-size: 12.5px; color: var(--muted-foreground); padding: 6px 0 2px; min-height: 1.4em; }
.chart-host { position: relative; }
.chart { width: 100%; height: 240px; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .area { fill: url(#chartFill); }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { fill: var(--card); stroke: var(--primary); stroke-width: 2; opacity: 0; transition: opacity .12s; }
.chart .dot.is-today { opacity: 1; }
.chart .hit:hover ~ .dots .dot { opacity: 0; }
.chart .dot.is-on { opacity: 1; }
.chart .cursor { stroke: var(--muted-foreground); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; }
.chart .cursor.is-on { opacity: .8; }
.chart text { fill: var(--muted-foreground); font-size: 11px; font-family: var(--font-sans); }
.chart .lbl-y { font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; pointer-events: none; background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgb(0 0 0 / .15); white-space: nowrap; transform: translate(-50%, -110%); z-index: 2; }
.chart-tip b { font-variant-numeric: tabular-nums; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 240px; color: var(--muted-foreground); font-size: 13px; }
.details { border-top: 1px solid var(--border); }
.details > summary { cursor: pointer; padding: 10px 20px; font-size: 12.5px; color: var(--muted-foreground); list-style: none; display: flex; align-items: center; gap: 6px; }
.details > summary::before { content: "▸"; font-size: 10px; transition: transform .15s; }
.details[open] > summary::before { transform: rotate(90deg); }
.details > summary:hover { color: var(--foreground); }
.details > summary::-webkit-details-marker { display: none; }

/* ── podium used on My Team and Challenges ────────────────────────────────────────────── */
.podium-card .podium-team { font-size: 12px; color: var(--muted-foreground); margin-top: -4px; }

/* ── lean team card (Home) ────────────────────────────────────────────────────────────── */
.team-id { display: flex; align-items: center; gap: 12px; }
.team-id-text { flex: 1; min-width: 0; }
.team-id-text h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-rank-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; padding: 6px 10px; border-radius: 10px; background: var(--accent); color: var(--accent-foreground); font-size: 20px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.team-rank-chip small { font-size: 10.5px; font-weight: 500; margin-top: 3px; letter-spacing: .03em; text-transform: uppercase; }
.team-line { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted-foreground); padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.team-line b { color: var(--foreground); font-variant-numeric: tabular-nums; }
.team-top-row .num.muted { color: var(--muted-foreground); }
.stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.podium-card { gap: 6px; }
.podium-card .podium-steps { margin-top: 4px; }
.stat-sub { font-size: 11.5px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
