/* Training Desk — coach & athlete portals (PLACEHOLDER brand).
   Premium dark theme matching the marketing site. Self-hosted fonts only, no CDN.
   One accent (#ff5a1f) used sparingly; cool charcoal neutrals. No tan / beige / cream. */
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-style: normal; font-display: swap;
  src: url("/fonts/BarlowCondensed-ExtraBold.woff2") format("woff2"), url("/fonts/BarlowCondensed-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/fonts/BarlowCondensed-SemiBold.woff2") format("woff2"), url("/fonts/BarlowCondensed-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url("/fonts/Inter-Variable.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  /* Token names kept from the light theme so leaderboard.css and inline markup keep working. */
  --ink: #f3f4f6;          /* primary text */
  --ink-soft: #a3a8b3;     /* secondary text: 7.4:1 on --card */
  --faint: #8b919c;        /* tertiary: 5.3:1 on --card */
  --navy: #0d0f12;         /* chrome */
  --navy-2: #13161a;
  --navy-3: #1d2128;
  --paper: #0a0b0d;        /* page */
  --card: #15181d;         /* surface */
  --card-2: #1b1f25;
  --line: rgba(255,255,255,0.07);
  --line-strong: rgba(255,255,255,0.14);
  --accent: #ff5a1f;
  --accent-2: #ff7a45;
  --accent-text: #ff8a5c;  /* accent as text on dark: 7:1 on --card */
  --accent-soft: rgba(255,90,31,0.12);
  --teal: #7cc4ff;         /* info / links-in-tables: cool blue */
  --teal-soft: rgba(124,196,255,0.12);
  --ok: #4ade80;
  --ok-soft: rgba(74,222,128,0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251,191,36,0.10);
  --danger: #f87171;
  --danger-soft: rgba(248,113,113,0.12);
  --pr: #ff8a5c;
  --pr-soft: rgba(255,90,31,0.14);
  --demo: #a3a8b3;
  --demo-bg: #0d0f12;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -24px rgba(0,0,0,0.7);
  --radius: 18px;
  --display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", Impact, sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  font-family: var(--sans);
  font-feature-settings: "cv11", "ss01";
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 85% -120px, rgba(255,90,31,0.10), transparent 70%),
    var(--paper);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 0.5em; }
