/* Soccer match page (templates/microtools/sport_analysis/soccer_match_view.html): video left, tabs right */
.smv-page, .smv-modal {
    --smv-bg: var(--bs-body-bg);
    --smv-surface: var(--bs-card-bg, var(--bs-body-bg));
    --smv-border: var(--bs-border-color);
    --smv-text: var(--bs-body-color);
    --smv-muted: var(--bs-secondary-color);
    --smv-soft: var(--bs-tertiary-bg);
    --smv-accent: var(--bs-primary);
    --smv-radius: 16px;
    --smv-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}
.smv-page { min-height: 100vh; color: var(--smv-text); background: var(--smv-bg); }
.smv-shell { max-width: 1440px; padding: clamp(0.75rem, 2vw, 1.5rem); }

.smv-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.smv-back {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px;
    border-radius: 12px; color: inherit; border: 1px solid var(--smv-border); background: var(--smv-surface);
}
.smv-back:hover { background: var(--smv-soft); color: inherit; }
.smv-back svg { width: 18px; height: 18px; }
.smv-header-text { min-width: 0; }
.smv-title { font-size: clamp(1.1rem, 2.2vw, 1.4rem); font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.smv-meta { margin: 0.15rem 0 0; color: var(--smv-muted); font-size: 0.85rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.smv-pill { padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: var(--smv-soft); }
.smv-sample-badge {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.5rem; border-radius: 999px;
    font-size: 0.68rem; font-weight: 700; white-space: nowrap;
    color: #8a5a00; background: rgba(245, 158, 11, 0.16); border: 1px solid rgba(245, 158, 11, 0.35);
}
.smv-sample-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; }
[data-bs-theme="dark"] .smv-sample-badge, [data-layout-mode="dark"] .smv-sample-badge { color: #fbbf24; }
.smv-na { color: var(--smv-muted); font-size: 0.9rem; margin: 1rem 0; }
.smv-hint { color: var(--smv-muted); font-size: 0.78rem; margin: 0 0 0.5rem; }
.smv-muted { color: var(--smv-muted); }
.smv-kit { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--kit); border: 1px solid var(--smv-surface); box-shadow: 0 0 0 1px var(--smv-text); flex: none; vertical-align: -1px; margin-right: 0.4rem; }
.smv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); border: 1px solid var(--smv-surface); box-shadow: 0 0 0 1px var(--smv-text); flex: none; }

/* layout: the video takes the full width; the tabs sit underneath it */
.smv-layout { display: flex; flex-direction: column; gap: 1rem; }
.smv-watch { background: #0b0d10; border-radius: var(--smv-radius); padding: 0.75rem; color: #e8eaed; scroll-margin-top: 76px; }
.smv-side { background: var(--smv-surface); border: 1px solid var(--smv-border); border-radius: var(--smv-radius); box-shadow: var(--smv-shadow); }

/* teams + video mode */
.smv-video-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.smv-matchup { display: flex; align-items: center; gap: 0.35rem; font-weight: 700; }
.smv-matchup .smv-kit { margin: 0; }
.smv-team-name { font-size: 0.95rem; }
.smv-versus { font-size: 0.8rem; font-weight: 500; margin: 0 0.35rem; }
.smv-segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--smv-soft); gap: 2px; }
.smv-segmented button { border: 0; background: none; color: var(--smv-muted); font-size: 0.8rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 8px; }
.smv-segmented button.is-active { background: var(--smv-surface); color: var(--smv-text); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.smv-segmented button:disabled { opacity: 0.45; }

/* video */
.smv-stage { position: relative; background: #000; border-radius: 10px; overflow: hidden; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 290px); min-height: 220px; }
.smv-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0d10; }
.smv-empty-media { position: absolute; inset: 0; display: grid; place-items: center; color: #c9ced6; font-size: 0.95rem; padding: 1rem; text-align: center; }
.smv-follow-box { position: absolute; border: 3px solid var(--c, #fff); border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 1px #fff, 0 0 0 3px rgba(0, 0, 0, 0.65), 0 0 16px var(--c, #fff); transition: all 0.1s linear; }
.smv-follow-box span[hidden] { display: none; }
.smv-follow-box span { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -4px); white-space: nowrap; padding: 0.1rem 0.45rem; border-radius: 6px; background: #fff; color: #111; font-size: 0.72rem; font-weight: 700; }

/* timeline: momentum bands behind, moment markers on top */
.smv-timeline { position: relative; height: 40px; margin-top: 0.5rem; cursor: pointer; outline: none; touch-action: none; }
.smv-timeline:focus-visible { box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.3); border-radius: 8px; }
.smv-timeline-momentum { position: absolute; inset: 0; pointer-events: none; }
.smv-timeline-momentum span { position: absolute; background: var(--c); opacity: 0.3; border-radius: 2px; }
.smv-timeline-momentum .is-up { bottom: 50%; }
.smv-timeline-momentum .is-down { top: 50%; }
.smv-timeline-track { position: absolute; left: 0; right: 0; top: 18px; height: 4px; border-radius: 2px; background: var(--smv-soft); }
.smv-timeline-markers { position: absolute; inset: 0; }
.smv-marker { position: absolute; top: 12px; width: 6px; height: 16px; margin-left: -3px; border-radius: 3px; border: 0; padding: 0; background: var(--c); opacity: 0.85; }
.smv-marker.is-goal { top: 8px; width: 14px; height: 24px; margin-left: -7px; border-radius: 7px; box-shadow: 0 0 0 2px var(--smv-surface); }
.smv-marker.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--smv-surface), 0 0 0 4px var(--c); }
.smv-timeline-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--smv-text); border-radius: 1px; pointer-events: none; }

