:root {
  --bg: #070b10;
  --bg2: #101923;
  --gold: #d6a93c;
  --gold2: #f4d06f;
  --steel: #7fa8bd;
  --text: #eef5f7;
  --muted: #9fb0ba;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 15%, rgba(214,169,60,.20), transparent 28rem),
    radial-gradient(circle at 80% 20%, rgba(127,168,189,.18), transparent 24rem),
    linear-gradient(145deg, var(--bg), #030507 72%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}
.shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
}
.hero {
  position: relative;
  width: min(1120px, 100%);
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid rgba(214,169,60,.35);
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(10,18,26,.82), rgba(7,11,16,.66));
  box-shadow: 0 28px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
}
.logo {
  position: relative;
  display: block;
  width: min(430px, 82vw);
  height: auto;
  margin: 0 auto 22px;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.52));
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.glow { position: absolute; border-radius: 999px; filter: blur(20px); opacity: .65; }
.glow-a { width: 280px; height: 280px; right: -90px; top: -90px; background: rgba(214,169,60,.22); }
.glow-b { width: 240px; height: 240px; left: -80px; bottom: -80px; background: rgba(127,168,189,.16); }
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold2);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.insta-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(244,208,111,.55);
}
.insta-link:hover {
  color: #fff3bf;
  border-bottom-color: #fff3bf;
}
.tagline {
  margin: 18px 0 0;
  font-size: clamp(28px, 4.8vw, 58px);
  font-weight: 900;
  letter-spacing: -.055em;
  text-align: center;
}
.copy {
  max-width: 820px;
  margin: 18px auto 34px;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.45;
  text-align: center;
}
.upload-card, .panel {
  margin-left: auto;
  margin-right: auto;
}
.upload-card { width: min(860px, 100%); }
.panel { width: min(680px, 100%); }
.upload-card, .panel {
  border-radius: 22px;
  background: rgba(0,0,0,.38);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(860px, 100%);
  margin: 22px auto 0;
}
.feature-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: rgba(0,0,0,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}
.feature-grid strong {
  color: var(--gold2);
  font-size: 15px;
  letter-spacing: -.01em;
}
.feature-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.upload-card { padding: 22px; margin-top: 22px; }
.free-badge {
  display: inline-block;
  margin: 0 0 14px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(214,169,60,.13);
  color: var(--gold2);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}
