body {
  color: #1a1a1a;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 2rem auto;
  max-width: 900px;
  padding: 0 1rem;
}

header {
  align-items: center;
  border-bottom: 2px solid #1a3a5c;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: .5rem;
}

h1 {
  color: #1a3a5c;
  font-size: 1.2rem;
  margin: 0;
}

a {
  color: #1a5c8c;
}

.btn {
  background: #1a3a5c;
  border: 0;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-size: .95rem;
  padding: .4rem .8rem;
  text-decoration: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.btn.warn {
  background: #8c3a1a;
}

.btn.ok {
  background: #1a6c3a;
}

.btn-small {
  padding: .2rem .5rem;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #ddd;
  padding: .4rem .6rem;
  text-align: left;
}

.badge {
  border-radius: 3px;
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .1rem .4rem;
}

.badge.unconfirmed {
  background: #f6d97a;
  color: #5c3a00;
}

.badge.hard {
  background: #f3b0a8;
  color: #6c1a0a;
}

.badge.state {
  background: #dce6f0;
  color: #1a3a5c;
}

.badge.approved {
  background: #bfe6c8;
  color: #0a4c1a;
}

.flag {
  background: #fdf6e3;
  border-left: 3px solid #d9a441;
  font-size: .9rem;
  margin: .3rem 0;
  padding: .4rem .6rem;
}

.err {
  background: #fdecea;
  border: 1px solid #f3b0a8;
  border-radius: 4px;
  padding: .6rem;
}

pre {
  background: #f6f8fa;
  border-radius: 4px;
  overflow-x: auto;
  padding: .8rem;
  white-space: pre-wrap;
}

label {
  display: block;
  font-weight: 600;
  margin: .8rem 0 .2rem;
}

input,
select,
textarea {
  box-sizing: border-box;
  font: inherit;
  padding: .35rem;
  width: 100%;
}

.muted {
  color: #626b73;
  font-size: .85rem;
}

.inline-form {
  display: inline;
}

.flush-form {
  margin: 0;
}

.login-form {
  max-width: 340px;
}

[hidden] {
  display: none !important;
}

.dropzone {
  background: #f9fafb;
  border: 2px dashed #1a3a5c;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 1.5rem;
  padding: 2rem;
  text-align: center;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.dropzone:hover,
.dropzone:focus,
.dropzone.is-dragging {
  background: #e8f0f7;
  border-color: #0f6aa6;
  box-shadow: 0 0 0 3px rgba(15, 106, 166, .15);
  outline: none;
}

.dropzone.is-confirmed {
  background: #e8f5e9;
  border-color: #1a6c3a;
}

.dropzone p {
  margin: .25rem 0;
}

.dropzone-help {
  font-size: .9rem;
}

.categorization-panel {
  border: 1px solid #d5dde5;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

.categorization-panel h4 {
  margin-top: 0;
}

.categorized-file {
  align-items: center;
  background: #f0f4f8;
  border-radius: 4px;
  display: grid;
  gap: .75rem;
  grid-template-columns: minmax(0, 1fr) minmax(190px, .7fr);
  margin-bottom: .75rem;
  padding: .8rem;
}

.categorized-file label {
  margin: 0;
  overflow-wrap: anywhere;
}

.categorized-file select {
  margin: 0;
}

.missing-docs-note {
  font-size: .95rem;
  font-weight: 600;
  margin-top: 1rem;
}

.missing-docs-note.complete {
  color: #1a6c3a;
}

.missing-docs-note.incomplete {
  color: #8c3a1a;
}

.intake-phase {
  border-top: 1px solid #d5dde5;
  margin-top: 1.5rem;
  padding-top: .5rem;
}

.change-categorization {
  margin-left: .5rem;
}

.status-message {
  min-height: 1.5rem;
}

@media (max-width: 620px) {
  header {
    align-items: flex-start;
    gap: .75rem;
  }

  .categorized-file {
    grid-template-columns: 1fr;
  }
}

/* Failed-job diagnostic view: the draft/memo that failed QA. Collapsed by
   default and visually marked as not-a-deliverable — a failed job never gets
   built artifacts, so this is the only place the text can be read. */
details.failed-draft { margin: 1rem 0; border: 1px solid #d9534f; border-radius: 4px; padding: .5rem .75rem; }
details.failed-draft > summary { cursor: pointer; font-weight: 600; color: #a33; }
details.failed-draft pre { max-height: 32rem; overflow: auto; white-space: pre-wrap; word-break: break-word; }