/* now playing */
.smv-controls { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; padding: 0.45rem 0.5rem; border-radius: 12px; background: rgba(255,255,255,0.06); }
.smv-watch .smv-segmented { background: rgba(255,255,255,0.08); }
.smv-watch .smv-segmented button { color: #aab0b8; }
.smv-watch .smv-segmented button.is-active { background: rgba(255,255,255,0.18); color: #fff; box-shadow: none; }
.smv-watch .smv-timeline-track { background: rgba(255,255,255,0.14); }
.smv-watch .smv-timeline-head { background: #fff; }
.smv-watch .smv-timeline-momentum span { background: color-mix(in srgb, var(--c), white 60%); opacity: 0.65; }
.smv-watch .smv-kit { box-shadow: 0 0 0 1px rgba(255,255,255,0.65); }
.smv-watch .smv-marker { border: 1px solid rgba(255,255,255,0.8); opacity: 1; }
.smv-watch .smv-marker.is-goal { box-shadow: 0 0 0 2px #0b0d10; }
.smv-watch .smv-marker:hover { box-shadow: 0 0 0 2px #0b0d10, 0 0 0 3px #fff; }
.smv-watch .smv-marker.is-active, .smv-watch .smv-marker:focus-visible { outline: none; box-shadow: 0 0 0 2px #0b0d10, 0 0 0 4px #fff; }
.smv-watch .smv-playbar-sub, .smv-watch .smv-time, .smv-watch .smv-count { color: #aab0b8; }
.smv-watch .smv-playbar-sub b { color: #fff; }
.smv-watch .smv-playing { color: #8ab4ff; }
.smv-watch .smv-icon-btn { background: rgba(255,255,255,0.08); border-color: transparent; color: #fff; }
.smv-playbar-text { flex: 1; min-width: 0; }
.smv-playbar-title { font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smv-playing { color: var(--smv-accent); }
.smv-count { color: var(--smv-muted); font-weight: 600; }
.smv-playbar-sub { font-size: 0.82rem; color: var(--smv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 0.35rem; }
.smv-playbar-sub b { color: var(--smv-text); font-variant-numeric: tabular-nums; }
.smv-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border-radius: 10px; border: 1px solid var(--smv-border); background: var(--smv-surface); color: inherit; }
.smv-icon-btn:disabled { opacity: 0.4; }
.smv-icon-btn svg { width: 16px; height: 16px; }

/* tabs */
.smv-tabs { display: flex; gap: 0.5rem; padding: 0.25rem 1rem 0; border-bottom: 1px solid var(--smv-border); }
.smv-tabs button { border: 0; padding-left: 0.6rem !important; padding-right: 0.6rem !important; background: none; padding: 0.65rem 0.25rem; font-weight: 700; font-size: 0.88rem; color: var(--smv-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.smv-tabs button[aria-selected="true"] { color: var(--smv-text); border-bottom-color: var(--smv-accent); }
.smv-tab-body { padding: 1rem 1.25rem 1.5rem; }
.smv-block-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 1.1rem 0 0.5rem; }
.smv-block-head:first-child { margin-top: 0; }
.smv-block-head h3 { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--smv-muted); margin: 0; display: flex; align-items: center; }

/* moments */
.smv-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.smv-select { border: 1px solid var(--smv-border); border-radius: 10px; background: var(--smv-surface); color: inherit; font-size: 0.82rem; font-weight: 600; padding: 0.3rem 0.5rem; }
.smv-moments { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; position: relative; }
.smv-moment { display: flex; gap: 0.7rem; width: 100%; text-align: left; border: 0; background: none; color: inherit; padding: 0.55rem 0.5rem; border-radius: 10px; }
.smv-moment:hover { background: var(--smv-soft); }
.smv-moment.is-now { background: rgba(var(--bs-primary-rgb), 0.1); box-shadow: inset 3px 0 0 var(--smv-accent); }
.smv-moment-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.82rem; color: var(--smv-muted); width: 2.6rem; flex: none; padding-top: 0.05rem; }
.smv-moment-main { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.smv-moment-title { font-weight: 600; font-size: 0.88rem; display: flex; align-items: center; gap: 0.4rem; }
.smv-moment-type { font-size: 0.72rem; color: var(--smv-muted); font-weight: 600; }
.smv-moment-desc { display: none; font-size: 0.8rem; color: var(--smv-muted); }
.smv-moment.is-now .smv-moment-desc { display: block; }

/* stats: team against team */
.smv-vs-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.25rem; }
.smv-vs-head > span { display: flex; align-items: center; }
.smv-vs-mid { color: var(--smv-muted); font-weight: 500; font-size: 0.72rem; }
.smv-vs-row { display: grid; grid-template-columns: 3.6rem 1fr 3.6rem; align-items: center; gap: 0.5rem; padding: 0.3rem 0; }
.smv-vs-num { border: 1px solid var(--smv-border); background: var(--smv-surface); color: inherit; border-radius: 9px; padding: 0.3rem 0; font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; }
.smv-vs-num i { font-style: normal; font-size: 0.6rem; color: var(--smv-accent); }
.smv-vs-num:hover { background: var(--smv-soft); border-color: var(--smv-accent); }
.smv-vs-num.is-static { border-color: transparent; color: var(--smv-muted); }
.smv-vs-label { text-align: center; font-size: 0.8rem; font-weight: 600; display: flex; flex-direction: column; gap: 0.25rem; }
.smv-vs-bar { display: flex; gap: 2px; height: 5px; border-radius: 3px; overflow: hidden; background: var(--smv-soft); }
.smv-vs-bar.is-unavailable { border: 1px dashed var(--smv-muted); }
.smv-possession-row .smv-vs-bar > span { box-shadow: inset 0 0 0 1px var(--smv-muted); }
.smv-possession-estimate { color: var(--smv-muted); font-size: 0.65rem; font-weight: 400; }
.smv-possession { padding: 0.9rem; margin-bottom: 1.2rem; border: 1px solid var(--smv-border); border-radius: 12px; background: var(--smv-surface); }
.smv-possession > h3 { font-size: 0.85rem; margin: 0 0 0.5rem; }
.smv-possession .smv-block-head > span { font-size: 0.7rem; }
.smv-possession-teams { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; }
.smv-possession-team { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; min-width: 0; padding: 0.4rem; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--smv-text); font: inherit; text-align: left; }
.smv-possession-team:last-child { align-items: flex-end; text-align: right; }
.smv-possession-team > span { display: flex; align-items: flex-start; min-height: 2.4em; line-height: 1.2; font-size: 0.78rem; overflow-wrap: anywhere; }
.smv-possession-team .smv-kit { flex: none; margin-top: 0.18em; }
.smv-possession-team > b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.smv-possession-team > small { font-size: 0.72rem; color: var(--smv-muted); }
.smv-possession-team:enabled { cursor: pointer; }
.smv-possession-team:enabled:hover { background: var(--smv-soft); border-color: var(--smv-border); }
.smv-possession-team:focus-visible { outline: 2px solid var(--smv-accent); outline-offset: 2px; }
.smv-possession-coverage { font-size: 0.78rem; margin: 0.6rem 0 0.3rem; font-variant-numeric: tabular-nums; }
.smv-top { display: flex; flex-direction: column; gap: 0.3rem; }
.smv-prow { display: flex; align-items: center; gap: 0.6rem; border: 1px solid var(--smv-border); background: var(--smv-surface); color: inherit; border-radius: 12px; padding: 0.4rem 0.6rem 0.4rem 0.4rem; text-align: left; }
.smv-prow:hover { background: var(--smv-soft); }
.smv-prow-photo { position: relative; width: 36px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--smv-soft); flex: none; }
.smv-prow-name { flex: 1; font-weight: 700; font-size: 0.88rem; display: flex; flex-direction: column; }
.smv-prow-name small { color: var(--smv-muted); font-weight: 500; font-size: 0.75rem; }

/* players */
.smv-player-group + .smv-player-group { margin-top: 1.5rem; }
.smv-player-group .smv-block-head { margin-top: 0; }
.smv-player-group .smv-block-head small { flex: none; font-size: 0.75rem; }
.smv-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.5rem; }
.smv-pgrid[hidden] { display: none; }
.smv-pcard { position: relative; border: 1px solid var(--smv-border); background: var(--smv-surface); color: inherit; border-radius: 12px; padding: 0; overflow: hidden; text-align: left; }
.smv-pcard:hover { border-color: var(--smv-accent); }
.smv-pcard:focus-visible, .smv-players-toggle:focus-visible { outline: 2px solid var(--smv-accent); outline-offset: 3px; }
.smv-players-toggle { display: flex; align-items: center; gap: 0.5rem; min-height: 40px; margin: 0.6rem 0; padding: 0.4rem 0.65rem; border: 1px solid var(--smv-border); border-radius: 9px; background: var(--smv-surface); color: var(--smv-accent); font-size: 0.8rem; font-weight: 700; }
.smv-players-toggle:hover { background: var(--smv-soft); border-color: var(--smv-accent); }
.smv-players-toggle:active { background: rgba(var(--bs-primary-rgb), 0.1); }
.smv-players-toggle .smv-muted { font-weight: 500; }
.smv-disclosure-arrow { width: 6px; height: 6px; margin: 0 0.15rem 0.2rem 0.25rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.smv-players-toggle[aria-expanded="true"] .smv-disclosure-arrow { transform: rotate(225deg); margin-bottom: -0.1rem; }
.smv-pcard-photo { position: relative; aspect-ratio: 3 / 4; background: var(--smv-soft); border-bottom: 3px solid var(--kit); }
.smv-pcard-photo img, .smv-prow-photo img, .smv-hero-photo img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.smv-avatar-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; color: var(--smv-muted); text-align: center; padding: 0.25rem; }
.smv-pcard .smv-rating { position: absolute; top: 5px; right: 5px; z-index: 2; }
.smv-pcard-name { display: block; padding: 0.3rem 0.4rem; font-weight: 700; font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smv-rating { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2rem; padding: 0.1rem 0.35rem; border-radius: 7px; background: var(--r); color: var(--ink, #fff); font-weight: 800; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.smv-rating.is-big { min-width: 3.2rem; font-size: 1.2rem; padding: 0.35rem 0.5rem; border-radius: 10px; align-self: flex-start; }

/* player detail */
.smv-back-link { border: 0; background: none; color: var(--smv-accent); font-weight: 700; font-size: 0.85rem; padding: 0; margin-bottom: 0.7rem; }
.smv-hero { display: flex; gap: 0.8rem; align-items: center; }
.smv-hero-photo { position: relative; width: 72px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--smv-soft); border-bottom: 3px solid var(--kit); flex: none; }
.smv-hero-text { flex: 1; min-width: 0; }
.smv-hero-text h2 { font-size: 1.25rem; font-weight: 800; margin: 0; }
.smv-hero-text p { color: var(--smv-muted); font-size: 0.8rem; margin: 0.1rem 0 0.5rem; }
.smv-hero-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.smv-watch-btn { display: inline-flex; align-items: center; gap: 0.25rem; border: 0; border-radius: 9px; padding: 0.3rem 0.65rem; background: var(--smv-accent); color: #fff; font-weight: 700; font-size: 0.78rem; white-space: nowrap; }
.smv-watch-btn.is-ghost { background: var(--smv-soft); color: var(--smv-text); }
.smv-reasons { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; }
.smv-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.smv-stat { position: relative; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--smv-border); background: var(--smv-surface); color: inherit; border-radius: 10px; padding: 0.45rem 0.55rem; text-align: left; }
.smv-stat strong { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.smv-stat span { font-size: 0.72rem; color: var(--smv-muted); font-weight: 600; }
.smv-stat i { position: absolute; top: 0.4rem; right: 0.5rem; font-style: normal; font-size: 0.65rem; color: var(--smv-accent); }
button.smv-stat:hover { border-color: var(--smv-accent); background: var(--smv-soft); }
.smv-stat.is-static { background: var(--smv-soft); border-color: transparent; }
.smv-pitch { width: 100%; height: auto; border-radius: 10px; display: block; }
.smv-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.smv-notes li { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; font-size: 0.86rem; padding: 0.5rem 0.6rem; border-radius: 10px; background: var(--smv-soft); border-left: 3px solid var(--smv-border); }
.smv-notes.is-good li { border-left-color: #16a34a; }
.smv-notes.is-work li { border-left-color: #d97706; }

/* report */
.smv-report-team { margin-bottom: 1.25rem; }
.smv-report-team h3 { font-size: 1rem; font-weight: 800; margin: 0.25rem 0 0.4rem; display: flex; align-items: center; }
.smv-report-team h4 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--smv-muted); margin: 0.8rem 0 0.4rem; }

/* wide tabs: two columns where it helps */
.smv-two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; }
.smv-report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.smv-player-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
.smv-two-col > *, .smv-player-cols > *, .smv-report-cols > * { min-width: 0; }
@media (max-width: 900px) {
    .smv-two-col, .smv-report-cols, .smv-player-cols { grid-template-columns: 1fr; gap: 0.5rem; }
}
@media (max-width: 768px) {
    .smv-shell { padding: 0.75rem 1rem; }
    .smv-watch { padding: 0.5rem; border-radius: 12px; }
    .smv-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* on-video caption (lower third) */
.smv-caption {
    position: absolute; left: 16px; bottom: 56px; max-width: min(70%, 560px); display: flex; align-items: stretch;
    border-radius: 10px; overflow: hidden; background: rgba(11, 13, 16, 0.82); color: #fff; backdrop-filter: blur(6px);
    pointer-events: none; animation: smv-cap-in 0.18s ease-out;
}
@keyframes smv-cap-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.smv-cap-type { display: flex; align-items: center; padding: 0 0.7rem; background: #23272e; color: #fff; border-left: 3px solid var(--c, #fff); font-weight: 800; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.smv-cap-text { padding: 0.45rem 0.75rem; display: flex; flex-direction: column; min-width: 0; }
.smv-cap-text b { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smv-cap-text small { color: #c3c8cf; font-size: 0.75rem; }

/* match report: an article, not boxes */
.smv-report { max-width: 1100px; }
.smv-report section { padding: 1.4rem 0; border-top: 1px solid var(--smv-border); }
.smv-report h3 { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--smv-muted); margin: 0 0 0.9rem; }
.smv-report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; padding-bottom: 1.4rem; flex-wrap: wrap; }
.smv-eyebrow { font-size: 0.75rem; font-weight: 700; color: var(--smv-muted); display: flex; align-items: center; gap: 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; }
.smv-report-head h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 800; line-height: 1.2; margin: 0.35rem 0 1rem; max-width: 34ch; }
.smv-strip { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.smv-strip div { display: flex; flex-direction: column; }
.smv-strip b { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.smv-strip b i { font-style: normal; color: var(--smv-muted); margin: 0 0.25rem; font-weight: 500; }
.smv-strip span { font-size: 0.72rem; color: var(--smv-muted); font-weight: 600; }
.smv-potm { display: flex; align-items: center; gap: 0.8rem; border: 0; border-radius: 14px; padding: 0.6rem 0.9rem 0.6rem 0.6rem; background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.12), rgba(var(--bs-primary-rgb), 0.03)); color: inherit; text-align: left; min-width: 280px; }
.smv-potm-photo { position: relative; width: 58px; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--smv-soft); flex: none; }
.smv-potm-photo img, .smv-best-photo img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.smv-potm > span { flex: 1; display: flex; flex-direction: column; }
.smv-potm small { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--smv-accent); }
.smv-potm b { font-size: 1.1rem; }
.smv-potm em { font-style: normal; font-size: 0.78rem; color: var(--smv-muted); }

/* key-moment timeline: one team above the line, the other below */
.smv-kt { display: grid; grid-template-columns: 90px 1fr; grid-template-rows: auto auto; gap: 0 0.75rem; }
.smv-kt-team { font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; }
.smv-kt-team:last-child { grid-column: 1; grid-row: 2; }
.smv-kt-track { grid-column: 2; grid-row: 1 / span 2; position: relative; height: 84px; }
.smv-kt-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--smv-border); }
.smv-kt-ev { position: absolute; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; border: 2px solid var(--c); box-shadow: 0 0 0 1px var(--smv-text); background: var(--smv-surface); font-size: 0.85rem; line-height: 1; display: grid; place-items: center; padding: 0; }
.smv-kt-ev.is-top { top: 4px; }
.smv-kt-ev.is-bottom { bottom: 4px; }
.smv-kt-ev.is-goal { background: var(--c); color: var(--ink, #fff); width: 34px; height: 34px; margin-left: -17px; }
.smv-kt-ev:hover { transform: scale(1.12); }
.smv-kt-tick { position: absolute; top: 50%; transform: translate(-50%, 6px); font-size: 0.65rem; color: var(--smv-muted); pointer-events: none; }
.smv-kt-tick:first-of-type { transform: translate(0, 6px); }
.smv-kt-tick:last-child { transform: translate(-100%, 6px); }

/* story */
.smv-report-passages { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.smv-report-passages .smv-watch-btn { white-space: normal; text-align: left; }
.smv-report-passages .smv-watch-btn:hover { filter: brightness(0.92); }
.smv-report-passages .smv-watch-btn:active { filter: brightness(0.85); }
.smv-report-passages .smv-watch-btn:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: 3px; }
.smv-story { margin-bottom: 1.1rem; max-width: 78ch; }
.smv-story h4 { font-size: 1rem; font-weight: 800; margin: 0 0 0.3rem; }
.smv-story p { font-size: 0.97rem; line-height: 1.65; margin: 0 0 0.4rem; }
.smv-ref { display: inline-flex; align-items: center; gap: 0.2rem; border: 0; border-radius: 6px; padding: 0 0.4rem; margin: 0 0.1rem; background: rgba(var(--bs-primary-rgb), 0.12); color: var(--smv-accent); font-weight: 700; font-size: 0.82em; font-variant-numeric: tabular-nums; vertical-align: 0.05em; }
.smv-ref::before { content: "▶"; font-size: 0.7em; }
.smv-ref:hover { background: var(--smv-accent); color: #fff; }
.smv-passage { border: 0; background: none; padding: 0; color: var(--smv-accent); font-weight: 700; font-size: 0.82rem; }
.smv-passage:hover { text-decoration: underline; }

/* pitch graphics */
.smv-maps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.smv-maps figure { margin: 0; }
.smv-maps figcaption { font-weight: 800; font-size: 0.9rem; margin-bottom: 0.45rem; display: flex; flex-direction: column; }
.smv-maps figcaption small { font-weight: 500; font-size: 0.72rem; color: var(--smv-muted); }
.smv-map-dot { cursor: pointer; }
.smv-map-symbol { stroke: #fff; stroke-width: 0.65; paint-order: stroke fill; }
.smv-map-dot:hover .smv-map-symbol { stroke-width: 1.2; }
.smv-map-dot:focus-visible { outline: 2px solid #fff !important; outline-offset: 2px; }
.smv-map-dot:focus-visible .smv-map-symbol { stroke-width: 1.4; }
.smv-map-dot:active .smv-map-symbol { stroke-width: 1.6; }
.smv-vs-bar > span { box-shadow: inset 0 0 0 1px var(--smv-muted); }
.smv-map-unavailable { background: var(--smv-soft); border: 1px solid var(--smv-border); border-radius: 10px; padding: 1rem; color: var(--smv-text); font-size: 0.86rem; }
.smv-map-unavailable b { display: block; margin-bottom: 0.35rem; }
.smv-map-unavailable p { margin: 0; line-height: 1.5; }
.smv-map-unavailable small { display: block; margin-top: 0.6rem; color: var(--smv-muted); }
.smv-heat-legend { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0; font-size: 0.72rem; color: var(--smv-muted); }
.smv-heat-legend i { height: 8px; flex: 1; max-width: 140px; border-radius: 4px; background: linear-gradient(90deg, #2f7d4b, #f5c518); border: 1px solid var(--smv-border); }

/* phases + best players */
.smv-team-h { font-size: 1rem; font-weight: 800; display: flex; align-items: center; margin: 0 0 0.6rem; }
.smv-phases { margin: 0; }
.smv-phases dt { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--smv-muted); margin-top: 0.7rem; }
.smv-phases dd { margin: 0.15rem 0 0; font-size: 0.93rem; line-height: 1.6; }
.smv-best { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px solid var(--smv-border); }
.smv-best:last-child { border-bottom: 0; }
.smv-best-main { flex: 1; display: flex; align-items: center; gap: 0.7rem; border: 0; background: none; color: inherit; text-align: left; padding: 0; min-width: 0; }
.smv-best-photo { position: relative; width: 44px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--smv-soft); flex: none; }
.smv-best-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.smv-best-text b { font-size: 0.95rem; }
.smv-best-text small { font-size: 0.78rem; color: var(--smv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
    .smv-maps { grid-template-columns: 1fr; }
    .smv-kt { grid-template-columns: 64px 1fr; }
    .smv-caption { bottom: 48px; left: 8px; max-width: calc(100% - 16px); }
}

/* controls under the video */
.smv-controls { flex-wrap: nowrap; }
.smv-icon-btn.is-play { width: 40px; height: 40px; background: #fff !important; color: #0b0d10 !important; border-radius: 50%; }
.smv-time { font-variant-numeric: tabular-nums; font-size: 0.82rem; font-weight: 600; white-space: nowrap; padding: 0 0.25rem; }
.smv-text-btn { border: 0; background: none; color: inherit; font-weight: 700; font-size: 0.8rem; padding: 0.3rem 0.5rem; border-radius: 8px; }
.smv-watch .smv-text-btn { color: #e8eaed; background: rgba(255, 255, 255, 0.08); min-width: 40px; }
.smv-timeline-fill { height: 100%; width: 0; background: rgba(255, 255, 255, 0.55); border-radius: 2px; }
.smv-type-pill { display: inline-flex; align-items: center; gap: 0.35rem; flex: none; padding: 0.12rem 0.4rem; border: 1px solid rgba(255,255,255,0.22); border-radius: 5px; background: rgba(255,255,255,0.08); color: #e8eaed; font-size: 0.7rem; line-height: 1.35; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.smv-type-pill::before { content: ""; width: 8px; height: 8px; flex: none; border: 1px solid rgba(255,255,255,0.8); border-radius: 50%; background: var(--c); }
.smv-who { color: #aab0b8; }
.smv-watch:fullscreen { border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
.smv-watch:fullscreen .smv-stage { max-height: calc(100vh - 170px); }

/* player mode strip */
.smv-focus { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; padding: 0.5rem 0.6rem; border-radius: 12px; background: rgba(255, 255, 255, 0.08); color: #fff; flex-wrap: wrap; }
.smv-focus[hidden] { display: none; }
.smv-focus-photo { position: relative; width: 38px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,0.1); flex: none; }
.smv-focus-photo img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.smv-focus-photo .smv-avatar-fallback { color: #aab0b8; font-size: 0.55rem; }
.smv-focus-text { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.smv-focus-text b { font-size: 0.95rem; display: flex; align-items: center; gap: 0.4rem; }
.smv-focus-text small { color: #aab0b8; font-size: 0.75rem; }
.smv-follow-status[data-status="in"] { color: #4ade80; }
.smv-follow-status[data-status="out"] { color: #fbbf24; }
.smv-focus-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.smv-focus .smv-watch-btn.is-ghost { background: rgba(255,255,255,0.12); color: #fff; }
.smv-watch-btn:disabled { opacity: 0.4; }
.smv-switch { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 700; margin: 0 0.25rem; cursor: pointer; }

/* report: player of the match actions */
.smv-potm b { display: flex; align-items: center; gap: 0.4rem; }
.smv-potm-actions { display: flex; gap: 0.4rem; margin-top: 0.4rem; align-items: center; }

/* team shape */
.smv-legend { font-size: 0.8rem; color: var(--smv-muted); display: flex; align-items: center; gap: 0.35rem; margin: -0.4rem 0 1rem; flex-wrap: wrap; }
.smv-legend-box { width: 14px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 0.4rem; }
.smv-legend-box.is-weak, .smv-zone.is-weak { fill: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.5); stroke: #ef4444; stroke-width: 0.5; stroke-dasharray: 1.5 1; }
.smv-legend-box.is-strong, .smv-zone.is-strong { fill: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.5); stroke: #38bdf8; stroke-width: 0.5; }
.smv-zone-label { font-size: 2.6px; font-weight: 700; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, 0.55); stroke-width: 0.6px; pointer-events: none; }
.smv-shape-team { margin-bottom: 1.5rem; }
.smv-shape-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.smv-shape-grid figure { margin: 0; }
.smv-shape-grid figcaption { font-weight: 800; font-size: 0.95rem; margin-bottom: 0.45rem; display: flex; flex-direction: column; }
.smv-shape-grid figcaption small { font-weight: 600; font-size: 0.75rem; color: var(--smv-muted); }
.smv-shape-facts { display: block; min-height: 1.125rem; }
.smv-described-areas { margin: 0.75rem 0; padding: 0.85rem; border: 1px solid var(--smv-border); border-radius: 12px; background: var(--smv-surface); }
.smv-area-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: 0.85rem; }
.smv-area-heading small, .smv-area-coverage, .smv-area-unknown, .smv-area-method, .smv-area-empty { color: var(--smv-muted); font-size: 0.75rem; }
.smv-area-coverage { margin: 0.35rem 0 0.65rem; }
.smv-area-small { display: inline-block; padding: 0.08rem 0.35rem; margin-left: 0.2rem; background: var(--smv-soft); border-radius: 4px; color: var(--smv-text); font-weight: 600; }
.smv-area-buckets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; }
.smv-area-bucket { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; overflow: hidden; padding: 0.55rem 0.4rem 0.65rem; border: 1px solid var(--smv-border); border-radius: 7px; background: var(--smv-surface); color: var(--smv-text); text-align: left; transition: background-color 0.15s ease; }
.smv-area-bucket::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--share); background: color-mix(in srgb, var(--kit), var(--smv-text) 35%); }
.smv-area-bucket > span { font-size: 0.72rem; line-height: 1.2; min-height: 2.4em; }
.smv-area-bucket > b { font-size: 1.2rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.smv-area-bucket > small { color: var(--smv-muted); font-size: 0.65rem; }
.smv-area-bucket:hover:enabled { background: var(--smv-soft); }
.smv-area-bucket:focus-visible, .smv-area-method summary:focus-visible { outline: 2px solid var(--smv-accent); outline-offset: 3px; }
.smv-area-bucket:active:enabled { background: var(--smv-soft); box-shadow: inset 0 0 0 1px var(--smv-accent); }
.smv-area-bucket:disabled { color: var(--smv-muted); background: var(--smv-soft); }
.smv-area-pitch { position: relative; isolation: isolate; }
.smv-area-lanes { position: absolute; inset: 2.7% 1.6%; display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); }
.smv-area-lane { display: flex; align-items: center; justify-content: center; padding: 0.25rem; border: 0; background: rgba(255, 255, 255, var(--density)); transition: background-color 0.15s ease; }
.smv-area-lane + .smv-area-lane { border-top: 1px dashed rgba(255, 255, 255, 0.55); }
.smv-area-lane-label { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; padding: 0.3rem 0.55rem; border-radius: 6px; background: #fff; color: #26352b; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); font-size: 0.75rem; line-height: 1.3; }
.smv-area-lane-label b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.smv-area-lane-label small { font-size: 0.7rem; }
.smv-area-lane-label i { font-style: normal; font-size: 0.6rem; }
.smv-area-lane:hover:enabled { background: rgba(255, 255, 255, 0.4); }
.smv-area-lane:focus-visible { outline: 3px solid #fff !important; outline-offset: -4px; box-shadow: inset 0 0 0 6px #102d22; z-index: 1; }
.smv-area-lane:active:enabled .smv-area-lane-label { background: #e8eaed; }
.smv-area-lane:disabled .smv-area-lane-label { background: #e8eaed; }
.smv-area-pitch-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 0.85rem; font-weight: 600; text-shadow: 0 1px 3px #102d22; }
.smv-area-camera { margin: 0.45rem 0; color: var(--smv-muted); font-size: 0.7rem; }
.smv-area-buckets.is-pitch-summary { grid-template-columns: 1fr; }
.is-pitch-summary .smv-area-bucket { flex-direction: row; align-items: center; gap: 0.5rem; }
.is-pitch-summary .smv-area-bucket > span { flex: 1; min-height: 0; }
.is-pitch-summary .smv-area-bucket > b { font-size: 1rem; }
.smv-area-empty { margin: 0.65rem 0; }
.smv-area-unknown { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.smv-area-method { margin-top: 0.55rem; }
.smv-area-method summary { cursor: pointer; width: fit-content; border-radius: 3px; }
.smv-area-method p { margin: 0.4rem 0 0; line-height: 1.5; }
@media (max-width: 400px) {
    .smv-area-buckets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .smv-area-bucket > span { min-height: 1.2em; }
}
.smv-shape-text { font-size: 0.9rem; line-height: 1.55; margin: 0.6rem 0 0.4rem; }
.smv-zone-list { list-style: none; margin: 0; padding: 0; }
.smv-zone-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px solid var(--smv-border); font-size: 0.86rem; font-weight: 600; }
.smv-zone-list li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.smv-zone-list li.is-weak::before { background: #ef4444; }
.smv-zone-list li.is-strong::before { background: #38bdf8; }
.smv-zone-list li span { flex: 1; }
@media (max-width: 900px) {
    .smv-shape-grid { grid-template-columns: 1fr; }
    .smv-controls { flex-wrap: wrap; }
    .smv-playbar-text { order: 10; flex-basis: 100%; }
}

/* best players: cards, the whole card plays the player's best moments */
.smv-bp-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.smv-bp { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--smv-border); border-radius: 14px; overflow: hidden; background: var(--smv-surface); color: inherit; text-align: left; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.smv-bp:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12); }
.smv-bp-photo { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--smv-soft); border-bottom: 3px solid var(--kit); }
.smv-bp-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.smv-bp-rank { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(11, 13, 16, 0.75); color: #fff; font-size: 0.75rem; font-weight: 800; }
.smv-bp-photo .smv-rating { position: absolute; top: 8px; right: 8px; }
.smv-bp-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.9); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); color: #0b0d10; font-size: 0.95rem; opacity: 0; transition: opacity 0.15s ease, transform 0.15s ease; }
.smv-bp:hover .smv-bp-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.smv-bp-body { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.6rem 0.7rem 0.7rem; flex: 1; }
.smv-bp-body b { font-size: 0.95rem; }
.smv-bp-why { font-size: 0.76rem; color: var(--smv-muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.05em; }
.smv-bp-cta { margin-top: auto; padding-top: 0.35rem; font-size: 0.76rem; font-weight: 700; color: var(--smv-accent); }
.smv-bp:disabled .smv-bp-cta { color: var(--smv-muted); }
.smv-ref { margin: 0 0.05rem; }
@media (max-width: 600px) { .smv-bp-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* team stats rows open a breakdown */
button.smv-vs-row { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; border-radius: 10px; padding: 0.3rem 0.35rem; }
.smv-vs-row.is-clickable { cursor: pointer; }
.smv-vs-row.is-clickable:hover { background: var(--smv-soft); }
.smv-vs-row.is-open { background: rgba(var(--bs-primary-rgb), 0.08); }
.smv-vs-row .smv-vs-num { border: 0; background: none; }
.smv-vs-row .smv-vs-num[data-side]:hover { color: var(--smv-accent); text-decoration: underline; }
.smv-stat i { font-size: 0.9rem; top: 0.25rem; }
.smv-stat.is-active { border-color: var(--smv-accent); background: rgba(var(--bs-primary-rgb), 0.08); }

/* moment breakdown */
.smv-detail { margin: 0.35rem 0 0.9rem; border: 1px solid var(--smv-border); border-radius: 14px; padding: 0.8rem; background: var(--smv-surface); box-shadow: var(--smv-shadow); }
.smv-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.smv-detail-head b { font-size: 1rem; }
.smv-detail-tools { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.smv-detail-tools .smv-segmented { max-width: 100%; }
.smv-icon-btn.is-light { width: 32px; height: 32px; border-radius: 9px; font-size: 0.8rem; }
.smv-who-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.7rem; font-size: 0.78rem; }
.smv-who-chip { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--smv-border); background: var(--smv-surface); color: inherit; border-radius: 999px; padding: 0.15rem 0.55rem 0.15rem 0.15rem; font-size: 0.8rem; font-weight: 600; }
.smv-who-chip b { background: var(--smv-soft); border-radius: 999px; padding: 0 0.4rem; font-size: 0.72rem; }
.smv-who-chip.is-active { border-color: var(--smv-accent); background: rgba(var(--bs-primary-rgb), 0.1); }
.smv-mini-photo { position: relative; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: var(--smv-soft); flex: none; }
.smv-mini-photo img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.smv-mini-photo .smv-avatar-fallback { font-size: 0.4rem; }
.smv-detail-body { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 0.9rem; align-items: start; }
.smv-detail-body.is-list-only { grid-template-columns: 1fr; }
.smv-detail-map .smv-map-dot.is-sel circle { stroke: #fff; stroke-width: 1; }
.smv-detail-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.smv-detail-list li { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--smv-border); border-radius: 8px; }
.smv-detail-list li:last-child { border-bottom: 0; }
.smv-detail-list li.is-sel { background: rgba(var(--bs-primary-rgb), 0.08); }
.smv-detail-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--ink, #fff); border: 1px solid var(--smv-text); font-size: 0.72rem; font-weight: 800; flex: none; }
.smv-detail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.smv-detail-title { font-size: 0.88rem; font-weight: 600; }
.smv-detail-title b { font-variant-numeric: tabular-nums; margin-right: 0.25rem; }
.smv-detail-desc { font-size: 0.78rem; color: var(--smv-muted); }
.smv-detail-who { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.smv-mini { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.76rem; font-weight: 600; }
@media (max-width: 900px) { .smv-detail-body { grid-template-columns: 1fr; } }
.smv-sample-badge.is-ai { color: #3730a3; background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.35); }
.smv-sample-badge.is-ai::before { background: #6366f1; }
[data-bs-theme="dark"] .smv-sample-badge.is-ai, [data-layout-mode="dark"] .smv-sample-badge.is-ai { color: #a5b4fc; }

/* header actions (top right) */
.smv-header { flex-wrap: wrap; }
.smv-header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.smv-head-btn { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--smv-border); background: var(--smv-surface); color: inherit; border-radius: 10px; padding: 0.45rem 0.8rem; font-weight: 700; font-size: 0.85rem; cursor: pointer; list-style: none; }
.smv-head-btn::-webkit-details-marker { display: none; }
.smv-head-btn svg { width: 15px; height: 15px; }
.smv-head-btn:hover:not(:disabled) { background: var(--smv-soft); }
.smv-head-btn.is-primary { background: var(--smv-accent); border-color: var(--smv-accent); color: #fff; }
.smv-head-btn.is-primary:hover:not(:disabled) { background: var(--smv-accent); filter: brightness(1.08); }
.smv-head-btn:disabled { opacity: 0.55; cursor: default; }
.smv-run-chip { font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--smv-soft); color: var(--smv-muted); }
.smv-run-chip[data-status="processing"], .smv-run-chip[data-status="queued"] { background: rgba(var(--bs-primary-rgb), 0.12); color: var(--smv-accent); }
.smv-run-chip[data-status="completed"] { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.smv-run-chip[data-status="failed"] { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.smv-menu { position: relative; }
.smv-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; padding: 0.35rem; border-radius: 12px; border: 1px solid var(--smv-border); background: var(--smv-surface); box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16); display: flex; flex-direction: column; }
.smv-menu-list button, .smv-menu-list a { display: flex; align-items: center; gap: 0.55rem; border: 0; background: none; color: inherit; text-align: left; padding: 0.55rem 0.65rem; border-radius: 8px; font-size: 0.86rem; font-weight: 600; text-decoration: none; }
.smv-menu-list button:hover, .smv-menu-list a:hover { background: var(--smv-soft); }
.smv-menu-list svg { width: 15px; height: 15px; color: var(--smv-muted); }

/* staff dialogs */
.smv-modal-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgba(9, 11, 15, 0.5); }
.smv-modal { position: fixed; z-index: 1055; left: 50%; top: 8vh; transform: translateX(-50%); width: min(760px, calc(100vw - 32px)); max-height: 84vh; overflow-y: auto; border-radius: 16px; background: var(--smv-surface); color: var(--smv-text); box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3); }
.smv-modal.is-small { width: min(460px, calc(100vw - 32px)); top: 20vh; }
.smv-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.25rem 0.5rem; }
.smv-modal-head h2 { font-size: 1.2rem; font-weight: 800; margin: 0.15rem 0 0; }
.smv-modal-body { padding: 0.5rem 1.25rem 1.25rem; }
.smv-modal-body p { font-size: 0.92rem; line-height: 1.55; }
.smv-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }
.smv-error { color: #b91c1c; font-weight: 600; }
.smv-cost-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.smv-cost-top div { background: var(--smv-soft); border-radius: 12px; padding: 0.6rem 0.75rem; display: flex; flex-direction: column; }
.smv-cost-top span { font-size: 0.72rem; color: var(--smv-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.smv-cost-top b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.smv-cost-top b small { font-size: 0.7rem; color: var(--smv-muted); }
.smv-cost-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.smv-cost-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--smv-muted); text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--smv-border); }
.smv-cost-table td { padding: 0.5rem; border-bottom: 1px solid var(--smv-border); vertical-align: top; }
.smv-cost-table td b { display: block; }
.smv-cost-table td small { color: var(--smv-muted); font-size: 0.76rem; }
.smv-cost-table .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 768px) {
    .smv-header-actions { margin-left: 0; width: 100%; }
    .smv-cost-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.smv-cost-top small { font-size: 0.74rem; color: var(--smv-muted); margin-top: 0.1rem; }
.smv-cost-top b em { font-style: normal; font-size: 0.7rem; color: var(--smv-muted); }
.smv-cost-top .is-profit { color: #15803d; }
.smv-cost-top .is-loss { color: #b91c1c; }
.smv-cost-meta { font-size: 0.78rem; color: var(--smv-muted); margin: -0.4rem 0 0.8rem; }
.smv-cost-table tr.is-total td { font-weight: 800; border-top: 2px solid var(--smv-border); }
.smv-ref i { font-style: normal; font-weight: 600; opacity: 0.75; font-size: 0.9em; }

/* One progress panel follows the match from upload through the report. */
.smv-page [hidden] { display: none !important; }
.smv-page.is-processing > .page-content {
    display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: 0;
}
.smv-page.is-processing .smv-shell {
    display: flex; flex: 1; flex-direction: column; max-width: none; padding-block: 1.25rem;
}
.smv-page.is-processing .smv-header-text { flex: 1 1 0; }
.smv-processing.is-initial {
    position: relative; isolation: isolate; overflow: hidden; display: grid; flex: 1; place-items: center;
    padding: clamp(1.5rem, 5vh, 3.5rem) 0;
}
.smv-load-pitch { display: none; }
.smv-processing.is-initial .smv-load-pitch {
    display: block; position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
    color: color-mix(in srgb, var(--smv-accent) 16%, transparent); pointer-events: none;
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse at 50% 50%, #000 25%, transparent 75%);
}
.smv-processing.is-initial .smv-progress {
    width: 100%; max-width: 1020px; margin: 0; padding: 0 clamp(0.5rem, 2vw, 1rem); border: 0; border-radius: 0; background: none;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); column-gap: clamp(2rem, 7vw, 6rem);
    align-items: center; grid-template-areas: "eyebrow steps" "head steps" "bar steps" "error steps" "foot steps" "conn steps";
    grid-template-rows: repeat(5, auto) 1fr;
}
.smv-processing.is-initial .smv-load-eyebrow { grid-area: eyebrow; align-self: end; }
.smv-processing.is-initial .smv-progress-head { grid-area: head; }
.smv-processing.is-initial .smv-progress-bar { grid-area: bar; }
.smv-processing.is-initial .smv-error { grid-area: error; }
.smv-processing.is-initial .smv-processing-footnote { grid-area: foot; }
.smv-processing.is-initial .smv-processing-connection { grid-area: conn; }
.smv-processing.is-initial .smv-progress-steps { grid-area: steps; grid-row: 1 / -1; align-self: center; }
.smv-processing .smv-load-eyebrow {
    display: none; margin: 0 0 0.9rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--smv-load-accent-text);
}
/* loader-only text colours, measured to hold 4.5:1: light uses the accent as is, dark pulls it almost to the body colour */
.smv-page { --smv-load-accent-text: var(--smv-accent); --smv-load-pending-text: color-mix(in srgb, var(--smv-text) 80%, var(--smv-bg)); }
[data-bs-theme="dark"] .smv-page, [data-layout-mode="dark"] .smv-page {
    --smv-load-accent-text: color-mix(in srgb, var(--smv-accent) 15%, var(--smv-text));
    --smv-load-pending-text: color-mix(in srgb, var(--smv-text) 92%, var(--smv-bg));
}
.smv-page.is-processing .smv-run-chip[data-status="processing"], .smv-page.is-processing .smv-run-chip[data-status="queued"] {
    color: var(--smv-load-accent-text);
}
/* dark: the tint lifts the chip background and drops the text below 4.5:1, so use an outline instead */
[data-bs-theme="dark"] .smv-page.is-processing .smv-run-chip[data-status="processing"], [data-bs-theme="dark"] .smv-page.is-processing .smv-run-chip[data-status="queued"],
[data-layout-mode="dark"] .smv-page.is-processing .smv-run-chip[data-status="processing"], [data-layout-mode="dark"] .smv-page.is-processing .smv-run-chip[data-status="queued"] {
    background: transparent; box-shadow: inset 0 0 0 1px var(--smv-border);
}
.smv-processing.is-initial .smv-progress > .smv-load-eyebrow { display: block; }
.smv-processing.is-initial .smv-progress-head { display: grid; justify-items: start; gap: 0.9rem; }
.smv-processing.is-initial .smv-progress-head > div { flex: none; }
.smv-processing.is-initial .smv-spinner { display: none; }
.smv-processing.is-initial .smv-progress-icon { width: 36px; height: 36px; font-size: 1.05rem; margin: 0; }
.smv-processing.is-initial .smv-progress-title { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 750; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.smv-processing.is-initial .smv-progress-sub { margin-top: 0.85rem; font-size: clamp(1rem, 1.4vw, 1.12rem); line-height: 1.5; max-width: 34ch; }
.smv-processing.is-initial .smv-processing-elapsed {
    order: 3; margin: 0; padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--smv-soft); font-size: 0.8rem; font-weight: 600;
}
.smv-processing.is-initial .smv-progress-bar { height: 6px; background: color-mix(in srgb, var(--smv-accent) 14%, transparent); max-width: 360px; margin: 1.75rem 0 0; }
.smv-processing.is-initial .smv-processing-footnote { margin-top: 1.5rem; }
.smv-processing.is-initial .smv-error { margin: 1.25rem 0 0; }
/* the six stages as a vertical rail */
.smv-processing.is-initial .smv-progress-steps { margin: 0; gap: 0; position: relative; }
.smv-processing.is-initial .smv-progress-steps li {
    position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 1rem; align-items: center;
    padding: 0.8rem 0.9rem 0.8rem 0; font-size: 1rem; transition: color 0.3s;
}
.smv-processing.is-initial .smv-progress-steps li + li::before {
    content: ""; position: absolute; left: 16px; top: calc(-50% + 1.05rem); height: calc(100% - 0.4rem); width: 2px; background: var(--smv-border);
}
.smv-processing.is-initial .smv-progress-steps li.is-done + li::before,
.smv-processing.is-initial .smv-progress-steps li.is-done + li.is-active::before { background: #16a34a; }
.smv-processing.is-initial .smv-step-mark {
    grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-width: 2px; background: var(--smv-bg);
    position: relative; z-index: 1; align-self: start;
}
.smv-processing.is-initial .smv-step-mark b { display: block; font-size: 0.8rem; font-weight: 700; color: var(--smv-muted); }
.smv-processing.is-initial li.is-done .smv-step-mark b { display: none; }
.smv-processing.is-initial li.is-done .smv-step-mark::after { left: 11px; top: 6px; width: 7px; height: 13px; border-width: 0 2.5px 2.5px 0; }
.smv-processing.is-initial li.is-active .smv-step-mark {
    animation: none; border-color: var(--smv-accent); background: var(--smv-accent);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--smv-accent) 16%, transparent); border-top-color: var(--smv-accent);
}
.smv-processing.is-initial li.is-active .smv-step-mark b { color: #fff; }
.smv-processing.is-initial li.is-active .smv-step-mark { animation: smv-pulse 2s ease-out infinite; }
.smv-processing.is-initial li.is-failed .smv-step-mark b, .smv-processing.is-initial li.is-warning .smv-step-mark b { color: #fff; }
.smv-processing.is-initial .smv-step-label { grid-column: 2; align-self: end; line-height: 1.25; }
.smv-processing.is-initial li.is-active .smv-step-label { font-size: 1.12rem; font-weight: 700; }
.smv-processing.is-initial .smv-step-detail { grid-column: 2; margin: 0.15rem 0 0; align-self: start; font-size: 0.85rem; }
.smv-processing.is-initial li.is-pending, .smv-processing.is-initial li.is-pending .smv-step-mark b { color: var(--smv-load-pending-text); }
.smv-processing.is-initial .is-failed .smv-progress-title { color: var(--bs-danger-text-emphasis); }
.smv-processing.is-initial .is-partial .smv-progress-title { color: var(--bs-warning-text-emphasis); }
@keyframes smv-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--smv-accent) 30%, transparent); }
    70%, 100% { box-shadow: 0 0 0 12px transparent; }
}
@media (max-width: 860px) {
    .smv-processing.is-initial { place-items: start center; }
    .smv-processing.is-initial .smv-load-pitch { display: none; }
    .smv-processing.is-initial .smv-progress {
        grid-template-columns: minmax(0, 1fr); row-gap: 0; grid-template-rows: none;
        grid-template-areas: "eyebrow" "head" "bar" "error" "steps" "foot" "conn";
    }
    .smv-processing.is-initial .smv-progress-steps { grid-row: auto; margin-top: 1.75rem; }
    .smv-processing.is-initial .smv-progress-bar { max-width: none; }
}
@media (max-width: 600px) {
    .smv-processing.is-initial .smv-progress-steps li { padding-block: 0.65rem; }
}
.smv-processing-elapsed:empty, .smv-step-detail:empty { display: none; }
.smv-processing .smv-progress-head > div { flex: 1; min-width: 0; }
.smv-processing .smv-progress-steps { margin-top: 1.25rem; gap: 0.9rem; }
.smv-processing-elapsed { color: var(--smv-muted); font-size: 0.78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.smv-processing-footnote { margin: 1.25rem 0 0; color: var(--smv-muted); font-size: 0.8rem; }
.smv-processing-connection { color: var(--bs-warning-text-emphasis); margin: 0.75rem 0 0; font-size: 0.8rem; }
.smv-processing .smv-progress-bar.is-indeterminate span { animation: smv-progress-travel 2.5s ease-in-out infinite alternate; }
.smv-progress-steps li.is-failed .smv-step-mark { border-color: var(--bs-danger); background: var(--bs-danger); }
.smv-progress-steps li.is-warning .smv-step-mark { border-color: var(--bs-warning); background: var(--bs-warning); }
.smv-progress.is-partial { border-color: var(--bs-warning); background: var(--bs-warning-bg-subtle); }
.smv-progress.is-partial .smv-progress-icon { background: var(--bs-warning); color: var(--bs-warning-text-emphasis); }
.smv-processing button:focus-visible { outline: 3px solid rgba(var(--bs-primary-rgb), 0.5); outline-offset: 3px; }
@keyframes smv-progress-travel { from { left: 0; } to { left: 72%; } }
@media (max-width: 600px) {
    .smv-processing .smv-progress-head { flex-wrap: wrap; }
    .smv-processing-elapsed { flex-basis: 100%; margin-left: 2.1rem; }
    .smv-processing .smv-progress-steps li { flex-wrap: wrap; }
    .smv-processing .smv-step-detail { flex-basis: 100%; margin-left: 1.55rem; }
}
.smv-progress {
    margin: 0.75rem 0 1rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--smv-border);
    background: linear-gradient(180deg, rgba(var(--bs-primary-rgb), 0.06), rgba(var(--bs-primary-rgb), 0.02));
}
.smv-progress-head { display: flex; align-items: flex-start; gap: 0.75rem; }
.smv-progress-title { margin: 0; font-weight: 700; font-size: 0.95rem; }
.smv-progress-sub { margin: 0.15rem 0 0; color: var(--smv-muted); font-size: 0.82rem; }
.smv-spinner {
    flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
    border: 2.5px solid rgba(var(--bs-primary-rgb), 0.2); border-top-color: var(--smv-accent);
    animation: smv-spin 0.9s linear infinite;
}
@keyframes smv-spin { to { transform: rotate(360deg); } }
.smv-progress-bar { position: relative; height: 6px; margin: 0.85rem 0 0.75rem; border-radius: 999px; background: rgba(var(--bs-primary-rgb), 0.12); overflow: hidden; }
.smv-progress-bar span {
    position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--smv-accent);
    transition: width 0.6s ease;
}
.smv-progress-bar span::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    animation: smv-sheen 1.6s ease-in-out infinite;
}
@keyframes smv-sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.smv-progress-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.smv-progress-steps li { display: flex; align-items: center; gap: 0.55rem; font-size: 0.85rem; color: var(--smv-muted); }
.smv-progress-steps li.is-active { color: var(--smv-text); font-weight: 600; }
.smv-progress-steps li.is-done { color: var(--smv-text); }
.smv-step-mark b { display: none; }
.smv-step-mark { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--smv-border); position: relative; }
.smv-progress-steps li.is-done .smv-step-mark { border-color: #16a34a; background: #16a34a; }
.smv-progress-steps li.is-done .smv-step-mark::after {
    content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.smv-progress-steps li.is-active .smv-step-mark { border-color: rgba(var(--bs-primary-rgb), 0.25); border-top-color: var(--smv-accent); animation: smv-spin 0.9s linear infinite; }
.smv-step-detail { margin-left: auto; font-weight: 500; font-size: 0.78rem; color: var(--smv-muted); font-variant-numeric: tabular-nums; }
.smv-progress.is-failed { background: rgba(220, 38, 38, 0.06); border-color: rgba(220, 38, 38, 0.3); }
.smv-progress-icon {
    flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: #dc2626; color: #fff; font-weight: 800; font-size: 0.8rem;
}
.smv-previous-hint { margin-top: -0.25rem; }
@media (prefers-reduced-motion: reduce) {
    .smv-area-bucket, .smv-area-lane { transition: none; }
    .smv-spinner, .smv-progress-steps li.is-active .smv-step-mark, .smv-progress-bar span::after { animation: none !important; }
    .smv-processing .smv-progress-bar.is-indeterminate span { animation: none; }
    .smv-processing .smv-progress-bar span { transition: none; }
}
