:root {
  color-scheme: dark;
  --ink-0: #08090b;
  --ink-1: #0d0f12;
  --ink-2: #12151a;
  --ink-3: #181c22;
  --line: #292e36;
  --line-bright: #3b424d;
  --paper: #f1f3f5;
  --muted: #929aa6;
  --dim: #68717d;
  --catapult: #ff6a3d;
  --catapult-soft: #ff9c7e;
  --vision: #62d9ff;
  --vision-soft: #a9ecff;
  --green: #68dda0;
  --red: #ff6572;
  --amber: #ffc65c;
  --radius: 7px;
  --rail: 252px;
  --dock: 336px;
  --topbar: 70px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink-0);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--ink-0);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
video:focus-visible {
  outline: 2px solid var(--vision);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  transform: translateY(-160%);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink-0);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  height: var(--topbar);
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.96);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  color: var(--paper);
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 34px;
  width: auto;
}

.brand-logo--catapult {
  filter: invert(1);
}

.brand-x {
  color: var(--dim);
  font-size: 15px;
  font-style: italic;
  font-weight: 650;
}

.primary-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.nav-button {
  position: relative;
  min-width: 124px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.nav-button::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 2px;
  content: "";
  transform: scaleX(0);
  background: var(--catapult);
  transition: transform 180ms ease;
}

.nav-button:hover,
.nav-button.is-active {
  color: var(--paper);
}

.nav-button.is-active::after {
  transform: scaleX(1);
}

.nav-kicker {
  margin-right: 7px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
}

.topbar-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 0 22px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 3px rgba(104, 113, 125, 0.12);
}

.status-dot.is-live,
.vision-footer .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(104, 221, 160, 0.13);
}

.status-dot.is-error {
  background: var(--red);
}

.workspace-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--dock);
  min-height: calc(100vh - var(--topbar));
}

.view-host {
  min-width: 0;
}

.view {
  padding: 30px clamp(18px, 2.2vw, 34px) 70px;
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--catapult);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.view-header h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(27px, 3vw, 45px);
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.view-deck {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.source-stamp,
.fidelity-verdict {
  min-width: 190px;
  padding-left: 18px;
  border-left: 1px solid var(--line-bright);
}

.source-stamp span,
.fidelity-verdict span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.source-stamp strong,
.fidelity-verdict strong {
  display: block;
  margin: 6px 0 2px;
  font-family: var(--font-mono);
  font-size: 15px;
}

.source-stamp small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--ink-1);
}

.kpi {
  position: relative;
  min-height: 106px;
  padding: 17px 18px;
  border-right: 1px solid var(--line);
}

.kpi:last-child {
  border-right: 0;
}

.kpi-label {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: clamp(25px, 2.4vw, 35px);
  font-weight: 590;
  letter-spacing: -0.045em;
  line-height: 1;
}

.kpi small {
  display: block;
  margin-top: 7px;
  color: var(--dim);
  font-size: 11px;
}

.kpi-accent {
  position: absolute;
  right: 17px;
  bottom: 17px;
  width: 28px;
  height: 3px;
  background: var(--catapult);
}

.kpi:nth-child(3) .kpi-accent {
  background: var(--vision);
}

.kpi-skeleton,
.catalog-loading span,
.fidelity-loading span {
  min-height: 106px;
  animation: shimmer 1.2s infinite linear;
  background: linear-gradient(90deg, var(--ink-1) 0%, var(--ink-3) 48%, var(--ink-1) 100%);
  background-size: 220% 100%;
}

@keyframes shimmer {
  to { background-position-x: -220%; }
}

.practice-grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.control-rail,
.shot-catalog {
  position: sticky;
  top: calc(var(--topbar) + 16px);
  max-height: calc(100vh - var(--topbar) - 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-1);
}

.rail-section {
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

.rail-section:last-child {
  border-bottom: 0;
}

.section-label-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-label-row h2,
.section-label-row h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.section-label-row > span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
}

.section-label-row p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 11px;
}

.drill-list {
  display: grid;
  gap: 2px;
}

