/* The Athlete Portal (/athlete, layouts/athlete.blade.php): a prospect's
   own site inside Hydro Tactix. Dark only, on the admin shell's tokens
   (layout.css's :root values, copied here so this surface needs neither
   layout.css nor Tailwind), with a live background: a slow perspective
   grid and two drifting glows behind every page, the thing the ClickUp
   calendar page does. Big Shoulders only for big numbers. */

:root {
    --ap-chrome: #0F1419;
    --ap-bg: #090909;
    --ap-surface: #111111;
    --ap-surface-2: #191919;
    --ap-surface-hover: #232323;
    --ap-border: #2a2a2a;
    --ap-border-strong: #3a3a3a;
    --ap-text: #EEEEEE;
    --ap-muted: #B4B4B4;
    --ap-faint: #777777;
    --ap-accent: #00BFFF;
    --ap-accent-soft: rgba(0,191,255,.12);
    --ap-gold: #FFC700;
    --ap-cta: #FFC700;
    --ap-danger: #F87171;
    --ap-success: #4ADE80;
    --ap-r-sm: 6px;
    --ap-r: 8px;
    --ap-r-lg: 12px;
    --ap-r-xl: 18px;
    --ap-font: -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --ap-display: 'Big Shoulders Display', sans-serif;
    --ap-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 20px 50px -20px rgba(0,0,0,.8);
    color-scheme: dark;
}

/* Page-level resets only on the portal's own pages (body.ap-body): the
   coach's recruit page loads this file too, for the embedded profile, and
   must keep its own layout. */
.ap-body, .ap-body *, .ap-body *::before, .ap-body *::after { box-sizing: border-box; }
html.ap-html { -webkit-text-size-adjust: 100%; }
body.ap-body {
    margin: 0; min-height: 100vh; background: var(--ap-bg); color: var(--ap-text);
    font-family: var(--ap-font); font-size: 15px; line-height: 1.5;
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
:where(.ap-body) a { color: inherit; }
.ap-body img { max-width: 100%; display: block; }
.ap-body h1, .ap-body h2, .ap-body h3, .ap-body h4, .ap-body p { margin: 0; }
:where(.ap-body) button { font: inherit; color: inherit; }
.ap-body [x-cloak] { display: none !important; }

/* Embedded in the coach's recruit page (recruits/_athlete-panel): the
   portal's tokens follow the admin theme there, so the block reads the
   same in the coach's light mode as the rest of the page. */
.ap-embed {
    --ap-bg: var(--vl-bg); --ap-surface: var(--vl-surface); --ap-surface-2: var(--vl-surface-2);
    --ap-border: var(--vl-border); --ap-border-strong: var(--vl-border-strong);
    --ap-text: var(--vl-text); --ap-muted: var(--vl-text-muted); --ap-faint: var(--vl-text-faint);
    --ap-accent: var(--vl-accent); --ap-gold: var(--vl-gold-text); --ap-shadow: none;
    color: var(--ap-text); font-family: var(--vl-font-body); font-size: 15px; line-height: 1.5;
}
.ap-embed .ap-card { background: var(--vl-surface-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.ap-embed .ap-card.is-glow::before { display: none; }
.ap-embed h2, .ap-embed h3, .ap-embed p, .ap-embed ul, .ap-embed dl { margin: 0; }
.ap-embed .ap-card + .ap-card, .ap-embed .ap-card + .ap-grid { margin-top: 1rem; }
.ap-embed .ap-tile, .ap-embed .ap-rowitem, .ap-embed .ap-score { background: var(--vl-surface); }
/* On a phone the recruit panel and these cards would nest two paddings deep; thin the cards' own. */
@media (max-width: 639.98px) { .ap-embed .ap-card { padding: 1rem .85rem; } }
.ap-invite-box { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; padding: 1rem; border-radius: var(--vl-r); background: var(--vl-surface-2); border: 1px solid var(--vl-border); }
/* The recruit panel's code and invite-link fields — app.css's base is a light-mode white box. */
.ap-code-input { background-color: var(--vl-surface) !important; border: 1px solid var(--vl-border) !important; color: var(--vl-text) !important; box-shadow: none !important; }
.ap-code-input::placeholder { color: var(--vl-text-faint); }
.ap-code-input:focus { border-color: var(--vl-accent) !important; box-shadow: 0 0 0 3px var(--vl-accent-soft) !important; }
.ap-invite-lbl { font-size: 12px; color: var(--vl-text-muted); margin-bottom: .3rem; }

/* ---------- The live background ---------- */
/* One big grid plane, like clickup.com's: ~440px cells, tilted a few degrees
   with a hint of perspective so the lines converge slightly, sliding steadily
   sideways — one cell every 14 s, so the loop is seamless. Edges fade out. */
.ap-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ap-bg-plane {
    position: absolute; inset: -45%;
    background-image:
        linear-gradient(to right, rgba(255,255,255,.11) 1.5px, transparent 1.5px),
        linear-gradient(to bottom, rgba(255,255,255,.11) 1.5px, transparent 1.5px);
    background-size: 440px 440px;
    transform: perspective(1600px) rotateX(10deg) rotateY(-9deg) rotateZ(-5deg);
    transform-origin: 50% 50%;
    animation: ap-plane 14s linear infinite;
    will-change: background-position;
}
.ap-bg::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 70% at 50% 40%, transparent 55%, var(--ap-bg) 100%);
}
.ap-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .32; }
.ap-glow-a { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: radial-gradient(circle, rgba(0,191,255,.38), transparent 62%); animation: ap-drift-a 26s ease-in-out infinite; }
.ap-glow-b { width: 38vw; height: 38vw; right: -10vw; top: 22vh; background: radial-gradient(circle, rgba(255,199,0,.2), transparent 62%); animation: ap-drift-b 32s ease-in-out infinite; }
.ap-glow-c { width: 40vw; height: 40vw; left: 30vw; bottom: -22vw; background: radial-gradient(circle, rgba(0,191,255,.18), transparent 62%); animation: ap-drift-a 38s ease-in-out infinite reverse; }
@keyframes ap-plane { from { background-position: 0 0; } to { background-position: -440px 40px; } }
@keyframes ap-drift-a { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(9vw, 7vh); } }
@keyframes ap-drift-b { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-8vw, 9vh); } }
@media (prefers-reduced-motion: reduce) { .ap-bg-plane, .ap-glow { animation: none; } }
@media (max-width: 767.98px) { .ap-bg-plane { background-size: 300px 300px; } @keyframes ap-plane { from { background-position: 0 0; } to { background-position: -300px 28px; } } .ap-glow { filter: blur(50px); } }

