/* owned by the pro-results builder (docs/pro-contract.md) — #/result, #/replay, #/history */
.pr-page { outline: none; }
.pr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pr-head h1, .pr-head h2 { margin: 0; }
.pr-num { font-variant-numeric: tabular-nums; text-align: right; }

/* top block: big numbers + chart */
.pr-top { display: grid; grid-template-columns: 170px 1fr; gap: 28px; align-items: start; }
.pr-left { display: flex; flex-direction: column; gap: 6px; }
.pr-big-label { color: var(--sub, var(--muted)); font-size: 1.6rem; line-height: 1; }
.pr-big-value { font-size: 3.6rem; font-weight: 800; line-height: 1.05; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.pr-acc .pr-big-value { font-size: 3rem; }
.pr-pb-badge { align-self: flex-start; background: var(--primary); color: var(--primary-text, var(--bg)); font-weight: 800; font-size: 0.8rem; padding: 3px 10px; border-radius: 99px; letter-spacing: 0.03em; text-transform: uppercase; }
.pr-pb-badge.subtle { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.pr-right { min-width: 0; }

/* potential + advice (next to the big numbers) */
.pr-potential { display: flex; flex-direction: column; gap: 8px; }
.pr-pot-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.pr-pot-label { color: var(--sub, var(--muted)); font-size: 1.1rem; }
.pr-pot-value { font-size: 2.2rem; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; }
.pr-pot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.pr-pot-list b { color: var(--good); }
.pr-advice-h { margin: 10px 0 0; font-size: 1rem; }
.pr-advice { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }

/* insight cards */
.pr-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; margin: 18px 0; }
.pr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.pr-card h3 { margin: 0; font-size: 1rem; }
@media (min-width: 700px) { .pr-card.wide { grid-column: span 2; } }
.pr-card-note { margin: -4px 0 4px; font-size: 0.82rem; }
.pr-good { margin: 0; color: var(--good); }
.pr-bar-row { display: grid; grid-template-columns: 3.2em 1fr auto; gap: 10px; align-items: center; font-size: 0.88rem; }
.pr-bar-row kbd { margin: 0; text-align: center; }
.pr-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pr-bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.pr-bar-row.has-err .pr-bar span { background: var(--warn); }
.pr-bar-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-practise { align-self: flex-start; margin-top: 4px; }
.pr-mistake { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.9rem; }
.pr-mistake kbd { margin: 0; }
.pr-mistake kbd.bad { border-color: var(--bad); color: var(--bad); }
.pr-kind { color: var(--muted); font-size: 0.8rem; margin-left: auto; }
.pr-fingers { display: flex; gap: 6px; align-items: flex-end; justify-content: space-between; }
.pr-finger { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.8rem; color: var(--muted); }
.pr-finger-bar { width: 100%; max-width: 30px; height: 90px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.pr-finger-bar span { display: block; width: 100%; border-radius: 6px 6px 0 0; background: var(--good); }
.pr-finger.warn .pr-finger-bar span { background: var(--warn); }
.pr-finger.bad .pr-finger-bar span { background: var(--bad); }
.pr-finger-name { text-align: center; line-height: 1.2; }
.pr-finger-name b { font-weight: 600; color: var(--text); }
.pr-finger-ms { font-variant-numeric: tabular-nums; color: var(--text); }
.pr-pace-meta { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }

/* sub stats */
.pr-subs { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 18px 0 8px; }
.pr-small-label { color: var(--sub, var(--muted)); font-size: 0.85rem; }
.pr-small-value { font-size: 1.35rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.pr-subs .pr-small:first-child .pr-small-value { font-size: 1rem; font-weight: 600; max-width: 320px; }
.pr-chars b { font-weight: 700; }
.pr-chars .c-bad { color: var(--bad); }
.pr-chars .c-extra { color: var(--error-extra, var(--bad)); }
.pr-chars .c-miss { color: var(--muted); }
.pr-failed { margin: 10px 0; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); font-weight: 600; }

/* quote */
.pr-quote { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--primary); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.pr-quote-src { font-size: 1rem; }
.pr-quote h3 { font-size: 0.95rem; margin: 12px 0 6px; color: var(--muted); }
.pr-quote-hist { margin: 0; padding-left: 22px; font-size: 0.9rem; columns: 2 260px; }
.pr-quote-hist li.current { font-weight: 700; }

/* words */
.pr-words-h { font-size: 1rem; margin: 20px 0 8px; }
.pr-words { font-family: var(--mono); font-size: 1.05rem; line-height: 2; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; max-height: 260px; overflow: auto; }
.pr-word { position: relative; display: inline-block; padding: 0 2px; border-radius: 4px; color: var(--text); cursor: default; outline: none; }
.pr-word.missed { box-shadow: inset 0 -2px 0 var(--bad); }
.pr-word.slow { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.pr-c.bad { color: var(--bad); }
.pr-c.extra { color: var(--error-extra, var(--bad)); opacity: 0.75; }
.pr-c.miss { color: var(--muted); opacity: 0.6; }
.pr-word-tip { position: fixed; z-index: 50; background: var(--text); color: var(--bg); font: 600 0.75rem/1.3 system-ui, sans-serif; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.pr-word-tip[hidden] { display: none; }
.pr-word:focus-visible { outline: 2px solid var(--primary); }

.pr-actions kbd { font-size: 0.8rem; padding: 0 5px; margin-left: 4px; }
.pr-status { font-size: 0.9rem; }
.pr-date { font-size: 0.85rem; }
.pr-inline { margin-top: 8px; }
.pr-inline-test { margin-top: 12px; }

/* replay */
.pr-player { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; outline: none; }
.pr-player:focus-visible { border-color: var(--primary); }
.pr-replay-text { font-family: var(--mono); font-size: 1.35rem; line-height: 1.9; max-height: calc(1.35rem * 1.9 * 4 + 4px); overflow: hidden; position: relative; }
.pr-rw { display: inline-block; }
.pr-rw.wrong { text-decoration: underline wavy var(--bad); text-underline-offset: 5px; }
.pr-replay-text .pend { color: var(--sub, var(--muted)); opacity: 0.7; }
.pr-replay-text .ok { color: var(--text); }
.pr-replay-text .bad { color: var(--bad); }
.pr-replay-text .extra { color: var(--error-extra, var(--bad)); opacity: 0.75; }
.pr-replay-text .miss { color: var(--muted); opacity: 0.5; }
.pr-replay-text .caret { box-shadow: -2px 0 0 var(--caret, var(--primary)); }
.pr-live { display: flex; gap: 24px; flex-wrap: wrap; margin: 12px 0; color: var(--muted); }
.pr-live b { font-size: 1.5rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.pr-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pr-play { min-width: 52px; font-size: 1rem; }
.pr-scrub { flex: 1 1 220px; accent-color: var(--primary); }
.pr-time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 110px; font-size: 0.9rem; }
.pr-speeds { display: inline-flex; gap: 4px; }
.pr-speeds .btn.on { background: var(--primary); color: var(--primary-text, var(--bg)); border-color: var(--primary); }

/* history */
.pr-filters { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.pr-filters .field { min-width: 180px; }
.pr-table-wrap { overflow-x: auto; }
.pr-table td { white-space: nowrap; }
.pr-row-failed td { opacity: 0.65; }
.pr-row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.pr-pb-star { color: var(--primary); }
.pr-pb-was { color: var(--muted); }
.pr-tag-bad { color: var(--bad); font-size: 0.85em; }
.btn.pr-confirm { background: var(--bad); color: var(--bg); border-color: var(--bad); }
.pr-empty { text-align: center; padding: 30px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.pr-count { font-size: 0.88rem; }

@media (max-width: 680px) {
  .pr-top { grid-template-columns: 1fr; }
  .pr-left { flex-direction: row; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
  .pr-big-value { font-size: 2.8rem; }
  .pr-acc .pr-big-value { font-size: 2.4rem; }
  .pr-replay-text { font-size: 1.1rem; }
}
.pr-actions .btn-primary kbd { background: transparent; color: inherit; border: 1px solid currentColor; box-shadow: none; opacity: 0.85; }
.pr-vs.up .pr-small-value { color: var(--good); }
.pr-vs.down .pr-small-value { color: var(--warn); }