.drill-button {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 8px 7px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.drill-button:hover {
  background: var(--ink-2);
  color: var(--paper);
}

.drill-button.is-active {
  border-left-color: var(--catapult);
  background: rgba(255, 106, 61, 0.07);
  color: var(--paper);
}

.drill-number {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
}

.drill-name {
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drill-load {
  color: var(--catapult-soft);
  font-family: var(--font-mono);
  font-size: 9px;
}

.athlete-section {
  max-height: 330px;
  overflow: auto;
}

.athlete-list {
  display: grid;
  gap: 3px;
}

.athlete-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 7px 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.athlete-button:hover,
.athlete-button.is-active {
  border-color: var(--line);
  background: var(--ink-2);
  color: var(--paper);
}

.athlete-button.is-active {
  border-color: rgba(98, 217, 255, 0.35);
}

.athlete-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
}

.athlete-button strong {
  display: block;
  font-size: 11px;
}

.athlete-button small {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.athlete-pl {
  font-family: var(--font-mono);
  font-size: 10px;
}

.practice-stage {
  min-width: 0;
}

.film-panel,
.timeline-panel,
.metric-panel,
.roster-panel,
.shot-summary,
.truth-model {
  border: 1px solid var(--line);
  background: var(--ink-1);
}

.film-matte {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #030405;
}

.film-matte video,
.film-matte img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.film-matte::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  pointer-events: none;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.34);
}

.film-label,
.film-context {
  position: absolute;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 6, 8, 0.78);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  pointer-events: none;
}

.film-label {
  top: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
}

.film-label-left {
  left: 13px;
}

.film-label-right {
  right: 13px;
}

.film-context {
  bottom: 54px;
  left: 13px;
  max-width: calc(100% - 26px);
  padding: 7px 9px;
  color: var(--paper);
}

.live-glyph,
.vision-glyph {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--catapult);
}

.vision-glyph {
  background: var(--vision);
}

.film-transport-meta {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 58px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
}

.meta-label {
  display: block;
  margin-bottom: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.film-transport-meta strong {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.text-button,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.text-button {
  padding: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  text-decoration: underline;
  text-decoration-color: var(--line-bright);
  text-underline-offset: 4px;
}

.text-button:hover,
.icon-button:hover {
  color: var(--paper);
}

.timeline-panel {
  margin-top: 12px;
  padding: 13px 15px 12px;
}

.timeline-axis {
  display: flex;
  justify-content: space-between;
  margin: 0 0 6px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.drill-timeline {
  position: relative;
  height: 42px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), var(--line) 10%);
}

.timeline-drill {
  position: absolute;
  top: 8px;
  height: 25px;
  min-width: 2px;
  overflow: hidden;
  border: 0;
  background: rgba(255, 106, 61, 0.36);
  text-indent: -9999px;
}

.timeline-drill:hover,
.timeline-drill.is-active {
  background: var(--catapult);
}

.timeline-event {
  position: absolute;
  z-index: 4;
  bottom: 2px;
  width: 3px;
  height: 7px;
  transform: translateX(-1px);
  border: 0;
  background: var(--vision);
  text-indent: -9999px;
}

.timeline-playhead {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.timeline-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 9px;
  color: var(--dim);
  font-size: 9px;
}

.legend-swatch {
  display: inline-block;
  width: 8px;
  height: 4px;
  margin-right: 5px;
  background: var(--catapult);
}

.legend-swatch.event {
  width: 3px;
  height: 7px;
  background: var(--vision);
}

.timeline-readout {
  margin-left: auto;
  font-family: var(--font-mono);
}

.practice-evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(270px, 0.75fr);
  gap: 12px;
  margin-top: 12px;
}

.metric-panel {
  min-height: 228px;
  padding: 15px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(8, minmax(24px, 1fr));
  gap: 7px;
  align-items: end;
  height: 165px;
  padding-top: 8px;
}

.bar-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 7px;
  height: 100%;
}

.bar-column button {
  position: relative;
  align-self: end;
  width: 100%;
  min-height: 3px;
  border: 0;
  background: var(--line-bright);
  transition: background 120ms ease;
}