/* ---------- Shell ---------- */
.ap-shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
/* Inside the iOS app the web view runs edge to edge (MainViewController's
   contentInsetAdjustmentBehavior = .never): the bar's own padding has to
   clear the status bar / Dynamic Island, the footer the home indicator.
   env() is 0 in a browser and on Android (its root view pads itself). */
.ap-top {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: calc(.7rem + env(safe-area-inset-top)) max(16px, 4vw, env(safe-area-inset-right)) .7rem max(16px, 4vw, env(safe-area-inset-left)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    background: rgba(9,9,9,.72); border-bottom: 1px solid rgba(255,255,255,.06);
}
/* The website's own lockup (marketing/home's header): icon + wordmark in Big Shoulders. */
.ap-brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; min-width: 0; }
.ap-brand img { height: 44px; width: auto; flex-shrink: 0; }
.ap-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.ap-brand-name { font-family: var(--ap-display); font-weight: 900; font-size: 1.2rem; letter-spacing: .04em; color: #fff; white-space: nowrap; }
.ap-brand-sub { font-family: var(--ap-display); font-weight: 700; font-size: .6rem; letter-spacing: .25em; color: var(--ap-accent); white-space: nowrap; }
@media (max-width: 639.98px) { .ap-brand img { height: 36px; } .ap-brand-name { font-size: 1.05rem; } .ap-brand-sub { font-size: .55rem; } }
.ap-brand-tag { margin-left: .2rem; font-size: 11px; font-weight: 600; color: var(--ap-accent); background: var(--ap-accent-soft); border-radius: 999px; padding: .15rem .55rem; }
.ap-nav { display: flex; align-items: center; gap: .25rem; }
.ap-nav a, .ap-nav button {
    display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: var(--ap-r); text-decoration: none;
    font-size: 14px; font-weight: 500; color: var(--ap-muted); background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.ap-nav a:hover, .ap-nav button:hover { color: var(--ap-text); background: rgba(255,255,255,.06); }
.ap-nav a.is-active { color: var(--ap-text); background: rgba(255,255,255,.08); }
.ap-nav a.ap-btn-gold { margin-left: .35rem; padding: .4rem .85rem; color: var(--ap-gold); background: color-mix(in srgb, var(--ap-cta) 16%, transparent); font-weight: 600; }
.ap-nav a.ap-btn-gold:hover { background: color-mix(in srgb, var(--ap-cta) 26%, transparent); }
.ap-nav .ap-avatar { width: 30px; height: 30px; font-size: 12px; }
@media (max-width: 639.98px) { .ap-nav .ap-nav-label { display: none; } .ap-nav a, .ap-nav button { padding: .45rem .55rem; } .ap-nav a.ap-btn-gold { margin-left: .15rem; font-size: 13px; } }
@media (max-width: 479.98px) { .ap-brand-tag { display: none; } }
.ap-cta-short { display: none; }
@media (max-width: 419.98px) {
    .ap-cta-long { display: none; } .ap-cta-short { display: inline; }
    .ap-top { gap: .5rem; }
    .ap-brand { gap: .5rem; }
}

/* ---------- Bottom tab bar (phone width, signed in) ----------
   The coach app's #vl-bottom-nav in the portal's colours: floating, frosted,
   inset from the edges. The header's icons move into it; only the account
   circle stays at the top. */
.ap-bnav { display: none; }
@media (max-width: 1023.98px) {
    .ap-nav .ap-nav-moves { display: none; }
    .ap-bnav {
        display: flex; position: fixed; z-index: 30;
        left: max(.6rem, env(safe-area-inset-left)); right: max(.6rem, env(safe-area-inset-right)); bottom: calc(.6rem + env(safe-area-inset-bottom));
        padding: .4rem .25rem; border-radius: 1.4rem;
        background: rgba(20,20,20,.78); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid rgba(255,255,255,.08); box-shadow: 0 12px 32px rgba(0,0,0,.45);
        transition: padding .22s ease;
    }
    .ap-bnav > a, .ap-bnav > form { flex: 1 1 0; display: flex; }
    .ap-bnav a, .ap-bnav button {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
        padding: .35rem 0; border-radius: .6rem; background: none; border: 0; cursor: pointer;
        font: inherit; font-size: 11px; font-weight: 600; color: var(--ap-muted); text-decoration: none; -webkit-tap-highlight-color: transparent;
    }
    .ap-bnav svg { width: 21px; height: 21px; transition: width .2s ease, height .2s ease; }
    .ap-bnav-ic { display: inline-flex; padding: 4px 12px; border-radius: var(--ap-r); }
    .ap-bnav-label { display: block; max-height: 1rem; opacity: 1; transition: max-height .2s ease, opacity .12s ease; }
    /* Scrolling down shrinks it to icons (athlete-bnav.js), like the coach app's bar. */
    .ap-bnav.is-collapsed { padding-top: .2rem; padding-bottom: .2rem; }
    .ap-bnav.is-collapsed svg { width: 20px; height: 20px; }
    .ap-bnav.is-collapsed .ap-bnav-label { max-height: 0; opacity: 0; }
    .ap-bnav.is-collapsed a.is-active .ap-bnav-ic { padding: 3px 10px; }
    .ap-bnav a.is-active { color: var(--ap-text); }
    .ap-bnav a.is-active .ap-bnav-ic { background: rgba(255,255,255,.1); }
    .ap-bnav a.is-active .vl-ic-o { display: none; }
    .ap-bnav a.is-active .vl-ic-s { display: block; }
    /* Room for the bar (its height + the float margin) under the last content. */
    .ap-shell.has-bnav .ap-foot { padding-bottom: calc(1.5rem + 4.65rem + env(safe-area-inset-bottom)); }
}

.ap-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 1.5rem max(16px, 4vw, env(safe-area-inset-right)) 4rem max(16px, 4vw, env(safe-area-inset-left)); }
.ap-main.is-narrow { max-width: 520px; }
.ap-foot { padding: 1.5rem max(16px, 4vw) calc(1.5rem + env(safe-area-inset-bottom)); font-size: 12px; color: var(--ap-faint); display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: center; }
.ap-foot a { text-decoration: none; } .ap-foot a:hover { color: var(--ap-muted); }

/* Pull-to-refresh (public/js/athlete-ptr.js): everything under the header
   slides down and the ring draws in the gap. The transform is only set
   while a pull is live, so it never re-parents position:fixed children. */
.ap-shell.ap-ptr-active > .ap-main, .ap-shell.ap-ptr-active > .ap-foot { transform: translateY(var(--ap-ptr-y, 0px)); }
.ap-shell.ap-ptr-settling > .ap-main, .ap-shell.ap-ptr-settling > .ap-foot { transition: transform .45s cubic-bezier(.25, .1, .25, 1); }
#ap-ptr-indicator { position: fixed; z-index: 19; top: var(--ap-ptr-top, 0px); left: 0; right: 0; height: var(--ap-ptr-y, 0px); display: flex; justify-content: center; align-items: center; overflow: hidden; pointer-events: none; }
.ap-shell:not(.ap-ptr-active) #ap-ptr-indicator { display: none; }
.ap-shell.ap-ptr-settling #ap-ptr-indicator { transition: height .45s cubic-bezier(.25, .1, .25, 1); }
#ap-ptr-ring { transform: rotate(-90deg); color: var(--ap-faint); transition: color .15s ease; }
#ap-ptr-ring.ap-ptr-armed { color: var(--ap-text); }
.ap-shell.ap-ptr-settling #ap-ptr-ring circle { transition: stroke-dashoffset .27s ease-out, opacity .27s ease-out; }

/* ---------- Type ---------- */
.ap-h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; }
.ap-h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.1; }
.ap-h3 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.ap-lead { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--ap-muted); max-width: 36rem; }
.ap-eyebrow { font-size: 12px; font-weight: 600; color: var(--ap-accent); letter-spacing: .04em; text-transform: uppercase; }
.ap-muted { color: var(--ap-muted); } .ap-faint { color: var(--ap-faint); }
.ap-small { font-size: 13px; } .ap-xs { font-size: 12px; }
.ap-num { font-family: var(--ap-display); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }

