:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #1c2430;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: #0f6b5f;
  color: white;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c7ced8;
  border-radius: 6px;
  background: white;
  color: #1c2430;
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
}

main {
  width: min(1280px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  background: #ffffff;
  border-bottom: 1px solid #dbe0e7;
}

.topbar h1,
.topbar p,
.panel h3,
.review-toolbar h2,
.section-panel h3 {
  margin: 0;
}

.topbar p {
  color: #5d6978;
  margin-top: 4px;
}

.key-field {
  display: grid;
  gap: 6px;
  min-width: min(340px, 42vw);
}

.panel,
.section-panel {
  background: #ffffff;
  border: 1px solid #dbe0e7;
  border-radius: 8px;
  padding: 18px;
}

.upload-panel form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.upload-actions,
.source-header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.upload-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.file-picker,
.stacked {
  display: grid;
  gap: 6px;
}

.progress-shell {
  width: 100%;
  height: 10px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe5ec;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0f6b5f, #3178c6);
  transition: width 180ms ease;
}

.job-panel {
  margin-top: 18px;
}

.job-header,
.review-toolbar,
.section-panel header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.job-header h2,
.job-header p {
  margin: 0;
}

.job-header p {
  color: #3e4b5b;
  margin-top: 4px;
}

.job-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: #5d6978;
  font-size: 0.92rem;
}

.review-toolbar {
  margin: 26px 0 14px;
}

.source-panel {
  margin-top: 24px;
}

.source-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.source-header h2 {
  margin: 0;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.field-grid label {
  display: grid;
  gap: 6px;
}

.sections {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.section-panel header {
  align-items: start;
}

.section-panel h3 {
  font-size: 1rem;
}

.confidence {
  width: 150px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 14px 0;
}

.status-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.status-row input {
  width: 18px;
  min-height: 18px;
}

.evidence {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.evidence-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe0e7;
  border-radius: 8px;
  background: #f8fafb;
}

.evidence-item p {
  margin: 0;
}

.evidence-meta {
  color: #5d6978;
  font-size: 0.9rem;
}

.clip-link,
.source-header a {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: #e8f3f1;
  color: #0f5c52;
  font-weight: 600;
  text-decoration: none;
}

video {
  width: 100%;
  max-height: 360px;
  background: black;
  border-radius: 6px;
}

.hidden {
  display: none !important;
}

.error {
  color: #a12f2f;
  font-weight: 600;
}

@media (max-width: 720px) {
  .topbar,
  .job-header,
  .review-toolbar,
  .section-panel header,
  .upload-panel form {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .upload-actions,
  .source-header {
    align-items: stretch;
    flex-direction: column;
  }

  .key-field,
  .confidence {
    min-width: 0;
    width: 100%;
  }

  .job-meta {
    align-items: flex-start;
  }

  .toolbar-actions {
    justify-content: stretch;
  }

  .toolbar-actions button {
    flex: 1 1 150px;
  }
}