.bar-column button::before {
  position: absolute;
  top: -17px;
  left: 50%;
  content: attr(data-value);
  transform: translateX(-50%);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.bar-column button:hover,
.bar-column button.is-active {
  background: var(--catapult);
}

.bar-column span {
  overflow: hidden;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-rail {
  min-height: 160px;
}

.event-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.event-summary strong {
  font-family: var(--font-mono);
  font-size: 25px;
}

.event-summary span {
  color: var(--dim);
  font-size: 10px;
}

.event-list {
  display: grid;
  gap: 3px;
  margin-top: 9px;
}

.event-button {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.event-button:hover {
  background: var(--ink-2);
  color: var(--paper);
}

.event-button time,
.event-button small {
  font-family: var(--font-mono);
  font-size: 8px;
}

.event-button i {
  height: 3px;
  background: var(--vision);
}

.roster-panel {
  margin-top: 18px;
  padding: 16px 17px 6px;
}

.evidence-key {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.evidence-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid var(--line-bright);
  border-radius: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.evidence-tag.observed {
  border-color: rgba(255, 106, 61, 0.45);
  color: var(--catapult-soft);
}

.evidence-tag.cv {
  border-color: rgba(98, 217, 255, 0.45);
  color: var(--vision-soft);
}

.evidence-tag.estimated {
  border-color: rgba(255, 198, 92, 0.45);
  color: var(--amber);
}

.evidence-tag.derived {
  border-color: rgba(104, 221, 160, 0.42);
  color: var(--green);
}

.evidence-tag.human {
  border-color: rgba(226, 166, 255, 0.48);
  color: #e2a6ff;
}

.evidence-tag.review {
  border-color: rgba(255, 198, 92, 0.45);
  color: var(--amber);
}

.evidence-tag.unavailable {
  border-style: dashed;
  color: var(--dim);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}

.data-table th {
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--line-bright);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 4px;
  text-align: left;
}

.data-table th:last-child,
.data-table td:last-child {
  text-align: left;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  text-align: right;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover,
.data-table tbody tr.is-active {
  background: var(--ink-2);
}

.data-table .athlete-cell {
  font-family: var(--font-sans);
  font-weight: 650;
}

.delta-high {
  color: var(--amber);
}

.quality-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.quality-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.quality-pill.review i {
  background: var(--amber);
}

.quality-pill.fault i {
  background: var(--red);
}

.stream-flags {
  max-width: 210px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-sans);
  text-overflow: ellipsis;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 20px;
  color: var(--dim);
  text-align: center;
}

.empty-state.compact {
  min-height: 100px;
  padding: 10px;
  font-size: 11px;
}

/* Shot lab */
.shot-header {
  align-items: center;
}

.source-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
}

.source-button {
  min-width: 142px;
  padding: 11px 13px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--ink-1);
  color: var(--muted);
  text-align: left;
}

.source-button:last-child {
  border-right: 0;
}

.source-button span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.source-button strong {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

.source-button:hover,
.source-button.is-active {
  background: var(--ink-2);
  color: var(--paper);
}

.source-button.is-active span {
  color: var(--vision);
}

.shot-workspace {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.shot-catalog {
  display: flex;
  min-height: 680px;
  flex-direction: column;
}

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.catalog-header strong {
  font-size: 11px;
}

.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
}

.search-field {
  position: relative;
  display: block;
  margin: 12px 12px 8px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.6;
}

.search-field input,
.filter-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-2);
  color: var(--paper);
}

.search-field input {
  height: 38px;
  padding: 0 10px 0 34px;
}

.search-field input::placeholder {
  color: var(--dim);
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 0 12px 10px;
}