/* ---------- Cards ---------- */
.ap-card {
    position: relative; background: rgba(17,17,17,.88); border: 1px solid var(--ap-border); border-radius: var(--ap-r-lg);
    padding: 1.25rem; box-shadow: var(--ap-shadow); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ap-card + .ap-card, .ap-card + .ap-grid { margin-top: 1rem; }
.ap-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.ap-card-head .ap-h3 { display: flex; align-items: center; gap: .55rem; }
.ap-card-head svg { width: 18px; height: 18px; color: var(--ap-accent); flex-shrink: 0; }
.ap-card.is-glow::before {
    content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; z-index: -1;
    background: linear-gradient(135deg, rgba(0,191,255,.5), transparent 40%, transparent 60%, rgba(255,199,0,.35));
    filter: blur(14px); opacity: .5;
}
.ap-grid { display: grid; gap: 1rem; }
.ap-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ap-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 767.98px) { .ap-grid-3, .ap-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479.98px) { .ap-grid-2 { grid-template-columns: 1fr; } }
.ap-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.ap-layout.is-edit { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 899.98px) { .ap-layout, .ap-layout.is-edit { grid-template-columns: minmax(0, 1fr); } }
.ap-sticky { position: sticky; top: calc(var(--ap-top-h, 4rem) + .5rem); }

/* ---------- Buttons ---------- */
.ap-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem 1.1rem; border-radius: var(--ap-r);
    font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s, transform .1s;
    white-space: nowrap;
}
.ap-btn:active { transform: translateY(1px); }
.ap-btn svg { width: 16px; height: 16px; }
/* Yellow buttons: the main site's top-action look (Home's New Practice /
   New Game) — a soft gold tint with gold text, not a solid yellow fill. */
