/* The free in-browser analyser. The result panel mirrors the iOS result screen
   (WorkoutReportScreen.swift / AnalysisStyle), so its colours are the app's. */
:root {
  --good: #30d158;
  --warning: #ffd60a;
  --issue: #ed335c;
  --label: 235, 235, 245;
  --card: #121316;
  --card-emphasized: #17181b;
  --hairline: rgba(255, 255, 255, 0.07);
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.analyzer { min-height: calc(100vh - 160px); }
.stage { padding: 64px 0 96px; }
.stage[hidden] { display: none; }
.narrow { max-width: 520px; text-align: center; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* 1 · Pick */
.pick-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.pick-copy .eyebrow { color: var(--muted); margin-bottom: 25px; }
.pick-copy :is(h1, h2) span { color: var(--accent); }
.pick-description { color: #b8b8bb; font-size: 18px; line-height: 1.65; max-width: 440px; margin: 28px 0 26px; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.tips li { display: flex; gap: 12px; align-items: baseline; }
.tips li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); flex: none; transform: translateY(-2px); }
.tips.centered { justify-items: center; margin: 22px 0 30px; }

.drop-zone {
  display: grid; justify-items: center; gap: 10px; text-align: center; cursor: pointer;
  padding: 72px 28px; border-radius: 28px; border: 1.5px dashed #3a3a40;
  background: radial-gradient(circle at 50% 20%, #1c1e23, #0e0f12 70%);
  transition: border-color 150ms, background 150ms;
}
.drop-zone.dragging { border-color: var(--accent); }
.drop-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
.drop-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--ink); margin-bottom: 8px; }
.drop-icon svg { width: 26px; height: 26px; }
.drop-zone strong { font-size: 21px; font-weight: 650; letter-spacing: -0.03em; }
.drop-hint { font-size: 13px; color: var(--muted); }
.private-line { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.private-line svg { width: 16px; height: 16px; flex: none; }

/* 2 · Analysing */
.analyzing-frame { position: relative; width: min(100%, 300px); margin: 0 auto; border-radius: 24px; overflow: hidden; background: #000; aspect-ratio: 9 / 16; }
.analyzing-frame video, .analyzing-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage-title { font-size: 28px; letter-spacing: -0.04em; margin-top: 28px; }
.stage-title.left, .stage-note.left { text-align: left; }
.stage-note { color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 10px; }
.progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin: 18px auto 0; max-width: 300px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 200ms linear; }
.ghost-button { margin-top: 22px; padding: 12px 22px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: var(--text); font-size: 15px; font-weight: 600; }
.primary-button { width: 100%; height: 56px; border: 0; border-radius: 999px; background: #fff; color: #000; font-size: 17px; font-weight: 600; margin-top: 22px; }

/* 3 · Angle */
.angle-options { display: grid; gap: 10px; margin-top: 24px; text-align: left; }
.angle-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 16px 18px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.1); background: var(--card); color: var(--text); text-align: left; }
.angle-option[aria-checked="true"] { border-color: var(--text); background: var(--card-emphasized); }
.angle-option strong { font-size: 17px; font-weight: 600; display: block; }
.angle-option small { font-size: 13px; color: rgba(var(--label), 0.6); }
.best-guess { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); white-space: nowrap; }