.filter-row label span {
  display: block;
  margin: 0 0 4px 2px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-row select {
  height: 32px;
  padding: 0 7px;
  font-size: 9px;
}

.catalog-count {
  padding: 7px 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.shot-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.catalog-loading {
  display: grid;
  gap: 1px;
}

.catalog-loading span {
  min-height: 68px;
}

.shot-list-button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.shot-list-button:hover {
  background: var(--ink-2);
  color: var(--paper);
}

.shot-list-button.is-active {
  border-left-color: var(--vision);
  background: rgba(98, 217, 255, 0.055);
  color: var(--paper);
}

.shot-index {
  font-family: var(--font-mono);
  font-size: 10px;
}

.shot-list-button strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-list-button small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.result-dot.made {
  background: var(--green);
}

.shot-stage {
  min-width: 0;
}

.shot-film-panel {
  max-width: 1100px;
  margin: 0 auto;
}

.mavs-film img {
  background: #050607;
}

.frame-controls {
  display: grid;
  grid-template-columns: auto auto auto minmax(100px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 51px;
  padding: 8px 11px;
  border-top: 1px solid var(--line);
}

.play-button {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid var(--vision);
  border-radius: 50%;
  background: transparent;
  color: var(--vision);
  font-size: 10px;
}

.frame-controls input {
  width: 100%;
  accent-color: var(--vision);
}

.frame-controls > span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.shot-summary {
  max-width: 1100px;
  margin: 12px auto 0;
  padding: 17px;
}

.shot-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.shot-title-row h2 {
  margin: 0;
  font-size: clamp(19px, 2vw, 27px);
  letter-spacing: -0.025em;
}

.result-pill {
  padding: 7px 10px;
  border: 1px solid var(--line-bright);
  border-radius: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.result-pill.made {
  border-color: rgba(104, 221, 160, 0.45);
  color: var(--green);
}

.result-pill.missed {
  border-color: rgba(255, 101, 114, 0.45);
  color: var(--red);
}

.phase-ribbon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.phase-segment {
  position: relative;
  min-height: 79px;
  padding: 13px 12px;
  border-right: 1px solid var(--line);
}

.phase-segment:last-child {
  border-right: 0;
}

.phase-segment::before {
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--vision);
  opacity: var(--phase-confidence, 1);
}

.phase-segment span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.phase-segment strong {
  display: block;
  margin: 8px 0 5px;
  font-family: var(--font-mono);
  font-size: 18px;
}

.phase-segment small {
  color: var(--muted);
  font-size: 9px;
}

.shot-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 26px;
}

.spec-list {
  border-top: 1px solid var(--line);
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
}

.spec-row > span:first-child {
  color: var(--muted);
  font-size: 10px;
}

.spec-row strong {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 550;
}

.film-read {
  min-height: 150px;
  padding: 14px;
  border-left: 2px solid var(--vision);
  background: var(--ink-2);
  color: #c4cad1;
  font-size: 11px;
}

.film-read p {
  margin: 0 0 11px;
}

.film-read p:last-child {
  margin-bottom: 0;
}

/* Fidelity */
.fidelity-verdict strong {
  color: var(--green);
}

.fidelity-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--ink-1);
}

.fidelity-loading {
  display: contents;
}

.fidelity-loading span {
  min-height: 178px;
  border-right: 1px solid var(--line);
}

.fidelity-score {
  min-height: 178px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.fidelity-score:last-child {
  border-right: 0;
}

.fidelity-score .score-source {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.fidelity-score strong {
  display: block;
  margin: 18px 0 4px;
  font-family: var(--font-mono);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.fidelity-score .score-delta {
  color: var(--catapult);
  font-family: var(--font-mono);
  font-size: 9px;
}

.fidelity-score p {
  max-width: 390px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.fidelity-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.audit-panel {
  min-height: 330px;
  padding: 17px;
  border: 1px solid var(--line);
  background: var(--ink-1);
}

.audit-panel header {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.audit-panel header span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.audit-panel h2 {
  margin: 5px 0 0;
  font-size: 16px;
}

.audit-finding {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.audit-finding:last-child {
  border-bottom: 0;
}

.audit-finding strong {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
}

.audit-finding p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.truth-model {
  margin-top: 18px;
  padding: 17px;
}

.truth-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.truth-grid > div {
  min-height: 105px;
  padding: 15px 12px;
  border-right: 1px solid var(--line);
}

.truth-grid > div:last-child {
  border-right: 0;
}

.truth-grid p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 9px;
}

/* Vision dock */
.vision-dock {
  position: sticky;
  z-index: 20;
  top: var(--topbar);
  display: flex;
  height: calc(100vh - var(--topbar));
  min-height: 600px;
  flex-direction: column;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #0a0c0f;
}

.vision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 70px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.vision-header > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.vision-orbit {
  position: relative;
  width: 27px;
  height: 27px;
  border: 1px solid var(--vision);
  border-radius: 50%;
}

.vision-orbit::before,
.vision-orbit::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.vision-orbit::before {
  inset: 6px;
  background: var(--vision);
  box-shadow: 0 0 16px rgba(98, 217, 255, 0.45);
}

.vision-orbit::after {
  top: -3px;
  left: 11px;
  width: 4px;
  height: 4px;
  background: var(--paper);
}

.vision-header p {
  margin: 0;
  color: var(--vision);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.11em;
}

.vision-header h2 {
  margin: 3px 0 0;
  font-size: 12px;
}

.backend-state {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.backend-state.is-live {
  color: var(--green);
}

.backend-state.is-busy {
  color: var(--amber);
}

.backend-state.is-error {
  color: var(--red);
}

.active-context,
.sample-window,
.prompt-section,
.vision-form {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.active-context strong {
  display: block;
  margin: 5px 0 7px;
  font-size: 12px;
}

.active-context p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 11px;
}

.sample-window-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
}

.sample-window-header span {
  color: var(--muted);
}

.sample-window-header strong {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
}

.sample-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  margin: 8px 0 5px;
}

.sample-track span {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line-bright);
}

.sample-track i {
  z-index: 1;
  width: 4px;
  height: 9px;
  border-radius: 1px;
  background: var(--vision);
}

.sample-window p {
  margin: 0;
  color: var(--dim);
  font-size: 9px;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.prompt-chip {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  text-align: left;
}

.prompt-chip:hover {
  border-color: rgba(98, 217, 255, 0.5);
  color: var(--paper);
}

.vision-form label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
}

.vision-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-2);
  color: var(--paper);
  font-size: 11px;
  line-height: 1.5;
}

.vision-form textarea::placeholder {
  color: var(--dim);
}

.analyze-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--vision);
  border-radius: 3px;
  background: var(--vision);
  color: #051014;
  font-size: 10px;
  font-weight: 750;
}