.ap-btn-primary, .ap-btn-gold { background: color-mix(in srgb, var(--ap-cta) 16%, transparent); color: var(--ap-gold); }
.ap-btn-primary:hover, .ap-btn-gold:hover { background: color-mix(in srgb, var(--ap-cta) 26%, transparent); }
.ap-btn-accent { background: var(--ap-accent); color: #04121a; }
.ap-btn-accent:hover { background: #33ccff; }
.ap-btn-ghost { background: rgba(255,255,255,.04); border-color: var(--ap-border); color: var(--ap-text); }
.ap-btn-ghost:hover { background: rgba(255,255,255,.08); border-color: var(--ap-border-strong); }
.ap-btn-danger { background: transparent; border-color: rgba(248,113,113,.4); color: var(--ap-danger); }
.ap-btn-danger:hover { background: rgba(248,113,113,.1); }
.ap-btn-sm { padding: .4rem .75rem; font-size: 13px; }
.ap-btn-lg { padding: .85rem 1.5rem; font-size: 16px; border-radius: 10px; }
.ap-btn-block { width: 100%; }
.ap-link { color: var(--ap-accent); text-decoration: none; font-weight: 500; } .ap-link:hover { text-decoration: underline; }
.ap-icon-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ap-r-sm); border: 0; background: transparent; color: var(--ap-faint); cursor: pointer; font-size: 18px; line-height: 1; }
.ap-icon-btn:hover { background: rgba(248,113,113,.12); color: var(--ap-danger); }

/* ---------- Forms ---------- */
.ap-field { display: block; margin-bottom: .9rem; min-width: 0; }
.ap-field > span, .ap-label { display: block; font-size: 12px; font-weight: 500; color: var(--ap-muted); margin-bottom: .3rem; }
.ap-input, .ap-select, .ap-textarea {
    width: 100%; appearance: none; background: #0c0c0c; border: 1px solid var(--ap-border); border-radius: var(--ap-r);
    padding: .6rem .75rem; font: inherit; font-size: 15px; color: var(--ap-text); transition: border-color .15s, box-shadow .15s;
}
.ap-input::placeholder, .ap-textarea::placeholder { color: var(--ap-faint); }
.ap-input:focus, .ap-select:focus, .ap-textarea:focus { outline: none; border-color: var(--ap-accent); box-shadow: 0 0 0 3px rgba(0,191,255,.2); }
.ap-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23b4b4b4'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; background-size: 16px; padding-right: 2rem; }
.ap-select option { background: #111; }
.ap-textarea { min-height: 7rem; resize: vertical; }
.ap-input.is-code { font-family: var(--ap-mono, ui-monospace, SFMono-Regular, Menlo, monospace); letter-spacing: .12em; text-transform: uppercase; font-size: 17px; }
/* A titled group inside a card's form (Athletic profile, Swim times, …): a rule above, a white heading. */
.ap-body .ap-subsection { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--ap-border); }
.ap-body .ap-subhead { display: block; font-size: 15px; font-weight: 600; color: var(--ap-text); margin-bottom: .8rem; }
.ap-subhead-note { font-size: 12px; font-weight: 400; color: var(--ap-faint); }
.ap-body .ap-subhead-minor { font-size: 13px; font-weight: 600; color: var(--ap-muted); margin: 0 0 .5rem; }
.ap-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.ap-row > .ap-field { flex: 1 1 10rem; margin-bottom: 0; }
/* A field right under a row of fields gets the same gap the fields keep between themselves. */
.ap-row + .ap-field { margin-top: .9rem; }
/* A field with a hint under it: line the inputs up by their labels, not their bottoms. */
.ap-row-top { align-items: flex-start; }
.ap-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ap-check { display: flex; align-items: flex-start; gap: .55rem; font-size: 14px; color: var(--ap-muted); cursor: pointer; }
.ap-check input { width: 1.05rem; height: 1.05rem; margin: .15rem 0 0; appearance: none; flex-shrink: 0; border: 1px solid var(--ap-border-strong); border-radius: .3rem; background: #0c0c0c; cursor: pointer; }
.ap-check input:checked { background: var(--ap-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2304121a'%3E%3Cpath d='M12.2 5.2a.8.8 0 0 1 0 1.13l-4.4 4.4a.8.8 0 0 1-1.13 0L4.5 8.56a.8.8 0 1 1 1.13-1.12l1.6 1.6 3.84-3.84a.8.8 0 0 1 1.13 0Z'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--ap-accent); }
.ap-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.ap-chip { position: relative; }
.ap-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ap-chip span { display: inline-block; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--ap-border); font-size: 13px; font-weight: 500; color: var(--ap-muted); background: rgba(255,255,255,.03); transition: all .12s; }
.ap-chip input:checked + span { color: #04121a; background: var(--ap-accent); border-color: var(--ap-accent); }
.ap-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,191,255,.3); }
.ap-seg { display: inline-flex; border: 1px solid var(--ap-border); border-radius: var(--ap-r); overflow: hidden; }
.ap-seg label { position: relative; }
.ap-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ap-seg span { display: block; padding: .35rem .7rem; font-size: 12px; font-weight: 600; color: var(--ap-muted); cursor: pointer; }
.ap-seg input:checked + span { background: rgba(255,255,255,.1); color: var(--ap-text); }
.ap-gpa-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.ap-switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ap-muted); }
.ap-switch .on { color: var(--ap-text); }
.ap-switch input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; position: relative; margin: 0; cursor: pointer; flex-shrink: 0;
    width: 34px; height: 20px; border-radius: 999px; border: 1px solid var(--ap-border);
    background: rgba(255,255,255,.08); transition: background-color .15s ease;
}
.ap-switch input[type="checkbox"]::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 999px;
    background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .15s ease;
}
.ap-switch input[type="checkbox"]:checked { background: var(--ap-accent); border-color: var(--ap-accent); }
.ap-switch input[type="checkbox"]:checked::after { transform: translateX(14px); }
.ap-switch input[type="checkbox"]:focus-visible { outline: 2px solid var(--ap-accent); outline-offset: 2px; }
.ap-gpa-of > .ap-field { flex: 0 1 9rem; }
.ap-gpa-of-word { font-size: 13px; color: var(--ap-muted); padding-bottom: .65rem; }
.ap-error { font-size: 13px; color: var(--ap-danger); margin-top: .3rem; }
.ap-help { font-size: 12px; color: var(--ap-faint); margin-top: .3rem; }
.ap-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }

