:root {
  color-scheme: light;
  --bg: #eef1f4;
  --panel: #ffffff;
  --panel-alt: #f7f8fa;
  --ink: #202327;
  --muted: #66717d;
  --line: #d8dee5;
  --charcoal: #17191d;
  --teal: #087f78;
  --teal-soft: #d9f0ed;
  --amber: #b56b13;
  --amber-soft: #fff1d6;
  --coral: #c7463f;
  --coral-soft: #ffe4e1;
  --blue: #315fba;
  --violet: #6f4bb2;
  --green: #2d7d46;
  --radius: 8px;
  --shadow: 0 20px 50px rgb(30 36 45 / 12%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dark-theme {
  color-scheme: dark;
  --bg: #101317;
  --panel: #181d23;
  --panel-alt: #222832;
  --ink: #eef2f6;
  --muted: #a2acb8;
  --line: #343c48;
  --charcoal: #f3f6f9;
  --teal: #25b8aa;
  --teal-soft: #123f3d;
  --amber: #f1ad4e;
  --amber-soft: #382817;
  --coral: #f26d65;
  --coral-soft: #3b1d1f;
  --blue: #78a6ff;
  --violet: #aa8bef;
  --green: #6bd489;
  --shadow: 0 24px 60px rgb(0 0 0 / 34%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100%;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

.filter-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

body.dark-theme .topbar {
  background: #15191f;
}

body.dark-theme .brand-mark {
  background: #eef2f6;
  color: #101317;
}

body.dark-theme .settings-menu,
body.dark-theme .modal-card,
body.dark-theme .toast {
  background: #181d23;
}

body.dark-theme .path-input,
body.dark-theme .select-control,
body.dark-theme .number-control,
body.dark-theme .button,
body.dark-theme .icon-button,
body.dark-theme .segmented button,
body.dark-theme .hand-toggle button,
body.dark-theme .state {
  background: #1f2630;
  color: var(--ink);
}

body.dark-theme .button.primary {
  background: var(--teal);
  color: #061312;
}

body.dark-theme .video-stage {
  background:
    linear-gradient(45deg, rgb(255 255 255 / 4%) 25%, transparent 25%),
    linear-gradient(-45deg, rgb(255 255 255 / 4%) 25%, transparent 25%),
    #07090c;
  background-size: 28px 28px;
}

body.dark-theme .drop-zone,
body.dark-theme .empty-state,
body.dark-theme .scan-row,
body.dark-theme .job-row,
body.dark-theme .issue,
body.dark-theme .metric {
  background: #1f2630;
}

body.dark-theme .timeline {
  background: #15191f;
}

body.dark-theme .confidence-track {
  background: #222832;
}

body.dark-theme .playhead {
  background: #f8fafc;
}

body.dark-theme .hand-guide {
  background: #12161c;
}

body.dark-theme .hand-guide-card {
  background: #151b22;
}

body.dark-theme .guide-bone {
  stroke: #94a3b8;
}

body.dark-theme .guide-dot {
  fill: #1f2630;
  stroke: #d7dee8;
}

body.dark-theme .guide-dot.selected {
  fill: var(--coral);
  stroke: #f8fafc;
}

body.dark-theme .guide-dot.same-finger {
  fill: #123f3d;
  stroke: var(--teal);
}

body.dark-theme .guide-dot.modified {
  fill: #36d46b;
  stroke: #8df3aa;
}

body.dark-theme .guide-label,
body.dark-theme .guide-id {
  fill: #d7dee8;
  stroke: #12161c;
}

body.dark-theme .guide-readout,
body.dark-theme .shortcut-grid span {
  background: #1f2630;
}

body.dark-theme .guide-readout {
  color: #d7dee8;
}

body.dark-theme .shortcut-grid span {
  color: #d7dee8;
}

body.dark-theme .shortcut-grid strong {
  color: #f3f6f9;
}

body.dark-theme .log-row.accepted,
body.dark-theme .toast.success {
  background: #11331d;
  color: #c9f7d7;
  border-color: #2a7c44;
}

body.dark-theme .log-row.rejected,
body.dark-theme .toast.error,
body.dark-theme .scan-row.rejected,
body.dark-theme .scan-row.error {
  background: #3b1d1f;
  color: #ffd1cf;
  border-color: #8c3933;
}

html {
  height: 100%;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
  line-height: 1.2;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
}

.brand p,
.panel-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.run-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgb(45 125 70 / 12%);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-wrap {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.settings-button {
  min-width: 96px;
}

.settings-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(460px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.settings-menu[hidden] {
  display: none;
}

.modal-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 40px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.modal-dialog::backdrop {
  background: rgb(15 23 42 / 58%);
}

.modal-card {
  display: grid;
  max-height: min(720px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-card-compact {
  max-width: 460px;
}

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

.modal-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.modal-body ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}

.danger-action {
  border-color: #9f2b25;
  background: #c7463f;
}

body.dark-theme .modal-dialog::backdrop {
  background: rgb(0 0 0 / 66%);
}

.settings-block {
  display: grid;
  gap: 9px;
}

.settings-block + .settings-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.settings-block h2 {
  font-size: 13px;
}

.manual-ingest {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.manual-ingest h3 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

.settings-label {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-range-control {
  margin-top: 0;
}

.cache-preload-panel {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
}

.cache-preload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

body.dark-theme .cache-preload-header {
  color: var(--muted);
}

.cache-progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #e8edf3;
}

.cache-progress::-webkit-progress-bar {
  background: #e8edf3;
}

.cache-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--teal);
}

.cache-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--teal);
}

body.dark-theme .cache-progress,
body.dark-theme .cache-progress::-webkit-progress-bar {
  background: #11161d;
}

.cache-progress-text {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.path-input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.select-control {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.number-control {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  color: #344054;
  font-size: 13px;
  white-space: nowrap;
}

#file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.button,
.icon-button,
.segmented button,
.hand-toggle button,
.state {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 7px;
  min-height: 34px;
}

.button {
  padding: 8px 12px;
  font-weight: 700;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button.compact {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.button.full-width {
  width: 100%;
}

.button.primary {
  border-color: #0a6963;
  background: var(--teal);
  color: #fff;
}

.button.secondary:hover,
.icon-button:hover {
  border-color: #9ca3af;
}

.button.toggle-active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #045c58;
}

body.dark-theme .button.toggle-active {
  border-color: var(--teal);
  background: rgb(45 188 178 / 20%);
  color: #8de8df;
}

.marker-button.marker-set,
.marker-button.toggle-active.marker-set {
  border-color: #991b1b;
  background: #fee2e2;
  color: #991b1b;
}

.marker-button.toggle-active:not(.marker-set) {
  border-color: #ef4444;
  background: #fff1f2;
  color: #991b1b;
}

body.dark-theme .marker-button.marker-set,
body.dark-theme .marker-button.toggle-active.marker-set,
body.dark-theme .marker-button.toggle-active:not(.marker-set) {
  border-color: #f87171;
  background: rgb(127 29 29 / 34%);
  color: #fecaca;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 7px 10px;
  font-weight: 800;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(520px, 1fr) minmax(270px, 330px);
  gap: 12px;
  padding: 12px;
  min-height: 0;
  overflow: hidden;
}

.panel,
.viewer-panel {
  min-width: 0;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.inspector-panel {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.queue-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.queue-layout-toggle {
  font-size: 18px;
  line-height: 1;
}

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

.inspector-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.inspector-layout-toggle {
  display: none;
  font-size: 17px;
  line-height: 1;
}

@media (min-width: 781px) {
  .app-shell.queue-collapsed .workspace {
    grid-template-columns: 56px minmax(320px, 0.8fr) minmax(360px, 1.25fr);
  }

  .app-shell.queue-collapsed .queue-panel {
    align-items: center;
  }

  .app-shell.queue-collapsed .queue-panel > .panel-header {
    width: 100%;
    justify-content: center;
    padding: 10px 6px;
    border-bottom: 0;
  }

  .app-shell.queue-collapsed .queue-panel > .panel-header > div:first-child,
  .app-shell.queue-collapsed .queue-panel > .panel-section {
    display: none;
  }

  .app-shell.queue-collapsed .queue-layout-toggle {
    width: 36px;
    height: 36px;
  }

  .app-shell.queue-collapsed .active-hand-section {
    max-width: 440px;
  }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.issue-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 19px;
}

.metric-unresolved {
  border-color: rgb(239 68 68 / 42%);
}

.metric-unresolved strong {
  color: #fb7185;
}

.metric-fixed {
  border-color: rgb(34 197 94 / 42%);
}

.metric-fixed strong {
  color: #4ade80;
}

.segmented,
.hand-toggle {
  display: grid;
  gap: 6px;
}

.segmented {
  grid-template-columns: repeat(3, 1fr);
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--line);
}

.segmented button {
  padding: 7px 8px;
  font-weight: 700;
}

.segmented .active,
.hand-toggle .active,
.state.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #045c58;
}

.issue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  overflow: auto;
}

.scan-list,
.job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  margin-top: 10px;
  overflow: auto;
}

.settings-scan-list {
  max-height: min(320px, 42vh);
}

.queue-panel .job-list {
  max-height: 158px;
}

.jobs-section,
.validation-section {
  flex: 0 0 auto;
}

.issues-section {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.issues-section .metric-grid {
  flex: 0 0 auto;
  margin-top: 10px;
  padding: 0;
  border-bottom: 0;
}

.issues-section .issue-list {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 10px;
  padding: 0;
}

.scan-row,
.job-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  text-align: left;
}

.job-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 6px;
  cursor: default;
}

.job-row.active,
.scan-row.ready:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 3px 0 0 var(--teal);
}

.scan-row.rejected,
.scan-row.error {
  border-color: #efb0ac;
  background: var(--coral-soft);
}

.scan-row strong,
.scan-row small,
.job-row strong,
.job-row small {
  display: block;
}

.job-select {
  min-width: 0;
  min-height: 44px;
  padding: 4px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.job-select:hover {
  background: rgb(20 184 166 / 10%);
}

.job-delete {
  align-self: center;
}

.job-delete svg {
  fill: currentColor;
  stroke: none;
}

.scan-row small,
.job-row small {
  margin-top: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.scan-row > span {
  font-size: 12px;
  font-weight: 800;
}

.bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.inspector-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.action-group .button.compact {
  flex: 1 1 calc(50% - 7px);
}

.action-group-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.action-group-primary .button.compact {
  flex: initial;
}

.action-disclosure {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
  overflow: hidden;
}

.action-disclosure summary {
  cursor: pointer;
  min-height: 32px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.action-disclosure[open] summary {
  border-bottom: 1px solid var(--line);
}

.action-disclosure .action-group {
  padding: 8px;
}

.action-group .full-row {
  flex-basis: 100%;
}

.danger-icon {
  width: 36px;
  min-width: 36px;
  height: 32px;
  padding: 0;
  border-color: #efb0ac;
  color: #b42318;
}

.danger-icon:not(:disabled):hover {
  border-color: var(--coral);
  background: var(--coral-soft);
  color: var(--coral);
}

body.dark-theme .action-disclosure {
  background: #1f2630;
}

body.dark-theme .danger-icon {
  border-color: #7f3637;
  color: #ff8f87;
}

.danger-text {
  color: #9f2b25;
}

.empty-state {
  padding: 12px;
  border: 1px dashed #b9c1cc;
  border-radius: 7px;
  color: var(--muted);
  background: #f9fafb;
  font-size: 13px;
}

.issue {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  text-align: left;
  padding: 10px;
}

.issue.active {
  border-color: var(--teal);
  box-shadow: inset 3px 0 0 var(--teal);
}

.issue.resolved {
  border-color: rgb(45 125 70 / 45%);
  background: rgb(45 125 70 / 12%);
  box-shadow: inset 3px 0 0 var(--green);
}

.issue.resolved.active {
  border-color: var(--teal);
  background: linear-gradient(90deg, rgb(45 125 70 / 16%), var(--teal-soft));
}

.issue.resolved .issue-priority {
  background: var(--green);
}

.issue strong,
.issue small {
  display: block;
}

.issue small {
  margin-top: 3px;
  color: var(--muted);
}

.issue-priority {
  display: grid;
  width: 34px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.issue-priority.high {
  background: var(--coral);
}

.issue-priority.medium {
  background: var(--amber);
}

.issue-priority.low {
  background: var(--blue);
}

.panel-section {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.ingest-section {
  margin-top: auto;
}

.drop-zone {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 86px;
  margin-top: 10px;
  border: 1px dashed #9aa4b2;
  border-radius: 7px;
  background: #f9fafb;
  text-align: center;
}

.drop-zone.dragging {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.drop-zone span,
.ingest-log {
  color: var(--muted);
  font-size: 12px;
}

.ingest-log {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  max-height: 106px;
  overflow: auto;
}

.log-row {
  padding: 7px 8px;
  border-radius: 6px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
}

.log-row.accepted {
  border-color: #9bc7ad;
  background: #ecf7ef;
  color: #245d36;
}

.log-row.rejected {
  border-color: #eba39e;
  background: var(--coral-soft);
  color: #8b2823;
}

.viewer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(300px, 1fr) auto;
  overflow: hidden;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.toolbar-info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.transport {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.play {
  min-width: 58px;
}

.time-readout {
  display: grid;
  gap: 2px;
  min-width: 118px;
}

.time-readout strong {
  font-size: 13px;
}

.time-readout span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.frame-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.frame-jump label {
  padding-left: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.frame-jump input {
  width: 82px;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.frame-jump input:disabled {
  opacity: 0.58;
}

body.dark-theme .frame-jump {
  background: #171d26;
}

.review-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.interpolation-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.keyframe-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tool-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  flex: 0 0 auto;
}

.tool-group-label {
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.interp-hand-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.interp-hand-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--teal);
}

body.dark-theme .interpolation-tools {
  background: #171d26;
}

body.dark-theme .tool-divider {
  background: #2c3442;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.drag-mode-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.drag-mode-row .mode-toggle {
  flex: 1 1 130px;
}

.adjacent-copy-row,
.side-reassign-row {
  display: grid;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
}

.adjacent-copy-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.side-reassign-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.adjacent-copy-row span,
.side-reassign-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.adjacent-copy-row .button,
.side-reassign-row .button {
  min-width: 82px;
}

body.dark-theme .mode-toggle {
  background: #1f2630;
  color: var(--ink);
}

body.dark-theme .adjacent-copy-row,
body.dark-theme .side-reassign-row {
  background: #1f2630;
}

.mode-toggle {
  margin-top: 8px;
}

.inline-mode {
  margin-top: 0;
}

.image-view-panel,
.overlay-panel,
.landmarks-panel {
  display: grid;
  gap: 10px;
}

.image-view-panel summary,
.overlay-panel summary,
.landmarks-panel summary {
  cursor: pointer;
  color: #4b5563;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.dark-theme .image-view-panel summary,
body.dark-theme .overlay-panel summary,
body.dark-theme .landmarks-panel summary {
  color: #d7dee8;
}

.image-view-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.image-view-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.image-view-presets .button {
  min-width: 0;
  padding-inline: 6px;
}

.image-view-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.compact-range {
  margin-top: 8px;
}

.video-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  --view-zoom: 1;
  --view-pan-x: 0px;
  --view-pan-y: 0px;
  --media-aspect: 16 / 9;
  --media-aspect-value: 1.7778;
  background:
    linear-gradient(45deg, rgb(255 255 255 / 3%) 25%, transparent 25%),
    linear-gradient(-45deg, rgb(255 255 255 / 3%) 25%, transparent 25%),
    #15171a;
  background-size: 28px 28px;
}

.video-stage video,
.video-stage canvas {
  grid-area: 1 / 1;
  width: min(100%, calc((100vh - 220px) * var(--media-aspect-value)));
  max-width: 100%;
  aspect-ratio: var(--media-aspect);
  object-fit: contain;
  transform: translate(var(--view-pan-x), var(--view-pan-y)) scale(var(--view-zoom));
  transform-origin: center center;
}

.video-stage video {
  background: #111;
}

.video-stage canvas {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  cursor: crosshair;
}

.video-stage canvas.whole-hand-mode {
  cursor: move;
}

.video-stage.panning,
.video-stage.panning canvas {
  cursor: grabbing;
}

.zoom-readout {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.interpolation-bridge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  flex: 0 1 auto;
  gap: 5px;
  min-height: 30px;
  max-width: 280px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.bridge-group {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}

.bridge-group.blocked {
  color: #7a4b00;
}

.interpolation-bridge.ready {
  color: #075e57;
}

.interpolation-bridge.partial {
  color: #7a4b00;
}

.interpolation-bridge.blocked {
  color: #7a4b00;
}

.bridge-label {
  color: inherit;
}

.bridge-divider {
  color: var(--muted);
}

body.dark-theme .interpolation-bridge {
  color: #aab4c2;
}

body.dark-theme .interpolation-bridge.ready {
  color: #67e8dc;
}

body.dark-theme .interpolation-bridge.partial {
  color: #f7c66d;
}

body.dark-theme .bridge-group {
  color: #dbe4ee;
}

body.dark-theme .bridge-group.blocked,
body.dark-theme .interpolation-bridge.blocked {
  color: #f7c66d;
}

.keypoint-count-readout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.keypoint-count-readout span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 5px;
  border-radius: 5px;
}

.keypoint-count-readout span.active {
  background: var(--teal-soft);
  color: #08645e;
}

.keypoint-count-readout.loading {
  color: var(--muted);
}

body.dark-theme .keypoint-count-readout {
  background: #1f2630;
  color: #dbe4ee;
}

body.dark-theme .keypoint-count-readout span.active {
  background: rgb(45 212 191 / 18%);
  color: #67e8dc;
}

.stage-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  max-width: calc(100% - 28px);
  padding: 7px 10px;
  border-radius: 7px;
  background: rgb(23 25 29 / 82%);
  color: #fff;
  font-size: 12px;
}

.timeline {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-top span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-slider {
  width: 100%;
  margin-top: 10px;
  accent-color: var(--teal);
}

.track,
.keyframe-row {
  position: relative;
  width: 100%;
}

.confidence-track {
  height: 20px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #e8edf2;
  overflow: hidden;
}

.confidence {
  position: absolute;
  top: 0;
  bottom: 0;
}

.confidence.good {
  background: #8fcf9d;
}

.confidence.warn {
  background: #f0b75a;
}

.confidence.bad {
  background: #d9625b;
}

.playhead {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 28px;
  background: #111827;
}

.keyframe-row {
  height: 38px;
}

.keyframe {
  position: absolute;
  top: 10px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 20%);
}

.keyframe.selected {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgb(8 127 120 / 18%);
}

.keyframe.issue-key {
  background: var(--coral);
}

.keyframe.issue-key.resolved {
  background: var(--green);
}

.keyframe.issue-key.resolved.selected {
  background: var(--green);
  box-shadow: 0 0 0 4px rgb(45 125 70 / 24%);
}

.keyframe.correction-key {
  top: 22px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--teal);
  border-color: #d7fffb;
}

.keyframe.correction-key.selected {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgb(8 127 120 / 22%);
}

.keyframe.track-key {
  top: 13px;
  z-index: 3;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border: 3px solid #ffffff;
  border-radius: 4px;
  background: #14b8a6;
  box-shadow:
    0 0 0 2px #075e57,
    0 0 0 7px rgb(20 184 166 / 18%),
    0 4px 10px rgb(15 23 42 / 24%);
  transform: rotate(45deg);
}

.keyframe.track-key::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 2px;
  background: #ecfeff;
}

.keyframe.track-key.selected,
.keyframe.track-key:hover,
.keyframe.track-key:focus-visible {
  background: #2dd4bf;
  box-shadow:
    0 0 0 2px #042f2e,
    0 0 0 9px rgb(20 184 166 / 28%),
    0 4px 12px rgb(15 23 42 / 34%);
}

.keyframe.generated-key {
  top: 26px;
  width: 7px;
  height: 7px;
  margin-left: -4px;
  background: #f59e0b;
  border-color: #ffedd5;
  opacity: 0.82;
}

body.dark-theme .keyframe.track-key {
  border-color: #f8fafc;
  background: #2dd4bf;
  box-shadow:
    0 0 0 2px #5eead4,
    0 0 0 7px rgb(45 212 191 / 22%),
    0 4px 12px rgb(0 0 0 / 42%);
}

body.dark-theme .keyframe.track-key::after {
  background: #042f2e;
}

.hand-toggle {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 10px;
}

.hand-toggle button {
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 800;
}

.track-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.track-card-head,
.track-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.track-card-head span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.track-card-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

body.dark-theme .compact-select {
  background: #101620;
}

.status-field {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.status-select {
  margin-top: 0;
  min-height: 34px;
  font-weight: 800;
}

.occlusion-confidence-field[hidden] {
  display: none;
}

.point-status-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.point-status-actions span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.point-status-actions .button.active {
  background: rgb(124 58 237 / 16%);
  border-color: #8b5cf6;
  color: #5b21b6;
}

body.dark-theme .point-status-actions .button.active {
  background: rgb(88 28 135 / 72%);
  border-color: #a78bfa;
  color: #f5f3ff;
}

.state-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 8px;
}

.state {
  min-height: 32px;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 700;
}

.state.wide {
  grid-column: span 2;
}

.state.danger {
  border-color: #efb0ac;
}

.range-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  margin-top: 10px;
}

.range-control label {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.range-control output {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.range-control input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--teal);
}

.qa-list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  font-size: 13px;
}

.qa-list div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qa-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.qa-dot.pass {
  background: var(--green);
}

.qa-dot.warn {
  background: var(--amber);
}

.qa-dot.fail {
  background: var(--coral);
}

.hand-guide-section {
  padding-bottom: 10px;
  --hand-guide-height: min(54vh, 460px);
}

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

.info-icon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.info-icon:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.hand-guide-wrap {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  height: var(--hand-guide-height);
  min-height: 280px;
  max-height: min(1100px, calc(100vh - 122px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.hand-guide-resize-handle {
  display: grid;
  width: 100%;
  height: 16px;
  margin-top: 4px;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: ns-resize;
  touch-action: none;
}

.hand-guide-resize-handle::before {
  content: "";
  width: 46px;
  height: 5px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  opacity: 0.85;
}

.hand-guide-resize-handle:focus-visible::before,
.hand-guide-resize-handle:hover::before {
  border-color: var(--teal);
}

body.resizing-hand-guide {
  cursor: ns-resize;
  user-select: none;
}

.hand-guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.hand-guide-card {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.hand-guide-card.active-guide {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 2px rgb(8 127 120 / 18%);
}

.hand-guide-title {
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

body.dark-theme .hand-guide-title {
  color: #d7dee8;
}

.hand-guide {
  display: block;
  width: 100%;
  max-height: none;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.guide-bone {
  fill: none;
  stroke: #8793a1;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-bone.thumb {
  stroke: #c57a1b;
}

.guide-bone.index {
  stroke: #3172c4;
}

.guide-bone.middle {
  stroke: #23844f;
}

.guide-bone.ring {
  stroke: #8d55bd;
}

.guide-bone.pinky {
  stroke: #b79513;
}

.guide-hit {
  cursor: pointer;
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

.guide-point {
  cursor: pointer;
}

.guide-dot {
  cursor: pointer;
  fill: #ffffff;
  stroke: #334155;
  stroke-width: 2;
}

.guide-dot.selected {
  fill: var(--coral);
  stroke: #111827;
  stroke-width: 4;
}

.guide-dot.same-finger {
  fill: #dff4f1;
  stroke: var(--teal);
}

.guide-dot.modified {
  fill: #36d46b;
  stroke: #075f2b;
  stroke-width: 3;
}

.guide-dot.not-visible {
  fill: #e5e7eb;
  stroke: #8a1f18;
  stroke-width: 3;
}

.guide-dot.occluded {
  fill: #a78bfa;
  stroke: #581c87;
  stroke-width: 3;
}

.guide-dot.modified.selected {
  fill: #36d46b;
  stroke: #f8fafc;
  stroke-width: 4;
}

.hand-guide-card:not(.active-guide) .guide-dot.modified.selected {
  fill: #36d46b;
  stroke: #075f2b;
}

.guide-skip-x {
  display: none;
  fill: #8a1f18;
  font-size: 13px;
  font-weight: 900;
  pointer-events: none;
  text-anchor: middle;
}

.guide-skip-x.visible {
  display: block;
}

.guide-dot.not-visible + .guide-skip-x.visible + .guide-id {
  display: none;
}

.guide-label {
  fill: #1f2937;
  stroke: #f8fafc;
  stroke-width: 4px;
  paint-order: stroke fill;
  font-size: 13px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.guide-id {
  fill: #1f2937;
  stroke: #ffffff;
  stroke-width: 3px;
  paint-order: stroke fill;
  font-size: 11px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.guide-readout {
  min-height: 30px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

@media (max-width: 1280px) {
  .hand-guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1200px) {
  .app-shell.queue-collapsed .inspector-panel {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(300px, 1fr);
    grid-auto-rows: max-content;
    align-content: start;
    overflow-y: auto;
  }

  .app-shell.queue-collapsed .inspector-panel > .panel-header {
    position: sticky;
    top: 0;
    z-index: 4;
    grid-column: 1 / -1;
    background: var(--panel);
  }

  .app-shell.queue-collapsed .inspector-panel > .panel-section {
    min-width: 0;
  }

  .app-shell.queue-collapsed .active-hand-section {
    grid-column: 1;
    grid-row: 2;
  }

  .app-shell.queue-collapsed .overlay-section {
    grid-column: 1;
    grid-row: 3;
  }

  .app-shell.queue-collapsed .landmarks-section {
    grid-column: 1;
    grid-row: 4;
  }

  .app-shell.queue-collapsed .hand-guide-section {
    grid-column: 2;
    grid-row: 2 / span 3;
    border-left: 1px solid var(--line);
  }

  .app-shell.queue-collapsed .hand-guide-wrap {
    max-height: calc(100vh - 170px);
    padding-right: 6px;
  }

  .app-shell.queue-collapsed .hand-guide-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .app-shell.queue-collapsed .hand-guide-card.active-guide {
    order: -1;
  }

  .app-shell.queue-collapsed .hand-guide {
    min-height: 280px;
  }
}

@media (min-width: 1600px) {
  .inspector-layout-toggle {
    display: inline-flex;
  }

  .app-shell.inspector-wide .workspace {
    grid-template-columns: minmax(230px, 300px) minmax(540px, 1fr) clamp(640px, 32vw, 840px);
  }

  .app-shell.queue-collapsed.inspector-wide .workspace {
    grid-template-columns: 56px minmax(480px, 0.85fr) minmax(720px, 1.15fr);
  }

  .app-shell.inspector-wide .inspector-panel {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(300px, 1fr);
    grid-auto-rows: max-content;
    align-content: start;
    overflow-y: auto;
  }

  .app-shell.inspector-wide .inspector-panel > .panel-header {
    position: sticky;
    top: 0;
    z-index: 4;
    grid-column: 1 / -1;
    background: var(--panel);
  }

  .app-shell.inspector-wide .inspector-panel > .panel-section {
    min-width: 0;
  }

  .app-shell.inspector-wide .active-hand-section {
    grid-column: 1;
    grid-row: 2;
  }

  .app-shell.inspector-wide .overlay-section {
    grid-column: 1;
    grid-row: 3;
  }

  .app-shell.inspector-wide .landmarks-section {
    grid-column: 1;
    grid-row: 4;
  }

  .app-shell.inspector-wide .hand-guide-section {
    grid-column: 2;
    grid-row: 2 / span 3;
    border-left: 1px solid var(--line);
  }

  .app-shell.inspector-wide .hand-guide-wrap {
    max-height: calc(100vh - 170px);
    padding-right: 6px;
  }

  .app-shell.inspector-wide .hand-guide-card.active-guide {
    order: -1;
  }

  .app-shell.inspector-wide .hand-guide {
    min-height: 280px;
  }
}

.point-table-wrap {
  min-height: 0;
  margin-top: 10px;
  overflow: auto;
}

.point-table {
  width: 100%;
  margin-top: 0;
  border-collapse: collapse;
  font-size: 12px;
}

.point-table th,
.point-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.point-table th {
  color: var(--muted);
  font-weight: 800;
}

.point-table tr.active-row {
  background: var(--teal-soft);
}

.point-table tr.modified-row {
  background: rgb(45 125 70 / 13%);
  box-shadow: inset 3px 0 0 var(--green);
}

.point-table tr.modified-row.active-row {
  background: linear-gradient(90deg, rgb(45 125 70 / 22%), var(--teal-soft));
}

.point-table tr.modified-row td:first-child {
  color: var(--green);
  font-weight: 900;
}

.point-table tr.outside-row {
  background: rgb(245 158 11 / 12%);
  box-shadow: inset 3px 0 0 var(--amber);
}

.point-table tr.outside-row.active-row {
  background: linear-gradient(90deg, rgb(245 158 11 / 18%), var(--teal-soft));
}

.point-table tr.occluded-row {
  background: rgb(124 58 237 / 12%);
  box-shadow: inset 3px 0 0 #8b5cf6;
}

.point-table tr.occluded-row.active-row {
  background: linear-gradient(90deg, rgb(124 58 237 / 18%), var(--teal-soft));
}

.point-table tr.interpolated-note-row {
  background: rgb(239 68 68 / 12%);
  color: #991b1b;
  font-weight: 900;
}

.point-table tr.interpolated-note-row td {
  border-bottom-color: rgb(239 68 68 / 25%);
}

.review-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  vertical-align: middle;
}

.review-badge.interpolation {
  background: rgb(239 68 68 / 16%);
  color: #991b1b;
  border: 1px solid rgb(239 68 68 / 32%);
}

.review-badge.occlusion {
  background: rgb(124 58 237 / 18%);
  color: #6d28d9;
  border: 1px solid rgb(124 58 237 / 38%);
}

body.dark-theme .review-badge.occlusion {
  background: rgb(88 28 135 / 82%);
  color: #ede9fe;
  border-color: rgb(167 139 250 / 56%);
}

.point-state {
  display: inline-flex;
  margin-left: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf4ff;
  color: #2455a6;
  font-weight: 800;
}

.point-state.outside {
  background: rgb(245 158 11 / 18%);
  color: #7a4c00;
}

.point-state.occluded {
  background: rgb(124 58 237 / 18%);
  color: #5b21b6;
}

body.dark-theme .point-table tr.outside-row {
  background: rgb(245 158 11 / 16%);
}

body.dark-theme .point-table tr.occluded-row {
  background: rgb(124 58 237 / 18%);
}

body.dark-theme .point-table tr.interpolated-note-row {
  background: rgb(239 68 68 / 18%);
  color: #fecaca;
}

body.dark-theme .review-badge.interpolation {
  background: rgb(239 68 68 / 20%);
  color: #fecaca;
  border-color: rgb(239 68 68 / 42%);
}

body.dark-theme .point-state.outside {
  background: rgb(245 158 11 / 22%);
  color: #ffd27a;
}

body.dark-theme .point-state.occluded {
  background: rgb(88 28 135 / 72%);
  color: #f5f3ff;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  gap: 7px 10px;
  font-size: 12px;
}

.shortcut-grid-modal {
  margin-top: 0;
}

.shortcut-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-alt);
  color: #344054;
  font-weight: 800;
  text-align: center;
}

.shortcut-grid strong {
  align-self: center;
  color: var(--ink);
  font-weight: 650;
}

.toast-stack {
  position: fixed;
  z-index: 10;
  right: 16px;
  top: 72px;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 13px;
}

.toast.success {
  border-color: #9bc7ad;
  background: #ecf7ef;
  color: #245d36;
}

.toast.error {
  border-color: #eba39e;
  background: var(--coral-soft);
  color: #8b2823;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .run-status,
  .top-actions {
    justify-content: flex-start;
  }

  .settings-wrap,
  .settings-button {
    width: 100%;
  }

  .settings-menu {
    left: 0;
    right: auto;
  }

  .workspace {
    grid-template-columns: 280px minmax(420px, 1fr);
  }

  .app-shell.queue-collapsed .workspace {
    grid-template-columns: 56px minmax(420px, 1fr);
  }

  .inspector-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .app-shell {
    height: auto;
    overflow: auto;
  }

  .workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .viewer-toolbar,
  .timeline-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-stage video,
  .video-stage canvas {
    width: 100%;
  }

  .top-actions {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}