.upload-card h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.2vw, 38px);
  letter-spacing: -.04em;
}
.small-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}
.upload-form { display: grid; gap: 12px; }
.upload-limit-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.dropzone {
  display: grid;
  gap: 6px;
  min-height: 128px;
  place-content: center;
  text-align: center;
  padding: 20px;
  border: 1.5px dashed rgba(244,208,111,.46);
  border-radius: 18px;
  background: rgba(214,169,60,.055);
}
.dropzone input { display: none; }
.drop-title { font-weight: 900; font-size: 21px; color: #fff; }
.drop-meta { color: var(--muted); font-size: 14px; }
button, .download-button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--gold), #ffe08a);
  color: #111;
  font-weight: 950;
  font-size: 16px;
  cursor: pointer;
  opacity: 1;
  text-align: center;
  text-decoration: none;
}
button:disabled {
  cursor: not-allowed;
  opacity: .48;
}
.secondary-button {
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  background: rgba(255,255,255,.10);
  color: var(--text);
  font-size: 13px;
}
.dropzone { cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.dropzone:hover, .dropzone.is-dragging {
  border-color: var(--gold2);
  background: rgba(214,169,60,.105);
  transform: translateY(-1px);
}
.progress-wrap { margin-top: 18px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.progress-label strong { color: var(--gold2); text-transform: uppercase; letter-spacing: .12em; }
.progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--steel));
  transition: width .25s ease;
}
.message {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.4;
}
.message.ok { color: #b9f6d0; }
.message.error { color: #ffb4a8; }
.recent-jobs {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  background: rgba(0,0,0,.24);
}
.recent-jobs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.recent-jobs h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.recent-jobs p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.recent-jobs-list { display: grid; gap: 8px; margin-top: 12px; }
.recent-job-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
}
.recent-job-item strong, .recent-job-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-job-item span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.recent-jobs-empty, .recent-jobs-status { color: var(--muted); }
.result-card {
  margin-top: 20px;
  display: grid;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.10);
}
.result-card[hidden] { display: none; }
.result-card h3 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.metric-grid span {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(214,169,60,.13);
}
.metric-grid b { font-size: 24px; color: #fff; }
.metric-grid small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.result-splits {
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}
.preview-wrap { position: relative; }
.preview-wrap video { width: 100%; display: block; }
.browser-shot-overlay {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(12, 18, 26, .78);
  color: #fff;
  font-weight: 800;
  letter-spacing: .02em;
  border: 1px solid rgba(214,169,60,.75);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  pointer-events: none;
}
.result-card video {
  width: 100%;
  border-radius: 16px;
  background: #000;
  border: 1px solid rgba(255,255,255,.10);
}
.panel { padding: 18px; }
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.summary span {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(214,169,60,.13);
  color: #fff;
  font-weight: 800;
}
.splits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.splits li { display: grid; grid-template-columns: 56px 92px 1fr; gap: 12px; align-items: center; color: #eaf1f4; }
.splits b { color: var(--gold2); }
.splits span { font-weight: 900; }
.splits em { color: var(--muted); font-style: normal; }
.status {
  display: inline-block;
  margin: 34px 0 0;
  padding: 11px 16px;
  border: 1px solid rgba(214,169,60,.45);
  border-radius: 999px;
  color: var(--gold2);
  font-weight: 900;
  letter-spacing: .18em;
  background: rgba(214,169,60,.08);
}
.legal-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}
.legal-links a, .legal-back {
  color: var(--gold2);
  text-decoration: none;
  border-bottom: 1px solid rgba(244,208,111,.45);
}
.legal-links a:hover, .legal-back:hover { color: #fff3bf; border-bottom-color: #fff3bf; }
.legal-shell { place-items: start center; }
.legal-page {
  max-width: 900px;
  line-height: 1.6;
}
.legal-page h1 {
  margin: 24px 0 22px;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -.05em;
}
.legal-page h2 {
  margin: 28px 0 8px;
  color: var(--gold2);
  font-size: 20px;
}
.legal-page p, .legal-page li { color: var(--muted); }
.legal-page strong { color: var(--text); }
.legal-page ul { padding-left: 22px; }
.mail-obfuscated {
  color: var(--text);
  font-weight: 800;
}
@media (max-width: 760px) {
  .feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .splits li { grid-template-columns: 48px 86px 1fr; gap: 8px; font-size: 14px; }
  .eyebrow { letter-spacing: .14em; }
  .recent-jobs-header, .recent-job-item { grid-template-columns: 1fr; }
  .recent-jobs-header { display: grid; }
}
.viewing-label {
  margin: 0;
  color: var(--gold2);
  font-weight: 800;
}
.download-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.download-button.secondary {
  background: rgba(255,255,255,.10);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
}
.download-button[hidden] { display: none; }
.shot-editor {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.10);
  display: grid;
  gap: 12px;
}
.shot-editor[hidden] { display: none; }
.editor-header h3 { margin: 0 0 6px; }
.editor-header p, .render-status { margin: 0; color: var(--muted); }
.alpha-learning-notice {
  padding: 11px 12px;
  border: 1px solid rgba(244,208,111,.22);
  border-radius: 14px;
  background: rgba(214,169,60,.07);
  color: var(--muted);
  font-size: 13px;
}
.expected-count-field {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.expected-count-field[hidden] { display: none; }
.expected-count-field input {
  width: 150px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(0,0,0,.35);
  font: inherit;
}
.count-comparison {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.editor-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.editor-actions button, .row-actions button {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 11px;
}
.shot-table-hint {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.shot-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  box-shadow: inset -18px 0 18px -20px rgba(244,208,111,.85);
}
.shot-table-wrap:focus-visible {
  outline: 2px solid rgba(244,208,111,.72);
  outline-offset: 3px;
}
.shot-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 14px;
}
.shot-table th, .shot-table td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  vertical-align: middle;
}
.shot-table th {
  color: var(--gold2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.shot-table input {
  width: 118px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
  padding: 8px;
  color: var(--text);
  background: rgba(0,0,0,.35);
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.shot-table th:last-child,
.shot-table td.row-actions {
  width: 150px;
  min-width: 150px;
}
.row-actions {
  white-space: nowrap;
}
.row-actions button + button {
  margin-left: 6px;
}
.review-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(244,208,111,.22);
  border-radius: 14px;
  background: rgba(214,169,60,.07);
  color: var(--muted);
}
.review-panel[hidden] { display: none; }
.review-panel p { margin: 0; }
.review-note { font-size: 13px; }
.review-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.review-candidates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.candidate-button {
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255,255,255,.11);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.14);
}
.flag-chip, .confidence-badge {
  display: inline-block;
  margin: 1px 2px 1px 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}
.confidence-badge.confidence-high { background: rgba(88,214,141,.18); color: #b9f6d0; }
.confidence-badge.confidence-medium { background: rgba(244,208,111,.18); color: #ffe08a; }
.confidence-badge.confidence-low { background: rgba(255,180,168,.18); color: #ffb4a8; }
.shot-table tr.confidence-low { background: rgba(255,180,168,.055); }
.shot-table tr.confidence-medium { background: rgba(244,208,111,.045); }
.muted, .empty-row { color: var(--muted); }
.editor-validation {
  display: grid;
  gap: 5px;
  color: var(--muted);
}
.editor-validation p { margin: 0; }
.editor-validation .ok { color: #b9f6d0; }
.editor-validation .warn { color: #ffe08a; }
.editor-validation .error { color: #ffb4a8; }
@media (min-width: 720px) {
  .download-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .editor-actions { grid-template-columns: 1fr; }
  .shot-table-hint { display: block; }
}

.detector-comparison-panel, .detection-settings, .waveform-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
}
.detector-comparison-panel h4, .detection-settings h4, .waveform-panel h4 { margin: 0; letter-spacing: -.02em; }
.detector-comparison-panel p, .detection-settings p, .waveform-panel p { margin: 0; color: var(--muted); line-height: 1.4; }
.detection-settings label {
  display: grid;
  grid-template-columns: 120px 1fr 56px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}
.detection-settings input[type="range"] { width: 100%; accent-color: var(--gold2); }
.detection-settings output { color: var(--gold2); font-weight: 900; text-align: right; }
.waveform-header { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.waveform-header button { padding: 10px 12px; font-size: 13px; }
.waveform-editor {
  position: relative;
  display: grid;
  grid-template-rows: 32px 160px 38px;
  min-width: 0;
}
.waveform-panel canvas {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.30);
  cursor: crosshair;
  grid-row: 2;
}
.waveform-delete-layer, .waveform-handle-layer {
  position: relative;
  min-width: 0;
  pointer-events: none;
}
.waveform-delete-layer { grid-row: 1; }
.waveform-handle-layer { grid-row: 3; }
.waveform-delete, .waveform-handle {
  position: absolute;
  transform: translateX(-50%);
  pointer-events: auto;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.waveform-delete {
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255,105,86,.95);
  color: #210806;
  font-size: 18px;
  line-height: 1;
}
.waveform-handle {
  top: 5px;
  width: 34px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #ffe08a);
  color: #111;
  cursor: grab;
  touch-action: none;
}
.waveform-handle span { font-size: 11px; font-weight: 950; }
.waveform-handle.is-dragging { cursor: grabbing; outline: 2px solid rgba(255,255,255,.85); }

.detector-comparison-panel[hidden] { display: none; }
.detector-comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detector-option-card { display: grid; gap: 8px; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(0,0,0,.16); }
.detector-option-card.is-selected { border-color: rgba(244,208,111,.55); background: rgba(214,169,60,.09); }
.detector-option-card h5 { margin: 0; font-size: 15px; }
.detector-option-card strong { font-size: 24px; color: var(--gold2); }
.detector-option-card button { padding: 9px 10px; font-size: 12px; border-radius: 10px; }
.detector-delta { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .detector-comparison-grid { grid-template-columns: 1fr; } }