/* ---------- Flash ---------- */
.ap-flash { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--ap-r); font-size: 14px; margin-bottom: 1rem; border: 1px solid; }
.ap-flash-success { background: rgba(74,222,128,.08); border-color: rgba(74,222,128,.3); color: #bbf7d0; }
.ap-flash-error { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.3); color: #fecaca; }
.ap-flash svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: .1rem; }

/* ---------- Avatar / identity ---------- */
.ap-avatar { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: var(--ap-text); background: var(--ap-surface-2); box-shadow: inset 0 0 0 2px rgba(0,191,255,.6); overflow: hidden; flex-shrink: 0; }
.ap-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ap-avatar.is-xl { width: 120px; height: 120px; font-size: 38px; box-shadow: inset 0 0 0 3px rgba(0,191,255,.6), 0 0 0 6px rgba(0,191,255,.12); }
.ap-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--ap-accent-soft); color: var(--ap-accent); border: 1px solid rgba(0,191,255,.35); }
.ap-pill.is-gold { background: rgba(255,199,0,.12); color: var(--ap-gold); border-color: rgba(255,199,0,.4); }
.ap-pill.is-green { background: rgba(74,222,128,.12); color: var(--ap-success); border-color: rgba(74,222,128,.4); }
.ap-pill.is-grey { background: rgba(255,255,255,.06); color: var(--ap-muted); border-color: var(--ap-border); }
.ap-pill .dot { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }

/* ---------- Completeness ring ---------- */
.ap-ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ap-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ap-ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ap-ring .track { stroke: rgba(255,255,255,.08); }
.ap-ring .bar { stroke: var(--ap-accent); stroke-dasharray: 339.3; transition: stroke-dashoffset 1s ease; filter: drop-shadow(0 0 6px rgba(0,191,255,.6)); }
.ap-ring.is-done .bar { stroke: var(--ap-gold); filter: drop-shadow(0 0 6px rgba(255,199,0,.6)); }
.ap-ring-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ap-ring-val .ap-num { font-size: 2.4rem; }
.ap-ring-val small { font-size: 11px; color: var(--ap-muted); margin-top: .15rem; }
.ap-todo { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.ap-todo li { display: flex; align-items: center; gap: .6rem; font-size: 14px; color: var(--ap-muted); }
.ap-todo li a { color: inherit; text-decoration: none; } .ap-todo li a:hover { color: var(--ap-text); }
.ap-todo .tick { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--ap-border-strong); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; }
.ap-todo li.is-done { color: var(--ap-faint); text-decoration: line-through; }
.ap-todo li.is-done .tick { background: var(--ap-success); border-color: var(--ap-success); color: #052e16; }

/* ---------- Lists / rows ---------- */
.ap-rows { display: grid; gap: .5rem; }
.ap-rowitem { display: flex; align-items: center; gap: .9rem; padding: .7rem .9rem; border-radius: var(--ap-r); background: rgba(255,255,255,.03); border: 1px solid var(--ap-border); min-width: 0; }
.ap-rowitem:hover { background: rgba(255,255,255,.05); }
.ap-rowitem .main { flex: 1; min-width: 0; }
.ap-rowitem .title { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-rowitem .sub { display: block; font-size: 12px; color: var(--ap-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-rowitem .ico { width: 34px; height: 34px; border-radius: var(--ap-r-sm); background: rgba(255,255,255,.05); display: inline-flex; align-items: center; justify-content: center; color: var(--ap-accent); flex-shrink: 0; }
.ap-rowitem .ico svg { width: 18px; height: 18px; }
.ap-empty { padding: 1rem; border: 1px dashed var(--ap-border-strong); border-radius: var(--ap-r); font-size: 14px; color: var(--ap-faint); text-align: center; }

/* ---------- Stat tiles & tables ---------- */
.ap-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.ap-tile { padding: .75rem .85rem; border-radius: var(--ap-r); background: rgba(255,255,255,.03); border: 1px solid var(--ap-border); min-width: 0; }
.ap-tile .lbl { font-size: 11px; color: var(--ap-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-tile .val { font-family: var(--ap-display); font-weight: 800; font-size: 1.7rem; line-height: 1.05; margin-top: .3rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-tile.is-empty .val { color: var(--ap-faint); }
/* A stat field: the label wraps inside the tile, the inputs stay level along the row. */
.ap-tile-input { display: flex; flex-direction: column; }
.ap-tile-input .lbl { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; margin-bottom: .3rem; }
.ap-tile-input .ap-input { margin-top: auto !important; }
.ap-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.25rem; }
.ap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ap-table th { font-size: 11px; font-weight: 600; color: var(--ap-muted); text-align: right; padding: .35rem .5rem; border-bottom: 1px solid var(--ap-border); white-space: nowrap; }
.ap-table td { padding: .45rem .5rem; text-align: right; font-variant-numeric: tabular-nums; border-bottom: 1px solid rgba(255,255,255,.04); white-space: nowrap; }
.ap-table th:first-child, .ap-table td:first-child { text-align: left; }
.ap-table td.is-big { font-family: var(--ap-display); font-weight: 800; font-size: 1.15rem; }
/* A game's name over its date in one column, wide enough that a long opponent wraps a few words a line, not one. */
.ap-table td.ap-game-cell { white-space: normal; min-width: 10rem; overflow-wrap: break-word; }
.ap-game-cell span { display: block; font-weight: 600; line-height: 1.3; }
.ap-game-cell small { display: block; font-size: 12px; color: var(--ap-faint); margin-top: .1rem; }
.ap-kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: 14px; }
.ap-kv dt { color: var(--ap-muted); } .ap-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ap-timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--ap-border); display: grid; gap: .8rem; }
.ap-timeline li { position: relative; }
.ap-timeline li::before { content: ''; position: absolute; left: calc(-1.1rem - 6px); top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--ap-gold); box-shadow: 0 0 0 3px rgba(255,199,0,.2); }
.ap-timeline .yr { font-size: 12px; color: var(--ap-faint); }

/* ---------- Code box ---------- */
.ap-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.4rem; letter-spacing: .14em; font-weight: 700; color: var(--ap-gold); background: rgba(255,199,0,.08); border: 1px dashed rgba(255,199,0,.45); border-radius: var(--ap-r); padding: .6rem 1rem; display: inline-block; }

/* ---------- Section nav (profile editor) ---------- */
.ap-secnav { display: grid; gap: .15rem; }
.ap-secnav a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .7rem; border-radius: var(--ap-r); text-decoration: none; font-size: 14px; color: var(--ap-muted); }
.ap-secnav a:hover { background: rgba(255,255,255,.05); color: var(--ap-text); }
.ap-secnav a.is-active { background: rgba(255,255,255,.08); color: var(--ap-text); }
.ap-secnav .st { width: 8px; height: 8px; border-radius: 50%; background: var(--ap-border-strong); flex-shrink: 0; }
.ap-secnav .st.is-done { background: var(--ap-success); }
/* Phone/tablet: the section menu is a strip pinned under the header
   (public/js/athlete-secnav.js measures it and follows the scroll), so any
   section is one tap away from anywhere on the page. */