.analyze-button:hover {
  background: var(--vision-soft);
}

.analysis-result {
  min-height: 190px;
  flex: 1;
  padding: 15px 16px;
  overflow-y: auto;
}

.analysis-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--dim);
  text-align: center;
}

.analysis-empty svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: var(--line-bright);
  stroke-width: 1;
}

.analysis-empty p {
  max-width: 240px;
  margin: 10px 0 0;
  font-size: 10px;
}

.analysis-thinking {
  display: grid;
  gap: 9px;
}

.thinking-line {
  height: 9px;
  animation: shimmer 1.2s infinite linear;
  background: linear-gradient(90deg, var(--ink-2), var(--line), var(--ink-2));
  background-size: 220% 100%;
}

.thinking-line:nth-child(2) { width: 87%; }
.thinking-line:nth-child(3) { width: 63%; }

.analysis-answer header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.analysis-answer header strong {
  font-size: 10px;
}

.analysis-answer header span {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 8px;
}

.analysis-answer pre {
  margin: 12px 0 0;
  color: #d1d6dc;
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 1.58;
  white-space: pre-wrap;
}

.analysis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.analysis-meta span {
  padding: 3px 5px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
}

.analysis-variance {
  margin-top: 13px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--ink-2);
}

.analysis-variance.is-material {
  border-left: 2px solid var(--amber);
}

.analysis-variance > strong {
  color: var(--amber);
  font-size: 9px;
}

