* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  color: #20242a;
  background: #f4f6f8;
  font-family: system-ui, sans-serif;
}

main {
  max-width: 1000px;
  margin: 0 auto;
}

h1,
h2 {
  margin-top: 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

#videoFile {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.file-button,
button {
  min-height: 40px;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: #2459a6;
  font: inherit;
  cursor: pointer;
}

.file-button:hover,
button:hover {
  background: #19447f;
}

.coordinate {
  display: grid;
  gap: 4px;
}

.coordinate label {
  font-weight: 600;
}

.coordinate input {
  width: 76px;
  min-height: 40px;
  padding: 7px;
  border: 1px solid #aab2bd;
  border-radius: 5px;
  font: inherit;
}

#status {
  min-height: 1.5em;
  color: #4b5563;
}

.video-stage {
  position: relative;
  width: 100%;
  max-width: 960px;
  overflow: hidden;
  background: #111;
}

#video {
  display: block;
  width: 100%;
  height: auto;
}
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}


#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.results {
  margin-top: 24px;
}

.table-container {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #d1d5db;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

th,
td {
  padding: 7px 10px;
  border-bottom: 1px solid #e5e7eb;
}

th {
  position: sticky;
  top: 0;
  background: #eaf0f8;
}

th:first-child,
th:nth-child(2),
td:first-child,
td:nth-child(2) {
  text-align: right;
}

@media (max-width: 600px) {
  body {
    padding: 16px;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 6px;
  color: #fff;
  background: #20242a;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.frame-readout,
.frame-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.frame-readout {
  padding: 10px 12px;
  background: #eaf0f8;
  border-radius: 6px;
}

.frame-controls button {
  min-height: 36px;
}