@media (max-width: 899.98px) {
    .ap-layout.is-edit > .ap-sticky {
        top: var(--ap-top-h, 3.75rem); z-index: 15; margin: 0 calc(-1 * max(16px, 4vw)); padding: .5rem max(16px, 4vw);
        background: rgba(9,9,9,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.06);
    }
    .ap-secnav { display: flex; overflow-x: auto; gap: .3rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .ap-secnav::-webkit-scrollbar { display: none; }
    .ap-secnav a { white-space: nowrap; flex-shrink: 0; padding: .4rem .75rem; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--ap-border); font-size: 13px; }
    .ap-secnav a.is-active { background: var(--ap-accent-soft); border-color: rgba(0,191,255,.45); color: var(--ap-text); }
    .ap-layout.is-edit .ap-section { scroll-margin-top: calc(var(--ap-top-h, 3.75rem) + 4rem); }
}
.ap-section { scroll-margin-top: calc(var(--ap-top-h, 4rem) + 1rem); }
/* A profile section's own title is the top level: bigger than the in-form sub-headings, a cyan bar, a rule below. */
.ap-section > .ap-card-head { margin: -.1rem 0 1.25rem; padding-bottom: .9rem; border-bottom: 1px solid var(--ap-border-strong); }
.ap-section > .ap-card-head .ap-h3 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.ap-section > .ap-card-head .ap-h3::before { content: ''; width: 4px; height: 1.1em; border-radius: 2px; background: var(--ap-accent); flex-shrink: 0; }

/* ---------- Landing ---------- */
.ap-hero { padding: clamp(2.5rem, 8vw, 6rem) 0 2rem; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (max-width: 899.98px) { .ap-hero { grid-template-columns: 1fr; } }
.ap-hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.ap-hero .ap-hero-note { font-size: 13px; color: var(--ap-faint); margin-top: 1.25rem; }
.ap-mock { position: relative; }
.ap-mock .ap-card { animation: ap-float 7s ease-in-out infinite; }
.ap-mock .ap-card:nth-child(2) { width: 68%; margin: 1rem 0 0 auto; animation-delay: -3s; }
@keyframes ap-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .ap-mock .ap-card { animation: none; } }
@media (max-width: 899.98px) { .ap-mock .ap-card:nth-child(2) { display: none; } }
.ap-mock-avatar.is-xl { width: 72px; height: 72px; font-size: 24px; }
/* Phone: the sample card keeps the avatar beside the name instead of
   wrapping it onto a row of its own. */
@media (max-width: 639.98px) {
    .ap-hero { padding-top: 1.75rem; gap: 2rem; }
    .ap-hero-cta .ap-btn { flex: 1 1 auto; justify-content: center; }
    .ap-mock .ap-profile-head { flex-wrap: nowrap; gap: .9rem; align-items: flex-start; }
    .ap-mock .ap-profile-head .who { flex: 1 1 auto; }
    .ap-mock-avatar.is-xl { width: 56px; height: 56px; font-size: 19px; box-shadow: inset 0 0 0 2px rgba(0,191,255,.6), 0 0 0 4px rgba(0,191,255,.12); }
}
.ap-features { margin-top: 3rem; }
.ap-features > .ap-card { margin: 0; }
@media (max-width: 639.98px) {
    .ap-features { grid-template-columns: 1fr; margin-top: 2rem; gap: .75rem; }
    /* One per row: icon beside the text, so three cards don't fill two screens. */
    .ap-features .ap-feature { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: .9rem; padding: 1.1rem; }
    .ap-features .ap-feature .ico { grid-row: span 2; margin: 0; }
}
.ap-final { margin-top: 2rem; text-align: center; padding: clamp(2rem, 6vw, 3.5rem) 1.25rem; border-color: rgba(255,199,0,.3);
    background: radial-gradient(ellipse 70% 90% at 50% 100%, rgba(255,199,0,.1), transparent 70%), rgba(17,17,17,.88); }