/* 4 · Result: the app's result screen, then the full analysis */
.result-layout { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 96px; align-items: start; }
.phone-column { min-width: 0; }
.report { background: #000; border-radius: 36px; border: 1px solid #222225; padding: 20px 18px 24px; color: #fff; }
.report-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.report-brand img { width: 34px; height: 34px; border-radius: 8px; }
.report-meta { color: rgba(var(--label), 0.6); font-size: 14px; margin-top: 10px; }
.result-card { margin-top: 14px; padding: 18px 0 14px; border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.06); background: radial-gradient(circle at 50% 20%, #1c1e23, #0e0f12 320px); text-align: center; }
.ring { position: relative; width: 184px; height: 184px; margin: 0 auto; }
.ring > svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: rgba(255, 255, 255, 0.1); }
.ring .fill { stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring-video { position: absolute; inset: 17px; border-radius: 50%; overflow: hidden; border: 0; padding: 0; background: #1c1f24; cursor: pointer; }
.ring-video img { width: 100%; height: 100%; object-fit: cover; }
.ring-video::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); }
.ring-play { position: absolute; z-index: 1; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; }
.ring-play svg { width: 18px; height: 18px; margin-left: 3px; }
.ring-score { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); display: flex; align-items: baseline; gap: 2px; height: 32px; padding: 0 13px; border-radius: 999px; color: #000; font-family: var(--rounded); }
.ring-score b { font-size: 19px; font-weight: 800; line-height: 32px; }
.ring-score small { font-size: 12px; font-weight: 700; opacity: 0.6; }
.result-summary { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 26px; padding: 0 16px; }
.result-detail { font-size: 14px; color: rgba(var(--label), 0.6); margin-top: 2px; }

.bars { display: grid; grid-template-columns: 1fr 1fr; margin-top: 24px; text-align: left; }
.bars-column { display: grid; gap: 18px; align-content: start; padding: 0 16px; }
.bars-column:first-child { border-right: 1px solid rgba(255, 255, 255, 0.08); }
.bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bar-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.bar-label svg { width: 14px; height: 14px; color: rgba(var(--label), 0.6); flex: none; }
.focus-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--issue); flex: none; }
.bar-score { font-family: var(--rounded); font-size: 26px; font-weight: 700; line-height: 1.1; }
.bar-track { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); margin-top: 6px; overflow: hidden; }
.bar-track span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar-caption { font-size: 12px; color: rgba(var(--label), 0.5); margin-top: 6px; }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 18px; font-size: 12px; color: rgba(var(--label), 0.5); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 4px; border-radius: 2px; }
.legend i.dot { width: 6px; height: 6px; border-radius: 50%; }