h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: .95; font-size: clamp(34px, 4.2vw, 48px); }
h2 { font-family: var(--sans); font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 0.8em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Inline links inside copy: tap-friendly and visibly links */
.card p a:not(.btn), .muted a:not(.btn), .footer-note a, .callout a {
  color: var(--ink); text-decoration: underline; text-decoration-color: rgba(255,122,69,.6); text-underline-offset: 4px; text-decoration-thickness: 1.5px;
  display: inline-block; padding: 10px 2px; margin: -10px 0; font-weight: 600;
}
.card p a:not(.btn):hover { color: var(--accent-text); }

.demo-banner {
  background: #07080a;
  color: var(--ink-soft);
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.demo-banner::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: 2px; box-shadow: 0 0 0 3px rgba(255,90,31,.2); }
.demo-chip {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  background: rgba(255,255,255,0.05); color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 8px; vertical-align: middle;
}

/* ---------- Auth (landing / login) ---------- */
.auth-shell {
  min-height: 100vh; display: flex; flex-direction: column; color: var(--ink);
  background: var(--paper);
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom);
}
.auth-shell .demo-banner { position: static; }
.auth-split { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 0; }
.auth-art { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--s6); border-right: 1px solid var(--line); }
.auth-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.auth-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10,11,13,.96) 5%, rgba(10,11,13,.35) 60%, rgba(10,11,13,.55)), radial-gradient(500px 300px at 80% 20%, rgba(255,90,31,.2), transparent 70%); }
.auth-art .big { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(44px, 5vw, 72px); line-height: .9; margin: 0 0 12px; }
.auth-art .big em { font-style: normal; color: var(--accent); }
.auth-art p { color: #c3c7cf; max-width: 32em; }
.ph-tag { position: absolute; top: 16px; left: 16px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); background: rgba(10,11,13,.7); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 9px; }
.auth-center { flex: 1; display: grid; place-items: center; padding: var(--s5) var(--s2) var(--s6); }
.brand-mark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); margin-bottom: var(--s3); text-decoration: none; }
.brand-mark::before, .brand .logo-mark { content: ""; width: 22px; height: 22px; border-radius: 6px; flex: none; background: linear-gradient(135deg, var(--accent-2), var(--accent) 60%, #d9400a); box-shadow: 0 6px 18px -6px rgba(255,90,31,.7); }
.auth-card { width: min(920px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { color: #fff; }
.auth-card .lede { color: var(--ink-soft); max-width: 54ch; }
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.portal-tile { display: block; text-decoration: none; background: var(--card-2); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 22px; min-height: 160px; transition: transform .2s var(--ease), border-color .2s var(--ease); }
.portal-tile:hover { transform: translateY(-2px); border-color: rgba(255,90,31,.4); }
.portal-tile p { color: var(--ink-soft); margin: 0; }
.portal-tile .go { margin-top: 18px; font-weight: 700; color: var(--accent-text); }
.login-card { width: min(440px, 100%); background: linear-gradient(180deg, var(--card-2), var(--card)); color: var(--ink); border: 1px solid var(--line); border-radius: 24px; padding: var(--s5); box-shadow: 0 40px 80px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.02) inset; }
.login-card h1 { font-size: 40px; margin-bottom: 8px; }
.login-card .btn[type=submit] { width: 100%; margin-top: 8px; }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-soft); }
.field input, .field select, .field textarea, .toolbar input, .toolbar select {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 14px;
  background-color: rgba(255,255,255,0.03);
  color: var(--ink);
  font-size: 16px;
  min-height: 48px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.field select, .toolbar select, .lb-toolbar select {
  -webkit-appearance: none; appearance: none;
  background-image: url("/img/chev.svg"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 40px;
}
select option { background: var(--card); color: var(--ink); }
.field input:hover, .field select:hover, .toolbar input:hover, .toolbar select:hover { border-color: rgba(255,255,255,0.24); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .toolbar input:focus-visible, .toolbar select:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,90,31,0.18); background-color: rgba(255,90,31,0.04);
}
input::placeholder, textarea::placeholder { color: #767c87; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); }
input[type="checkbox"] { accent-color: var(--accent); width: 20px; height: 20px; }

.btn {
  appearance: none; border: 1px solid transparent;
  background: var(--accent); color: #0a0b0d;
  font-weight: 650; font-size: 15px; letter-spacing: .005em;
  border-radius: 999px; padding: 10px 20px; cursor: pointer;
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(255,90,31,.7), inset 0 1px 0 rgba(255,255,255,.25);
  transition: background .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: rgba(255,255,255,0.04); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn.secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.24); }
.btn.ghost { background: transparent; color: inherit; border-color: var(--line-strong); box-shadow: none; }
.btn.ghost:hover { background: rgba(255,255,255,0.06); }
.btn.warn { background: var(--accent); color: #0a0b0d; }
.btn.small { padding: 8px 14px; font-size: 13px; min-height: 44px; }
.error { color: var(--danger); font-weight: 600; min-height: 1.2em; }
.demo-creds { margin-top: 20px; background: rgba(255,255,255,0.03); border: 1px dashed var(--line-strong); border-radius: 14px; padding: 12px 14px; font-size: 13px; color: var(--ink-soft); }
.demo-creds code { font-family: var(--mono); color: var(--ink); font-size: 12.5px; }

/* ---------- App chrome ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 256px 1fr; grid-template-rows: auto 1fr; }
.app .demo-banner { grid-column: 1 / -1; }
.portal-chrome { display: contents; }
.app { background: linear-gradient(90deg, rgba(13,15,18,.9) 0 255px, rgba(255,255,255,.07) 255px 256px, transparent 256px); }
.card:has(.scroll-shell) { background: var(--card); }
.sidebar {
  background: transparent;
  color: var(--ink);
  padding: 24px 16px 24px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 33px; height: calc(100vh - 33px); overflow-y: auto;
}
.sidebar .brand { padding: 4px 12px 24px; position: relative; padding-left: 46px; }
.sidebar .brand::before { content: ""; position: absolute; left: 12px; top: 6px; width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--accent-2), var(--accent) 60%, #d9400a); box-shadow: 0 6px 18px -6px rgba(255,90,31,.7); }
.sidebar .brand strong { display: block; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.1; }
.sidebar .brand span { font-size: 12px; color: var(--faint); }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink-soft);
  padding: 10px 12px; min-height: 44px; border-radius: 12px;
  font-weight: 550; font-size: 14.5px; position: relative;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-link::before {
  content: ""; width: 20px; height: 20px; flex: none; background: currentColor; opacity: .85;
  -webkit-mask: var(--ico, url("/img/icons/grid.svg")) center / 20px no-repeat; mask: var(--ico, url("/img/icons/grid.svg")) center / 20px no-repeat;
}
.nav-link[href="/coach"], .nav-link[href="/athlete"] { --ico: url("/img/icons/home.svg"); }
.nav-link[href$="/programs"] { --ico: url("/img/icons/program.svg"); }
.nav-link[href$="/roster"] { --ico: url("/img/icons/users.svg"); }
.nav-link[href$="/schedule"] { --ico: url("/img/icons/calendar.svg"); }
.nav-link[href$="/lifts"] { --ico: url("/img/icons/barbell.svg"); }
.nav-link[href$="/leaderboard"] { --ico: url("/img/icons/trophy.svg"); }
.nav-link[href$="/settings"] { --ico: url("/img/icons/settings.svg"); }
.nav-link[href$="/logs"] { --ico: url("/img/icons/list.svg"); }
.nav-link[href$="/progress"] { --ico: url("/img/icons/trend.svg"); }
.nav-link:hover { background: rgba(255,255,255,0.04); color: var(--ink); }
.nav-link.active { background: linear-gradient(90deg, rgba(255,90,31,0.16), rgba(255,90,31,0.04)); color: #fff; }
.nav-link.active::before { background: var(--accent-2); opacity: 1; }
.nav-link.active::after { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar .spacer { flex: 1; }
.sidebar .who { font-size: 12.5px; color: var(--faint); padding: 16px 12px 0; margin-top: 16px; border-top: 1px solid var(--line); line-height: 1.5; }
.sidebar .who .btn { margin-top: 12px !important; width: 100%; color: var(--ink); }
.portal-nav { display: contents; }
.main { padding: 40px 48px 96px; min-width: 0; max-width: 1400px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 32px; flex-wrap: wrap; }
.topbar h1 { margin-bottom: 6px; }
.topbar p.muted { margin: 0; font-size: 14px; }
.level-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px;
  background: rgba(255,255,255,0.04); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 6px 14px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase;
}
.level-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.muted { color: var(--ink-soft); }
.kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 12px; }

.grid-3, .grid-2, .grid-4 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card > h2:first-child, .card .toolbar h2 { font-size: 17px; }
.stat { position: relative; overflow: hidden; padding: 20px 22px; }
.stat::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,90,31,.14), transparent); pointer-events: none; }
.stat .num { font-family: var(--display); font-size: 56px; font-weight: 800; line-height: .9; letter-spacing: 0; font-variant-numeric: tabular-nums; color: #fff; }
.stat .lbl { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 10px; }

/* Hero lift tiles (athlete home) */
.lift-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.lift-tile { background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 12px; box-shadow: var(--shadow); min-width: 0; }
.lift-tile .lt-name { font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 8px; }
.lift-tile .lt-num { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.lift-tile .lt-num small { font-size: 14px; color: var(--ink-soft); margin-left: 4px; letter-spacing: .06em; }
.lift-tile .lt-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.lift-tile .spark { width: 100%; height: 36px; margin-top: 8px; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: 11px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); background: transparent; }
table.data tbody tr { transition: background .15s var(--ease); }
table.data tbody tr:hover td { background: rgba(255,255,255,0.025); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td a { color: var(--ink); font-weight: 650; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
table.data td a:hover { color: var(--accent-text); }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 9px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid transparent; white-space: nowrap; }
.badge.pr { background: var(--pr-soft); color: var(--pr); border-color: rgba(255,90,31,.3); }
.badge.pr::before { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 6px solid currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(74,222,128,.25); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(251,191,36,.25); }
.badge.teal { background: var(--teal-soft); color: var(--teal); border-color: rgba(124,196,255,.25); }
.badge.neutral { background: rgba(255,255,255,0.06); color: var(--ink-soft); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search] { padding-left: 40px; background-image: url("/img/icons/search.svg"); background-repeat: no-repeat; background-position: 14px center; background-size: 16px; min-width: 240px; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; background: transparent; overflow: visible; }
.chart .grid line { stroke: rgba(255,255,255,0.07); stroke-dasharray: 3 5; }
.chart .axis { stroke: rgba(255,255,255,0.14); stroke-width: 1; }
.chart .line { stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: 1; }
.chart circle { fill: #0f1115; stroke: var(--accent-2); stroke-width: 2; }
.chart circle.pr-dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart circle.hit { fill: transparent; stroke: none; cursor: pointer; }
.chart .tick { fill: var(--faint); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .chart-title { fill: var(--ink-soft); font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; font-family: var(--sans); }
.chart .chart-big { fill: #fff; font-family: var(--display); font-weight: 800; font-size: 40px; }
.chart .chart-unit { fill: var(--ink-soft); font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .06em; }
.chart .chart-delta { fill: var(--accent-text); font-size: 12px; font-weight: 650; font-family: var(--sans); }
.chart .pr-flag { fill: var(--accent-text); font-size: 9.5px; font-weight: 750; letter-spacing: .1em; font-family: var(--sans); }
.spark path.sl { stroke: var(--accent); stroke-width: 1.8; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.chart-empty, .spark-empty { color: var(--faint); font-size: 13px; }
.chart-tip {
  position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
  background: rgba(20,23,28,0.96); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px;
  font-size: 12px; color: var(--ink); white-space: nowrap; box-shadow: 0 12px 30px -10px rgba(0,0,0,.8);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.chart-tip b { font-family: var(--display); font-size: 18px; font-weight: 800; display: block; line-height: 1.1; }
.chart-tip .pr { color: var(--accent-text); font-weight: 700; }

.callout { border-radius: 14px; padding: 12px 16px; background: var(--warn-soft); color: #fcd877; border: 1px solid rgba(251,191,36,.2); font-size: 13.5px; margin: 12px 0; }
.callout.privacy { background: var(--teal-soft); color: #b5dcff; border-color: rgba(124,196,255,.22); }
.callout.danger { background: var(--danger-soft); color: #fecaca; border-color: rgba(248,113,113,.25); }

.pr-board { display: grid; gap: 8px; }
.pr-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: rgba(255,255,255,0.02); transition: border-color .2s var(--ease), background .2s var(--ease); }
.pr-item:hover { border-color: rgba(255,90,31,.3); background: rgba(255,90,31,.04); }
.pr-item strong { font-weight: 650; }
.pr-item .muted { font-size: 13px; }
.calendar { display: grid; gap: 4px; }
.session-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.calendar .session-row:last-child { border-bottom: 0; }
.card.session-row { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.session-row strong { font-weight: 650; }
.session-row .muted { font-size: 13px; }

/* Segmented controls */
.unit-toggle, .level-switch { display: inline-flex; padding: 3px; gap: 2px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 999px; }
.unit-toggle button, .level-switch button { border: 0; background: transparent; color: var(--ink-soft); padding: 6px 14px; cursor: pointer; min-height: 44px; min-width: 44px; border-radius: 999px; font-weight: 600; font-size: 13.5px; transition: background .2s var(--ease), color .2s var(--ease); }
.unit-toggle button:hover, .level-switch button:hover { color: var(--ink); }
.unit-toggle button.on, .level-switch button.on { background: #f3f4f6; color: #0a0b0d; box-shadow: 0 2px 8px rgba(0,0,0,.4); }

/* ---------- Lift board grid: sticky athlete column + swipe affordance ---------- */
.scroll-shell { position: relative; min-width: 0; }
.scroll-shell::before, .scroll-shell::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40px; pointer-events: none; z-index: 3; opacity: 0; transition: opacity .2s var(--ease); }
.scroll-shell::after { right: 0; background: linear-gradient(270deg, var(--card) 10%, rgba(21,24,29,0)); }
.scroll-shell::before { left: var(--sticky-w, 0px); background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,0)); width: 18px; }
.scroll-shell.can-right::after { opacity: 1; }
.scroll-shell.can-left::before { opacity: 1; }
.swipe-hint { display: none; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin: 0 0 10px; }
.swipe-hint::after { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("/img/icons/swipe.svg") center / 16px no-repeat; mask: url("/img/icons/swipe.svg") center / 16px no-repeat; animation: nudge 1.6s var(--ease) infinite; }
.scroll-shell.can-right + .swipe-hint, .swipe-hint.show { display: inline-flex; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
.lift-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.lift-grid { min-width: 760px; }
.lift-grid th:not(:first-child), .lift-grid td:not(:first-child) { scroll-snap-align: start; scroll-margin-left: 170px; }
.lift-grid th:first-child, .lift-grid td:first-child { position: sticky; left: 0; z-index: 2; background: var(--card); min-width: 160px; box-shadow: 1px 0 0 var(--line); }
.lift-grid tbody tr:hover td:first-child { background: #1a1d22; }
.lift-grid .cell { line-height: 1.35; min-width: 150px; }
.lift-grid .cell strong { font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: .01em; color: #fff; margin-right: 2px; }
.lift-grid .cell small { display: block; color: var(--ink-soft); font-weight: 500; font-size: 12px; }
.lift-grid .cell .badge { margin-left: 4px; vertical-align: 4px; }
.lift-grid .spark { display: block; margin-top: 6px; }
.clickable { cursor: pointer; }

.auth-shell a.brand-mark { min-height: 44px; }
.login-card p a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(255,122,69,.6); text-underline-offset: 4px; text-decoration-thickness: 1.5px; font-weight: 600; display: inline-block; padding: 10px 2px; margin: -10px 0; }
.footer-note { margin-top: 32px; font-size: 12.5px; color: var(--faint); max-width: 70ch; }

.app, .card, .grid-2, .grid-3, .grid-4 { min-width: 0; }
.table-scroll, .lb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; overscroll-behavior-x: contain; }
.portal-nav-toggle {
  display: none; margin-left: auto; appearance: none;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.04); color: #fff;
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 8px 16px; min-height: 44px; min-width: 44px; border-radius: 999px; cursor: pointer; gap: 10px;
}
.portal-nav-toggle::before { content: ""; width: 16px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.sidebar-top { display: contents; }
table.data td:first-child, .lift-grid .cell { white-space: nowrap; }

/* ---------- Phone + iPad portrait: one-column app, top bar + menu ---------- */
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; background: none; }
  .portal-chrome { display: block; position: sticky; top: 0; z-index: 45; background: rgba(10,11,13,.85); -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
  .portal-chrome .demo-banner { position: static; padding-top: 8px; }
  .sidebar { position: static; height: auto; overflow: visible; background: transparent; border-right: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
  .sidebar-top { display: flex; align-items: center; gap: 12px; width: 100%; }
  .sidebar .brand { padding: 0 0 0 36px; }
  .sidebar .brand::before { left: 0; top: 50%; transform: translateY(-50%); }
  .sidebar .brand strong { display: inline; margin-right: 8px; font-size: 18px; }
  .portal-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .portal-nav { display: none; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; padding: 8px 0 12px; max-height: calc(100vh - 120px); overflow-y: auto; }
  html.portal-nav-open .portal-nav { display: flex; }
  html.portal-nav-open .portal-nav-toggle { background: rgba(255,255,255,.1); }
  .nav-link.active::after { left: 0; }
  .sidebar .spacer { display: none; }
  .sidebar .who { display: block; padding: 12px 12px 0; }
  .nav-link { font-size: 16px; min-height: 48px; }
  .main { padding: 28px 24px 96px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .portal-grid { grid-template-columns: 1fr; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-art { min-height: 260px; padding: var(--s4) var(--s3); border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-art .big { font-size: 48px; }
}
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .main { padding: 20px 16px 96px; }
  .topbar { margin-bottom: 20px; align-items: flex-start; }
  .topbar h1 { font-size: 36px; }
  .card { padding: 18px; border-radius: 16px; }
  .stat { padding: 16px; }
  .stat .num { font-size: 44px; }
  .grid-4 { gap: 10px; }
  .lift-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lift-tile .lt-num { font-size: 34px; }
  .login-card { padding: var(--s3); border-radius: 20px; }
  .login-card h1 { font-size: 34px; }
  .auth-center { padding: var(--s3) var(--s2) var(--s5); }
  .auth-art { min-height: 200px; }
  .auth-art .big { font-size: 40px; }
  .auth-art p:not(.big) { display: none; }
  .toolbar input[type=search] { min-width: 0; }
  form.toolbar, form[data-form] { flex-direction: column; align-items: stretch !important; }
  form.toolbar .field, form[data-form] .field,
  form.toolbar > label, form.toolbar input, form.toolbar select, form.toolbar button,
  form[data-form] button { width: 100%; flex: 1 1 auto; }
  .lift-grid th:first-child, .lift-grid td:first-child { min-width: 128px; max-width: 140px; white-space: normal; }
  .lift-grid th:not(:first-child), .lift-grid td:not(:first-child) { scroll-margin-left: 136px; }
}
@media (max-width: 900px) {
  /* Stack data tables as cards (lift grid stays a sideways scroller) */
  table.data:not(.lift-grid):not(.lb-table) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data:not(.lift-grid):not(.lb-table),
  table.data:not(.lift-grid):not(.lb-table) tbody,
  table.data:not(.lift-grid):not(.lb-table) tr,
  table.data:not(.lift-grid):not(.lb-table) td { display: block; width: 100%; white-space: normal; }
  table.data:not(.lift-grid):not(.lb-table) tr { border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; margin-bottom: 10px; background: rgba(255,255,255,0.02); }
  table.data:not(.lift-grid):not(.lb-table) tbody tr:hover td { background: transparent; }
  table.data:not(.lift-grid):not(.lb-table) td { border-bottom: 1px solid var(--line); padding: 8px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 40px; }
  table.data:not(.lift-grid):not(.lb-table) td:last-child { border-bottom: 0; }
  table.data:not(.lift-grid):not(.lb-table) td::before { content: attr(data-label); font-size: 11px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); flex: 0 0 36%; }
  table.data:not(.lift-grid):not(.lb-table) td:first-child { white-space: normal; }
}
@media (max-height: 500px) {
  .main { padding-top: 16px; padding-bottom: 48px; }
  .topbar { margin-bottom: 12px; }
  .auth-art { display: none; }
}
.entries-more { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; }
.entries-more .muted { font-size: 13px; }
@media (min-width: 901px) { table.data:not(.lift-grid) td, table.data:not(.lift-grid) th { white-space: nowrap; } table.data td.lb-parts { white-space: normal; } }
