/* Shared shell for the signed-in app pages (dashboard, program, video
   analysis): design tokens, page header, phone tab bar and slim footer.
   Pages opt in with <body class="app">. The marketing pages keep main.css. */
:root {
    --bg: #0a0a0b;
    --surface-1: #121214;
    --surface-2: #17171b;
    --surface-3: #1e1e23;
    --border: #26262c;
    --border-strong: #34343c;
    --text: #f4f4f5;
    --text-dim: #a1a1aa;
    --text-faint: #8b8b94;          /* 5.6:1 on surface-1: small labels stay readable */
    --accent: var(--accent, #dc2626);
    --accent-hi: #f87171;
    --accent-soft: rgba(220, 38, 38, .12);
    --accent-line: rgba(220, 38, 38, .42);
    --ok: #22c55e;
    --ok-hi: #86efac;
    --ok-soft: rgba(34, 197, 94, .1);
    --warn: #f59e0b;
    --gold: #f5b544;
    --radius: 18px;
    --radius-md: 12px;
    --radius-sm: 9px;
    --pill: 999px;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 14px 40px -18px rgba(0, 0, 0, .8);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --t: 180ms var(--ease);
    --tabbar-h: 64px;
}

body.app { background: var(--bg); }
.app [hidden] { display: none !important; }

/* The marketing site's red heading glow blurs text inside the app. The nav
   logo keeps its glow. */
.app :is(main, .dlg-backdrop, .up-backdrop, .app-footer) :is(h1, h2, h3, h4, h5, h6),
.app .stat-number { text-shadow: none; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 3000; padding: .6rem 1rem;
    background: var(--accent); color: var(--on-accent, #fff); border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page header (Program, Video analysis) ---------- */
.page-head { position: relative; padding: 100px 0 18px; overflow: hidden; }
.page-head::before { content: ""; position: absolute; inset: 0 -10% auto; height: 320px; pointer-events: none;
    background: radial-gradient(55% 70% at 15% 35%, rgba(var(--accent-rgb, 220, 38, 38), .2), transparent 70%); }
.page-head .ph-in { position: relative; max-width: 1120px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .ph-kicker { margin: 0; color: var(--accent-hi); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-head h1 { margin: .25rem 0 .35rem; font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 800; line-height: 1.1;
    letter-spacing: -.025em; color: var(--text); }
.page-head .ph-sub { margin: 0; color: var(--text-dim); font-size: 1rem; max-width: 58ch; line-height: 1.55; }

/* ---------- cards, shared by the app pages ---------- */
.card { position: relative; min-width: 0; padding: 20px; border-radius: var(--radius); background: var(--surface-1);
    border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { margin: 0 0 14px; font-size: .8rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.card-head .card-title { margin: 0; }
.card-sub { color: var(--text-faint); font-size: .8rem; font-variant-numeric: tabular-nums; }
.text-link { color: var(--accent-hi); font-size: .85rem; font-weight: 600; text-decoration: none; min-height: 44px;
    display: inline-flex; align-items: center; }
.text-link:hover { text-decoration: underline; }

/* skeletons while data loads (space reserved, no layout jump) */
.skel-line, .skel-block { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.skel-line { height: 14px; margin: 0 0 12px; }
.skel-line.tall { height: 28px; }
.skel-line.w40 { width: 40%; } .skel-line.w60 { width: 60%; } .skel-line.w70 { width: 70%; }
.skel-line::after, .skel-block::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- analysis rows (dashboard, video analysis) ---------- */
.an { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-md);
    background: var(--surface-2); border: 1px solid var(--border); }
.an-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); }
.an-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.an-ic.failed { background: var(--surface-3); color: var(--text-faint); }
.an h3 { margin: 0; font-size: .95rem; font-weight: 700; color: var(--text); }
.an h3 span { color: var(--text-faint); font-weight: 500; }
.an p { margin: 2px 0 0; color: var(--text-faint); font-size: .8rem; font-variant-numeric: tabular-nums; }
.an .flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.flag { font-size: .7rem; padding: 2px 8px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-hi);
    border: 1px solid var(--accent-line); }
.flag.clean { background: var(--ok-soft); color: var(--ok-hi); border-color: rgba(34, 197, 94, .35); }
.flag.muted { background: var(--surface-3); color: var(--text-dim); border-color: var(--border-strong); }
.an-del { width: 44px; height: 44px; border-radius: 10px; border: none; background: transparent; color: var(--text-faint); cursor: pointer;
    display: grid; place-items: center; transition: color var(--t), background var(--t); }
.an-del svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.an-del:hover { color: #fca5a5; background: rgba(220, 38, 38, .1); }
.an-del:focus-visible { outline: 2px solid var(--accent-hi); }
.an-del:disabled { opacity: .5; cursor: progress; }
.recent-more { grid-column: 1 / -1; justify-self: start; margin-top: 2px; background: none; border: none; color: var(--accent-hi); font: inherit; font-size: .85rem; font-weight: 600;
    cursor: pointer; min-height: 44px; padding: 0; }
/* rows that reopen a past analysis: the whole row on the Analyze page, the
   lift name (stretched over the row, delete button above it) on the dashboard */
.an { position: relative; transition: border-color var(--t); }
.an-link { color: inherit; text-decoration: none; }
.an-link:hover, .an:has(.an-open:hover) { border-color: var(--accent-line); }
.an-link:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.an-open { color: inherit; text-decoration: none; }
.an-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-md); }
.an-open:focus-visible { outline: none; }
.an:has(.an-open:focus-visible) { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.an-del { position: relative; z-index: 1; }
.empty { grid-column: 1 / -1; text-align: center; padding: 18px 8px; color: var(--text-dim); }
.empty p { margin: 0 0 14px; }

/* ---------- nav: Account link (desktop) ---------- */
.app .nav-menu .nav-account { color: var(--text-dim); }

/* ---------- phone tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 768px) {
    /* On phones the app navigates from the bottom bar; the top bar is just the logo. */
    .app .hamburger, .app .nav-menu { display: none !important; }
    .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(10, 10, 11, .94);
        border-top: 1px solid var(--border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
    .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px;
        border-radius: 12px; color: var(--text-faint); text-decoration: none; font-size: .7rem; font-weight: 600;
        letter-spacing: .01em; -webkit-tap-highlight-color: transparent; transition: color var(--t), background var(--t); }
    .tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .tab:active { background: var(--surface-2); }
    .tab:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: -2px; }
    .tab[aria-current="page"] { color: var(--text); }
    .tab[aria-current="page"] svg { color: var(--accent-hi); }
    body.app { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
    .page-head { padding-top: 84px; }
}

/* ---------- slim footer ---------- */
.app-footer { border-top: 1px solid var(--border); padding: 18px 16px; color: var(--text-faint); font-size: .8rem; }
.app-footer .af-in { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 4px 20px; }
.app-footer nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.app-footer a { color: var(--text-dim); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.app-footer a:hover { color: var(--text); text-decoration: underline; }
.app-footer a:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .tab { transition: none; }
    .skel-line::after, .skel-block::after { animation: none; }
}

/* Trim to the set (js/trim-picker.js): Analyze page and the Program page's upload dialog */
.trim-panel { margin-top: 12px; padding: 14px 16px 16px; border-radius: var(--radius-md);
    background: var(--surface-2); border: 1px solid var(--border); }
.trim-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.trim-head h4 { margin: 0; color: var(--text); font-size: .95rem; font-weight: 700; }
.trim-sel { color: var(--accent-pale, #fca5a5); font-variant-numeric: tabular-nums; font-size: .86rem; font-weight: 600; }
.trim-hint { margin: .3rem 0 0; color: var(--text-dim); font-size: .86rem; line-height: 1.5; }
.trim-range { position: relative; height: 44px; margin: .7rem 0 .5rem; touch-action: none; }
.trim-track { position: absolute; left: 18px; right: 18px; top: 50%; height: 6px; margin-top: -3px;
    border-radius: 3px; background: var(--border-strong); }
.trim-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; border-radius: 3px; background: var(--accent); }
.trim-range input[type=range] { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0;
    background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.trim-range input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 44px; }
.trim-range input[type=range]::-moz-range-track { background: transparent; }
.trim-range input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; appearance: none;
    width: 34px; height: 34px; margin-top: 5px; border-radius: 50%; cursor: grab;
    background: #fff; border: 4px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.trim-range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 26px; height: 26px; border-radius: 50%; cursor: grab;
    background: #fff; border: 4px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.trim-range input[type=range]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--accent-pale, #fca5a5); outline-offset: 2px; }
.trim-range input[type=range]:focus-visible::-moz-range-thumb { outline: 3px solid var(--accent-pale, #fca5a5); outline-offset: 2px; }
.trim-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.trim-btn { min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm); cursor: pointer;
    background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text);
    font: inherit; font-weight: 600; font-size: .86rem; transition: background var(--t); }
.trim-btn:hover { background: #26262c; }
.trim-btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.trim-reset { margin-left: auto; background: transparent; color: var(--text-dim); }
.trim-nudge { margin: .7rem 0 0; padding: 10px 12px; border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .35); color: #fecaca;
    font-size: .86rem; line-height: 1.5; }
@media (max-width: 480px) {
    .trim-btn { flex: 1 1 auto; }
    .trim-reset { margin-left: 0; flex-basis: 100%; }
}

/* ---- Where was the camera? (js/camera-picker.js) ---- */
.cam-choice { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px;
    border-radius: var(--radius-md); border: 1px solid var(--accent-line, rgba(220, 38, 38, .45)); background: rgba(var(--accent-rgb, 220, 38, 38), .08);
    color: var(--text); text-align: left; font: inherit; cursor: pointer; margin-top: 8px; }
.cam-choice:hover { border-color: var(--accent-hi); }
.cam-choice:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.cam-ic { width: 40px; height: 40px; flex: none; fill: none; stroke: var(--text-dim); stroke-width: 1.4; stroke-linecap: round; }
.cam-ic .cam-dot { fill: var(--accent-hi); stroke: none; }
.cam-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cam-txt strong { font-size: .95rem; }
.cam-txt small { color: var(--text-dim); font-size: .8rem; }
.cam-change { color: var(--accent-hi); font-size: .85rem; font-weight: 600; flex: none; }
/* No position picked yet: the lifter has to choose one before analyzing. */
.cam-choice.is-unset { border-style: dashed; border-color: var(--accent-hi); }
.cam-choice.is-unset .cam-txt strong { color: var(--accent-hi); }

.cp-backdrop { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(0, 0, 0, .66); }
.cp-dialog { position: relative; width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px 18px 18px;
    border-radius: var(--radius, 16px); background: var(--surface-1); border: 1px solid var(--border); color: var(--text); }
.cp-dialog h2 { margin: 0 44px 4px 0; font-size: 1.15rem; line-height: 1.3; text-shadow: none; letter-spacing: -.01em; }
.cp-sub { margin: 0 0 10px; color: var(--text-dim); font-size: .85rem; line-height: 1.45; }
.cp-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent;
    color: var(--text-dim); cursor: pointer; display: grid; place-items: center; }
.cp-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cp-x:hover { background: var(--surface-3); color: var(--text); }
.cp-stage { touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; border-radius: var(--radius-md);
    background: radial-gradient(ellipse at 50% 70%, #1d1d22 0%, #121214 70%); }
.cp-stage:active { cursor: grabbing; }
.cp-scene { display: block; width: 100%; height: auto; max-height: 42dvh; margin: 0 auto; }
.cp-platform { fill: #1f1f25; stroke: #2c2c33; stroke-width: 1; }
.cp-ring { fill: none; stroke: #3a3a42; stroke-width: 1.2; stroke-dasharray: 3 4; }
.cp-facing { stroke: #6b6b75; stroke-width: 2; }
.cp-arrowhead { fill: #6b6b75; }
.cp-body, .cp-head { stroke: #b9b9c4; fill: #b9b9c4; stroke-linecap: round; }
.cp-head { stroke: none; }
.cp-bench { stroke: #4a4a55; fill: #4a4a55; stroke-linecap: round; }
.cp-bar { stroke: #d6d6de; stroke-linecap: round; }
.cp-plate { fill: #b91c1c; stroke: #7f1d1d; stroke-width: 1; }
.cp-cam { cursor: pointer; }
.cp-hit { fill: transparent; }
.cp-stand { stroke: #3a3a42; stroke-width: 1.5; }
.cp-dot { fill: #2a2a31; stroke: #8a8a95; stroke-width: 1.6; }
.cp-cam text { fill: var(--text-dim); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: #121214; stroke-width: 3px; }
.cp-cam:hover .cp-dot { stroke: var(--text); }
.cp-cam.is-on .cp-dot { fill: var(--accent); stroke: #fff; }
.cp-cam.is-on text { fill: var(--text); }
.cp-cam.is-off .cp-dot { fill: #1a1a1e; stroke: #444; stroke-dasharray: 2 2; }
.cp-cam.is-off text { fill: #5c5c66; }
.cp-sight { stroke: var(--accent-hi); stroke-width: 1.5; stroke-dasharray: 4 4; }
.cp-turn { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 12px; }
.cp-rot { width: 44px; height: 44px; flex: none; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-dim); cursor: pointer; display: grid; place-items: center; }
.cp-rot svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cp-rot:hover { color: var(--text); }
.cp-picked { flex: 1; text-align: center; font-size: .88rem; color: var(--text); }
.cp-list { border: 0; margin: 0; padding: 0; }
.cp-list > div { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cp-opt { position: relative; display: block; padding: 9px 10px; min-height: 44px; border-radius: var(--radius-sm, 10px);
    border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.cp-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cp-opt strong { display: block; font-size: .86rem; }
.cp-opt small { display: block; color: var(--text-faint); font-size: .74rem; line-height: 1.35; margin-top: 2px; }
.cp-opt.is-on { border-color: var(--accent); background: rgba(var(--accent-rgb, 220, 38, 38), .1); }
.cp-opt.is-off { opacity: .55; cursor: not-allowed; }
.cp-opt:has(input:focus-visible) { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.cp-actions { margin-top: 14px; }
.cp-actions .btn { width: 100%; min-height: 46px; }
@media (max-width: 420px) { .cp-list > div { grid-template-columns: 1fr; } }

/* ---- point out the bar or the lifter (js/tap-rerun.js) ---- */
.tr-backdrop { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(0, 0, 0, .7); }
.tr-dialog { position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px 18px 18px;
    border-radius: var(--radius, 16px); background: var(--surface-1); border: 1px solid var(--border); color: var(--text); }
.tr-dialog h2 { margin: 0 44px 4px 0; font-size: 1.15rem; line-height: 1.3; text-shadow: none; }
.tr-sub { margin: 0 0 10px; color: var(--text-dim); font-size: .88rem; line-height: 1.45; }
.tr-stage { position: relative; background: #000; border-radius: var(--radius-md); overflow: hidden; cursor: crosshair; touch-action: manipulation; }
.tr-stage video { position: relative; z-index: 0; display: block; width: 100%; height: auto; max-height: 52dvh; object-fit: contain; background: #000; }
.tr-mark { position: absolute; z-index: 2; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none;
    border: 3px solid #fff; box-shadow: 0 0 0 3px var(--accent), 0 0 12px rgba(0, 0, 0, .6); }
.tr-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--text-dim); font-size: .9rem; }
.tr-loading[hidden] { display: none; }
.tr-controls { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.tr-controls input[type=range] { flex: 1; min-height: 44px; accent-color: var(--accent); }
.tr-time { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: .85rem; min-width: 3.6em; text-align: right; }
.tr-msg { margin: 6px 0 0; min-height: 1.3em; font-size: .88rem; color: var(--text); }
.tr-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.tr-actions .btn { min-height: 46px; flex: 1 1 auto; }
.tr-foot { margin: 10px 0 0; color: var(--text-faint); font-size: .8rem; }
.rerun-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-hi); font-weight: 600; cursor: pointer;
    text-decoration: underline; min-height: 44px; }
.no-reps-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.no-reps-actions .no-reps-btn { margin-top: 0; }

/* ---- Camera setup check (js/setup-check.js) ---- */
.setup-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0; padding: 12px 14px;
    border-radius: var(--radius-md); border: 1px solid var(--border); background: rgba(255, 255, 255, .02);
    color: var(--text-dim); font-size: .88rem; line-height: 1.5; }
.setup-check[hidden] { display: none; }
.setup-check strong { display: block; color: var(--text); font-weight: 600; }
.setup-check p { margin: 2px 0 0; }
.setup-check ul { margin: 6px 0 0; padding-left: 1.1em; }
.setup-check li { margin: 4px 0 0; }
.setup-check li b { color: var(--text); font-weight: 600; }
.setup-check .sc-foot { margin-top: 8px; color: var(--text-faint); font-size: .82rem; }
.setup-check svg { width: 20px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.setup-check[data-state="ok"] { border-color: rgba(34, 197, 94, .35); background: var(--ok-soft); }
.setup-check[data-state="ok"] svg { color: var(--ok); }
.setup-check[data-state="issues"] { border-color: rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .07); }
.setup-check[data-state="issues"] svg { color: var(--warn); }
.sc-spin { width: 18px; height: 18px; flex: none; margin-top: 2px; border-radius: 50%;
    border: 2px solid var(--border-strong); border-top-color: var(--text-dim); animation: sc-spin .9s linear infinite; }
@keyframes sc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sc-spin { animation: none; border-top-color: var(--border-strong); } }

/* ---- Upload speed note (API.uploadMeter / uploadNote) ---- */
.net-note { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .86rem; line-height: 1.5;
    border: 1px solid rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .08); color: #fde68a; }
.net-note[hidden] { display: none; }
.net-note.bad { border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .08); color: #fecaca; }

/* ---- The plate sheet (js/plate-ui.js), Program and Tools pages ---- */
.pm-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .72); }
.pm-dialog { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px;
    border-radius: var(--radius-lg, 18px); background: var(--surface-1, #111); border: 1px solid var(--border); }
.pm-dialog h2 { margin: 0 44px 12px 0; font-size: 1.02rem; color: var(--text); }
.pm-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center;
    background: none; border: 0; color: var(--text-dim); cursor: pointer; }
.pm-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pm-total { display: flex; align-items: baseline; gap: 10px; }
.pm-total strong { font-size: 1.9rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.pm-total span { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.pm-note { margin: 4px 0 0; color: var(--text-dim); font-size: .85rem; line-height: 1.45; }
.pm-bar { display: block; width: 100%; height: auto; margin: 12px 0 6px; }
.pm-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pm-label { color: var(--text-dim); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 32px; padding: 0 8px;
    border-radius: 8px; font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.pm-none { color: var(--text-dim); font-size: .9rem; }
.pm-setup-line { margin: 10px 0 0; color: var(--text-faint); font-size: .8rem; }
.pm-edit { margin-top: 6px; background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; font-weight: 600;
    color: var(--accent-hi); cursor: pointer; min-height: 44px; }
.pm-form { display: grid; gap: 12px; }
.pm-seg { display: flex; gap: 8px; margin: 0; padding: 0; border: 0; }
.pm-seg legend, .pm-plates legend { width: 100%; margin-bottom: 6px; color: var(--text-dim); font-size: .8rem; font-weight: 600; }
.pm-seg label { flex: 1; }
.pm-seg input, .pm-plates input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pm-seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); color: var(--text-dim); font-weight: 600; cursor: pointer; }
.pm-seg input:checked + span { border-color: var(--accent-hi); color: var(--text); background: rgba(var(--accent-rgb, 220, 38, 38), .1); }
.pm-field { display: grid; gap: 6px; color: var(--text-dim); font-size: .8rem; font-weight: 600; }
.pm-field select { min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; }
.pm-plates { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.pm-plates span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-dim); font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.pm-plates i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); }
.pm-plates input:checked + span { border-color: var(--accent-hi); color: var(--text); background: rgba(var(--accent-rgb, 220, 38, 38), .1); }
.pm-seg input:focus-visible + span, .pm-plates input:focus-visible + span { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.pm-err { margin: 0; color: #fca5a5; font-size: .85rem; }
.pm-actions { display: flex; align-items: center; gap: 16px; }
.pm-actions .btn { min-height: 46px; }
.pm-actions .text-link { background: none; border: 0; font: inherit; color: var(--accent-hi); font-weight: 600; cursor: pointer; }
.pm-warm { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.pm-warm h3 { margin: 0 0 8px; color: var(--text-dim); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pm-warm ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pm-warm li { display: grid; grid-template-columns: 5.5em 4.5em 1fr; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.pm-w { color: var(--text); font-weight: 700; }
.pm-r { color: var(--text-dim); font-size: .85rem; }
.pm-p { color: var(--text-faint); font-size: .8rem; }
.pm-warm .pm-top .pm-w, .pm-warm .pm-top .pm-r { color: var(--accent-hi); }

/* On/off switch (Account settings, Meet Day) */
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 46px; height: 28px; margin: 0;
    border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); cursor: pointer; transition: background var(--t); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: var(--text-dim); transition: transform var(--t), background var(--t); }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(18px); background: var(--on-accent, #fff); }
.switch:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.switch:disabled { opacity: .55; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

/* Share-image dialog (lifter card on the dashboard, meet recap on Meet Day) */
.ss-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
    background: rgba(0, 0, 0, .72); }
.ss-dialog { position: relative; width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px;
    border-radius: var(--radius-lg, 18px); background: var(--surface-1, #111); border: 1px solid var(--border); }
.ss-dialog h2 { margin: 0 0 12px; font-size: 1.05rem; color: var(--text); }
.ss-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center;
    background: none; border: 0; color: var(--text-dim); cursor: pointer; }
.ss-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ss-frame { aspect-ratio: 9 / 16; max-height: 60dvh; margin: 0 auto; border-radius: 14px; overflow: hidden;
    background: #0b0b0d; border: 1px solid var(--border); }
.ss-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ss-check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 8px; color: var(--text-dim);
    font-size: .9rem; cursor: pointer; }
.ss-check input { width: 18px; height: 18px; accent-color: var(--accent-hi); }
.ss-actions { display: flex; gap: 10px; margin-top: 10px; }
.ss-actions .btn { flex: 1; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- notes between a lifter and their coach (js/analysis-notes.js) ---------- */
.an-notes { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.an-notes-title { margin: 0 0 10px; font-size: 1rem; font-weight: 700; color: var(--text); }
.an-notes-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.an-note { padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.an-note.by-coach { border-left: 3px solid var(--accent-hi); }
.an-note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--text-dim); }
.an-note-head strong { color: var(--text); font-size: .88rem; }
.an-note-rep { padding: 1px 8px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-hi); font-weight: 600; }
.an-note-time { color: var(--text-faint); }
.an-note-del { margin-left: auto; min-height: 32px; padding: 0 8px; background: none; border: 0; color: var(--text-faint); cursor: pointer; font: inherit; }
.an-note-del:hover, .an-note-del:focus-visible { color: var(--accent-hi); }
.an-note p { margin: 6px 0 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.an-notes-empty { color: var(--text-faint); margin: 0 0 10px; }
.an-note-form textarea { width: 100%; min-height: 64px; padding: 10px 12px; border-radius: var(--radius-sm); resize: vertical;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: 16px; }
.an-note-form textarea:focus { outline: 2px solid var(--accent-hi); outline-offset: 1px; }
.an-note-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.an-note-row select { min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm); background: var(--surface-2);
    border: 1px solid var(--border); color: var(--text); font: inherit; }
.an-note-row .btn { padding: .6rem 1.2rem; min-height: 44px; }
.an-note-msg { margin: 6px 0 0; color: var(--accent-hi); font-size: .85rem; min-height: 1em; }
.result-extras { margin-top: 16px; }
.result-extras .cmp-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent-hi);
    font-weight: 600; text-decoration: none; }
.result-extras .cmp-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