.full-button { display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; width: 100%; height: 56px; margin-top: 16px; padding: 0 22px; border: 0; border-radius: 999px; background: #fff; color: #000; font-size: 17px; font-weight: 600; }
.full-button span { grid-column: 2; }
.full-button svg { width: 20px; height: 20px; transition: transform 200ms; }
.full-button[aria-expanded="true"] svg { transform: rotate(90deg); }

/* The full analysis (FullReportScreen) */
.full-report[hidden] { display: none; }
.full-report { margin-top: 28px; }
.report-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.report-title h3 { font-size: 30px; letter-spacing: -0.03em; }
.report-title p { font-size: 15px; color: rgba(var(--label), 0.6); }
.report-title .big-score { font-family: var(--rounded); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.report-title .big-score small { font-family: inherit; font-size: 15px; font-weight: 400; color: rgba(var(--label), 0.5); letter-spacing: 0; }
.section-header { font-size: 13px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(var(--label), 0.55); margin: 26px 0 10px; }
.section-header.issue { color: var(--issue); }
.issue-card { padding: 18px; border-radius: 24px; background: var(--card-emphasized); border: 1px solid rgba(255, 255, 255, 0.08); }
.issue-card + .issue-card { margin-top: 10px; }
.issue-card .rank { font-size: 13px; font-weight: 700; letter-spacing: 0.07em; color: var(--issue); }
.issue-card h4 { font-size: 24px; letter-spacing: -0.02em; margin-top: 4px; }
.issue-card .headline { font-size: 15px; line-height: 1.5; color: rgba(var(--label), 0.7); margin-top: 6px; }
.issue-card details { margin-top: 12px; border-top: 1px solid var(--hairline); }
.issue-card summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 0 16px; height: 36px; border-radius: 999px; background: #fff; color: #000; font-size: 15px; font-weight: 600; }
.issue-card summary::-webkit-details-marker { display: none; }
.issue-card dl { margin-top: 14px; display: grid; gap: 12px; }
.issue-card dt { font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(var(--label), 0.5); }
.issue-card dd { font-size: 15px; line-height: 1.5; margin-top: 2px; }
.panel { border-radius: 24px; background: var(--card); padding: 4px 18px; }
.metric-row { padding: 16px 0; }
.metric-row + .metric-row { border-top: 1px solid var(--hairline); }
.metric-row-head { display: flex; align-items: center; gap: 10px; }
.metric-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); color: rgba(var(--label), 0.8); flex: none; }
.metric-icon svg { width: 15px; height: 15px; }
.metric-row-head h4 { flex: 1; font-size: 13px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(var(--label), 0.55); }
.metric-row-head b { font-family: var(--rounded); font-size: 20px; }
.metric-row.issue .metric-icon, .metric-row.issue h4, .metric-row.issue b { color: var(--issue); }
.metric-row .bar-track { margin-top: 10px; }
.metric-row p { font-size: 15px; color: rgba(var(--label), 0.75); margin-top: 8px; }
.misc-row { padding: 13px 0; }
.misc-row + .misc-row { border-top: 1px solid var(--hairline); }
.misc-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.misc-row-head b { font-weight: 600; text-align: right; }
.misc-row-head b.flagged { color: var(--issue); }
.misc-row p { font-size: 13px; color: rgba(var(--label), 0.6); margin-top: 4px; }
.rep-chart { border-radius: 24px; background: var(--card); padding: 18px 14px 14px; }
.rep-bars { display: flex; justify-content: space-around; align-items: flex-end; gap: 4px; height: 150px; }
.rep-bar { flex: 1; max-width: 34px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.rep-bar b { font-family: var(--rounded); font-size: 12px; font-weight: 600; color: rgba(var(--label), 0.6); margin-bottom: 6px; }
.rep-bar b.low { color: var(--issue); }
.rep-bar span { width: 20px; max-width: 100%; border-radius: 6px; }
.rep-bar small { font-size: 11px; color: rgba(var(--label), 0.45); margin-top: 6px; }
.rep-chart p { font-size: 15px; line-height: 1.6; border-top: 1px solid var(--hairline); margin-top: 14px; padding-top: 14px; }
.disclaimer { font-size: 12px; color: rgba(var(--label), 0.45); line-height: 1.6; margin-top: 22px; }

.app-pitch { position: sticky; top: 120px; }
.app-pitch h2 { margin-top: 23px; }
.app-pitch .benefits { margin: 30px 0 32px; }
.app-pitch .ghost-button { display: block; }

/* The set's video with its tracked skeleton */
.player { outline: none; padding: 0; border: 0; background: transparent; max-width: min(92vw, 520px); max-height: 92vh; overflow: visible; }
.player::backdrop { background: rgba(0, 0, 0, 0.85); }
.player-frame { position: relative; }
.player video { outline: none; display: block; max-width: min(92vw, 520px); max-height: 86vh; border-radius: 20px; background: #000; }
.player canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.player-close { position: absolute; top: -14px; right: -14px; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #1c1d21; color: #fff; }
.player-close svg { width: 16px; height: 16px; }

/* Hover colours only where there is a pointer; on touch they stick after a tap. */
@media (hover: hover) {
  .drop-zone:hover { border-color: var(--accent); }
  .ghost-button:hover { border-color: rgba(255, 255, 255, 0.4); }
  .primary-button:hover, .full-button:hover { background: #e4e4e6; }
}

@media (max-width: 1000px) {
  .pick-layout { gap: 44px; }
  .result-layout { gap: 56px; }
}
@media (max-width: 760px) {
  .stage { padding: 44px 0 64px; }
  .pick-layout, .result-layout { grid-template-columns: 1fr; }
  .drop-zone { padding: 52px 20px; }
  .app-pitch { position: static; }
  .app-pitch h2 br { display: none; }
}
@media (max-width: 420px) {
  .report { padding: 16px 12px 20px; border-radius: 28px; }
  .bars-column { padding: 0 12px; }
  .bar-label { font-size: 12px; letter-spacing: 0.02em; }
  .bar-score { font-size: 23px; }
}