.ap-final .ap-lead { margin: .75rem auto 0; }
.ap-final .ap-hero-cta { justify-content: center; }
.ap-feature { padding: 1.4rem; }
.ap-feature .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--ap-accent-soft); color: var(--ap-accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: .9rem; }
.ap-feature .ico svg { width: 20px; height: 20px; }
.ap-feature h3 { font-size: 16px; font-weight: 650; margin-bottom: .35rem; }
.ap-feature p { font-size: 14px; color: var(--ap-muted); text-wrap: pretty; }
/* "How it works": the heading and a short lead above three numbered
   columns, joined by a line through the number badges (a vertical one
   down the left on phones). */
.ap-how { margin-top: 2rem; padding: clamp(1.5rem, 4vw, 2.5rem); }
.ap-how-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem 3rem; flex-wrap: wrap; padding-bottom: 1.75rem; border-bottom: 1px solid var(--ap-border); }
.ap-how-lead { max-width: 26rem; font-size: 14px; color: var(--ap-muted); }
.ap-steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.ap-step { position: relative; display: flex; flex-direction: column; gap: .35rem; }
.ap-step:not(:last-child)::after { content: ''; position: absolute; top: 18px; left: 52px; right: calc(-2rem + 16px); height: 1px; background: linear-gradient(90deg, rgba(255,199,0,.45), var(--ap-border)); }
.ap-step-num { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: .65rem; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ap-gold); background: rgba(255,199,0,.1); box-shadow: inset 0 0 0 1px rgba(255,199,0,.35); }
.ap-step b { font-size: 16px; font-weight: 650; }
.ap-step span:not(.ap-step-num) { font-size: 14px; color: var(--ap-muted); }
@media (max-width: 767.98px) {
    .ap-steps { grid-template-columns: 1fr; gap: 1.5rem; }
    .ap-step { padding-left: 52px; min-height: 36px; }
    .ap-step-num { position: absolute; left: 0; top: -6px; margin: 0; }
    .ap-step:not(:last-child)::after { top: 38px; bottom: calc(-1.5rem - 4px); left: 18px; right: auto; width: 1px; height: auto; background: linear-gradient(180deg, rgba(255,199,0,.45), var(--ap-border)); }
}

/* ---------- Auth card ---------- */
.ap-auth { margin-top: clamp(1rem, 6vh, 4rem); }
.ap-auth .ap-card { padding: 1.75rem; }
.ap-auth-head { text-align: center; margin-bottom: 1.4rem; }
.ap-auth-head .ap-h2 { margin-bottom: .35rem; }
.ap-divider { display: flex; align-items: center; gap: .75rem; color: var(--ap-faint); font-size: 12px; margin: 1.2rem 0; }
.ap-divider::before, .ap-divider::after { content: ''; flex: 1; height: 1px; background: var(--ap-border); }
.ap-invite { display: flex; gap: .7rem; align-items: center; padding: .75rem .9rem; border-radius: var(--ap-r); background: rgba(255,199,0,.07); border: 1px solid rgba(255,199,0,.3); font-size: 14px; margin-bottom: 1.2rem; }
.ap-invite svg { width: 20px; height: 20px; color: var(--ap-gold); flex-shrink: 0; }

/* ---------- Coach's view of a profile (shared partial) ---------- */
.ap-profile-head { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.ap-profile-head .who { flex: 1 1 16rem; min-width: 0; }
.ap-profile-head .name { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.ap-profile-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .4rem; font-size: 14px; color: var(--ap-muted); }
.ap-profile-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.ap-profile-meta svg { width: 14px; height: 14px; color: var(--ap-faint); }
.ap-bio { font-size: 15px; line-height: 1.6; white-space: pre-line; color: var(--ap-text); }
.ap-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.ap-tag { font-size: 12px; font-weight: 500; padding: .25rem .6rem; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--ap-border); color: var(--ap-muted); }
.ap-score { display: inline-flex; flex-direction: column; align-items: center; padding: .6rem .9rem; border-radius: var(--ap-r); background: rgba(255,255,255,.03); border: 1px solid var(--ap-border); min-width: 5rem; }
.ap-score .ap-num { font-size: 1.6rem; } .ap-score small { font-size: 11px; color: var(--ap-muted); margin-top: .2rem; }

/* Icons shared with the coach app (components/nav-icon): it draws an outline
   and a solid version; the solid one shows only on the selected nav item. */
.vl-ic-s { display: none; }
.ap-nav svg { width: 16px; height: 16px; }
.ap-nav a.is-active .vl-ic-o { display: none; }
.ap-nav a.is-active .vl-ic-s { display: inline; }
.ap-icon-btn.is-edit:hover { background: rgba(255,255,255,.07); color: var(--ap-text); }
.ap-editbox { margin-bottom: .5rem; padding: .9rem; border-radius: var(--ap-r); border: 1px solid var(--ap-accent); background: rgba(255,255,255,.03); }

/* ---------- Wallet buttons (home page's "Your code") ---------- */
/* Black pills in the shape of the stores' own badges, until the official
   artwork is dropped in. */