.analysis-variance p {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.analysis-variance small {
  display: block;
  margin-top: 8px;
  color: var(--dim);
  font-size: 8px;
}

.analysis-error {
  padding: 12px;
  border-left: 2px solid var(--red);
  background: rgba(255, 101, 114, 0.05);
}

.analysis-error strong {
  color: var(--red);
  font-size: 10px;
}

.analysis-error p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.vision-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.vision-footer span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mobile-nav {
  display: none;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: 340px;
  padding: 10px 13px;
  transform: translateY(140%);
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  background: var(--ink-2);
  color: var(--paper);
  font-size: 10px;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1280px) {
  :root {
    --dock: 310px;
    --rail: 228px;
  }

  .view {
    padding-right: 20px;
    padding-left: 20px;
  }

  .topbar {
    grid-template-columns: 220px 1fr 210px;
  }

  .practice-evidence-grid {
    grid-template-columns: 1fr;
  }

  .metric-panel {
    min-height: 210px;
  }

  .truth-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .truth-grid > div:nth-child(3) {
    border-right: 0;
  }

  .truth-grid > div:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 1080px) {
  .workspace-frame {
    display: block;
  }

  .vision-dock {
    position: relative;
    top: auto;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0 20px 80px;
    border: 1px solid var(--line);
  }

  .analysis-result {
    min-height: 220px;
  }

  .topbar {
    grid-template-columns: 190px 1fr 180px;
  }

  .fidelity-details {
    grid-template-columns: 1fr;
  }

  .audit-panel {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar: 58px;
  }

  body {
    padding-bottom: 54px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand {
    padding: 0 14px;
  }

  .brand-logo {
    height: 27px;
  }

  .primary-nav,
  .topbar-status {
    display: none;
  }

  .view {
    padding: 22px 13px 40px;
  }

  .view-header {
    display: block;
  }

  .view-header h1 {
    font-size: 30px;
  }

  .source-stamp,
  .fidelity-verdict {
    margin-top: 18px;
  }

  .kpi-strip {
    grid-template-columns: 1fr 1fr;
  }

  .kpi:nth-child(2) {
    border-right: 0;
  }

  .kpi:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .practice-grid,
  .shot-workspace {
    display: block;
  }

  .control-rail,
  .shot-catalog {
    position: relative;
    top: auto;
    max-height: none;
    margin-bottom: 12px;
  }

  .drill-list {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .drill-button {
    min-width: 176px;
    scroll-snap-align: start;
  }

  .athlete-section {
    max-height: none;
  }

  .athlete-list {
    grid-template-columns: 1fr 1fr;
  }

  .film-transport-meta {
    grid-template-columns: 1fr 1fr;
  }

  .film-transport-meta .text-button {
    grid-column: 1 / -1;
    text-align: left;
  }

  .film-label {
    top: 7px;
    padding: 4px 6px;
    font-size: 7px;
  }

  .film-label-left {
    left: 7px;
  }

  .film-label-right {
    right: 7px;
  }

  .film-context {
    bottom: 38px;
    left: 7px;
    padding: 5px 7px;
    font-size: 7px;
  }

  .timeline-readout {
    display: none;
  }

  .bar-chart {
    overflow-x: auto;
  }

  .bar-column {
    min-width: 35px;
  }

  .roster-panel {
    margin-top: 12px;
  }

  .source-switch {
    margin-top: 18px;
  }

  .source-button {
    min-width: 0;
  }

  .shot-catalog {
    min-height: 0;
  }

  .shot-list {
    display: flex;
    max-height: 190px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .shot-list-button {
    min-width: 210px;
    border-right: 1px solid var(--line);
  }

  .shot-detail-grid {
    grid-template-columns: 1fr;
  }

  .fidelity-hero {
    grid-template-columns: 1fr;
  }

  .fidelity-score {
    min-height: 145px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .fidelity-score:last-child {
    border-bottom: 0;
  }

  .truth-grid {
    grid-template-columns: 1fr 1fr;
  }

  .truth-grid > div {
    border-right: 1px solid var(--line) !important;
    border-bottom: 1px solid var(--line);
  }

  .truth-grid > div:nth-child(2n) {
    border-right: 0 !important;
  }

  .vision-dock {
    margin: 0 13px 20px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: 54px;
    border-top: 1px solid var(--line);
    background: rgba(8, 9, 11, 0.97);
    backdrop-filter: blur(12px);
  }

  .mobile-nav button {
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    color: var(--dim);
    font-size: 10px;
    font-weight: 650;
  }

  .mobile-nav button.is-active {
    color: var(--paper);
    box-shadow: inset 0 2px var(--catapult);
  }
}

@media (max-width: 520px) {
  .view-header h1 {
    font-size: 27px;
  }

  .kpi {
    min-height: 94px;
    padding: 14px;
  }

  .kpi strong {
    font-size: 25px;
  }

  .athlete-list {
    grid-template-columns: 1fr;
  }

  .film-matte {
    aspect-ratio: 4 / 3;
  }

  .timeline-panel {
    padding-right: 10px;
    padding-left: 10px;
  }

  .phase-ribbon {
    display: block;
  }

  .phase-segment {
    min-height: 62px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .phase-segment:last-child {
    border-bottom: 0;
  }

  .shot-title-row {
    align-items: flex-start;
  }

  .truth-grid {
    grid-template-columns: 1fr;
  }

  .truth-grid > div {
    border-right: 0 !important;
  }

  .vision-header,
  .active-context,
  .sample-window,
  .prompt-section,
  .vision-form,
  .analysis-result {
    padding-right: 13px;
    padding-left: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
