:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --red: #ef4444;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

h1, h2, h3 { margin: 0 0 12px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--navy-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 { font-size: 1.1rem; margin: 0; }

.card {
  background: var(--navy-light);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 12px 0 4px;
}

input, select {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1220;
  color: var(--text);
  font-size: 1rem;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
  margin-top: 16px;
}

.btn-primary {
  background: var(--emerald);
  color: #04120c;
}
.btn-primary:active { background: var(--emerald-dark); }

.btn-secondary {
  background: transparent;
  border: 1px solid #334155;
  color: var(--text);
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-sm {
  width: auto;
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-top: 0;
}

video, canvas.preview {
  width: 100%;
  border-radius: 12px;
  background: #000;
}

.result-ok { color: var(--emerald); font-weight: 600; }
.result-warn { color: #f59e0b; font-weight: 600; }
.result-bad { color: var(--red); font-weight: 600; }

.punch-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #334155;
  font-size: 0.9rem;
}
.punch-row:last-child { border-bottom: none; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--navy-light);
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
  font-size: 0.9rem;
}
.tab.active {
  background: var(--emerald);
  color: #04120c;
}

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 8px 4px; border-bottom: 1px solid #334155; }
th { color: var(--text-dim); font-weight: 500; }

.hidden { display: none !important; }

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #334155;
}
.list-item:last-child { border-bottom: none; }

.muted { color: var(--text-dim); font-size: 0.85rem; }