.ap-wallet { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .9rem; }
.ap-wallet-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem .45rem .7rem; border-radius: 10px; background: #000; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.28); font-size: 15px; font-weight: 600; line-height: 1.05; }
.ap-wallet-btn:hover { border-color: rgba(255,255,255,.55); }
.ap-wallet-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.ap-wallet-btn span { display: flex; flex-direction: column; }
.ap-wallet-btn small { font-size: 10px; font-weight: 500; opacity: .85; }
/* Film that plays on the profile (AthleteLink::embed_url) and the schedule's date chips. */
.ap-videos { container-type: inline-size; display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: .9rem; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: .6rem; }
@supports not selector(::-webkit-scrollbar) { .ap-videos { scrollbar-width: thin; scrollbar-color: var(--ap-border-strong) transparent; } }
.ap-videos::-webkit-scrollbar { height: 8px; }
.ap-videos::-webkit-scrollbar-thumb { background: var(--ap-border-strong); border-radius: 999px; }
.ap-videos::-webkit-scrollbar-track { background: transparent; }
.ap-video { margin: 0; min-width: 0; scroll-snap-align: start; }
.ap-film-head { display: inline-flex; align-items: center; gap: .4rem; }
.ap-film-arrow { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid var(--ap-border); border-radius: 999px; background: transparent; color: var(--ap-text); font-size: 18px; line-height: 1; cursor: pointer; }
.ap-film-arrow:hover { border-color: var(--ap-faint); }
.ap-film-size { display: inline-flex; align-items: center; gap: .3rem; height: 28px; padding: 0 .6rem; border: 1px solid var(--ap-border); border-radius: 999px; background: transparent; color: var(--ap-text); font-size: 12px; font-weight: 600; cursor: pointer; }
.ap-film-size:hover { border-color: var(--ap-faint); }
.ap-film-size svg { width: 14px; height: 14px; }
/* A phone already shows the video at the card's full width. */
@media (max-width: 800px) { .ap-film-size { display: none; } }
.ap-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--ap-border); border-radius: var(--ap-r); background: #000; }
.ap-video figcaption { margin-top: .4rem; font-size: 12px; color: var(--ap-faint); overflow-wrap: anywhere; }
.ap-video figcaption b { color: var(--ap-text); font-weight: 600; }
/* One video at a time at a watchable size (720px); on a wide card its marked
   moments sit beside it instead of under it, scrolling within the video's height.
   Bigger: the video takes what the window's height allows, the moments keep at least 18rem on the right. */
.ap-videos:not(.is-big) .ap-video { max-width: 720px; }
.ap-videos.is-big .ap-video { max-width: max(720px, calc((100vh - 300px) * 16 / 9)); }
@container (min-width: 960px) {
    .ap-videos .ap-video:has(.fm-panel) { max-width: none; display: grid; grid-template-columns: minmax(0, 720px) minmax(16rem, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "video side" "cap side" "track side"; column-gap: 1.25rem; }
    .ap-videos.is-big .ap-video:has(.fm-panel) { grid-template-columns: minmax(0, calc((100vh - 300px) * 16 / 9)) minmax(18rem, 1fr); }
    .ap-videos .ap-video:has(.fm-panel) > iframe { grid-area: video; }
    .ap-videos .ap-video:has(.fm-panel) > figcaption { grid-area: cap; }
    .ap-videos .ap-video .fm { display: contents; }
    .ap-videos .ap-video .fm-track { grid-area: track; margin-top: .5rem; }
    /* Height 0 + min-height 100%: the list fills the video's height and scrolls, never stretching the row. */
    .ap-videos .ap-video .fm-panel { grid-area: side; height: 0; min-height: 100%; display: flex; flex-direction: column; padding: .75rem; border: 1px solid var(--ap-border); border-radius: var(--ap-r); background: var(--ap-surface); }
    .ap-videos .ap-video .fm-panel .fm-list { flex: 1; min-height: 0; max-height: none; }
}
.ap-datechip { width: 42px; flex-shrink: 0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; padding: .3rem 0; border-radius: var(--ap-r-sm); background: var(--ap-accent-soft); color: var(--ap-accent); line-height: 1.05; }
.ap-datechip b { font-size: 16px; font-weight: 700; }
.ap-datechip small { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ap-rowitem.is-wrap .title, .ap-rowitem.is-wrap .sub { white-space: normal; overflow-wrap: anywhere; }
/* A trailing button (the coach's "+ Scouting event") drops under the text on a phone instead of squeezing it to one word a line. */
.ap-rowitem.is-wrap { flex-wrap: wrap; }
.ap-rowitem.is-wrap .main { flex: 1 1 10rem; }
/* "Who viewed you": the view count beside each program. */
.ap-count { flex-shrink: 0; text-align: right; font-size: 12px; color: var(--ap-faint); line-height: 1.2; }
.ap-count b { display: block; font-size: 15px; color: var(--ap-text); font-weight: 700; }

/* The Film & Links help line, like the Game film panel's on the coach side. */
.ap-film-sources { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; margin-bottom: .45rem; font-size: 13px; color: var(--ap-muted); }
.ap-film-source { display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .45rem; border: 1px solid var(--ap-border-strong); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ap-text); white-space: nowrap; }
.ap-film-source svg { width: .7rem; height: .7rem; flex: none; color: var(--ap-muted); }

/* Marked moments (css/film-moments.css runs on the coach tokens). A coach's
   page has them already; the portal's own pages map them here. */
.ap-body .fm {
    --vl-accent: var(--ap-accent); --vl-accent-soft: var(--ap-accent-soft); --vl-border: var(--ap-border); --vl-border-strong: var(--ap-border-strong);
    --vl-cta: var(--ap-cta); --vl-danger: var(--ap-danger); --vl-success: var(--ap-success); --vl-surface: var(--ap-surface);
    --vl-text: var(--ap-text); --vl-text-muted: var(--ap-muted); --vl-text-faint: var(--ap-faint);
    --vl-row-hover: var(--ap-surface-2); --vl-row-active: var(--ap-surface-hover);
    --vl-r-sm: var(--ap-r-sm); --vl-r: var(--ap-r); --vl-r-lg: var(--ap-r-lg); --vl-r-pill: 999px;
}
.ap-video .fm { padding: 0 .1rem; }
