:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #1f2933;
  background: #eef2f6;
  line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; }
.site-header {
  background: #172b3a;
  color: white;
  min-height: 86px;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { font-size: 1.45rem; font-weight: 700; }
.subtitle { opacity: .8; margin-top: 3px; }
.account-area { display: flex; align-items: center; gap: 18px; }
.account-area form { margin: 0; }
.main-nav { background: white; padding: 0 32px; border-bottom: 1px solid #d8e0e8; }
.main-nav a { display: inline-block; padding: 14px 16px; color: #21384a; text-decoration: none; font-weight: 700; }
.main-nav a:hover { background: #edf4f8; }
.page-shell { max-width: 1180px; margin: 0 auto; padding: 34px 28px 60px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1, h2 { color: #183246; margin-top: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px; }
.card, .login-card { background: white; border: 1px solid #d9e1e8; border-radius: 10px; padding: 26px; box-shadow: 0 2px 8px rgba(23, 43, 58, .06); }
.login-card { max-width: 460px; margin: 65px auto; }
.form-stack { display: grid; gap: 18px; }
label { display: grid; gap: 7px; font-weight: 700; }
input { width: 100%; padding: 11px 12px; border: 1px solid #aebbc6; border-radius: 6px; font: inherit; }
input:focus { outline: 3px solid rgba(33, 112, 155, .18); border-color: #21709b; }
.button { display: inline-block; border: 0; border-radius: 6px; background: #176b93; color: white; padding: 10px 16px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: #115777; }
.button-secondary { background: #e7edf2; color: #243746; }
.button-secondary:hover { background: #d7e1e9; }
.button-row { display: flex; gap: 12px; align-items: center; }
.alert { padding: 12px 14px; border-radius: 6px; margin: 16px 0; }
.alert-error { background: #fde8e8; border: 1px solid #e4a4a4; color: #7c2323; }
.help-text { margin: -8px 0 0; color: #5d6c78; font-size: .92rem; }
.status-pill { display: inline-block; background: #e3f2e8; color: #23633a; border-radius: 999px; padding: 5px 10px; font-size: .88rem; font-weight: 700; }
.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid #e1e7ec; vertical-align: middle; }
th { color: #415563; font-size: .9rem; }
@media (max-width: 700px) {
  .site-header, .page-heading { align-items: flex-start; flex-direction: column; }
  .account-area { width: 100%; justify-content: space-between; }
  .page-shell { padding: 24px 16px 45px; }
  .main-nav { padding: 0 8px; }
}
select, input[type="file"] { width: 100%; padding: 11px 12px; border: 1px solid #aebbc6; border-radius: 6px; background: white; font: inherit; }
select:focus, input[type="file"]:focus { outline: 3px solid rgba(33, 112, 155, .18); border-color: #21709b; }
a { color: #176b93; }
.form-card { max-width: 760px; }
.empty-state { text-align: center; padding: 30px 18px; }
.status-large { padding: 8px 14px; }
.metadata-list { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr; gap: 10px 18px; margin: 0 0 22px; }
.metadata-list dt { font-weight: 700; color: #526675; }
.metadata-list dd { margin: 0; overflow-wrap: anywhere; }
.inline-form { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid #e1e7ec; }
.version-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid #e1e7ec; }
.version-row:last-child { border-bottom: 0; }
.fingerprint { margin-top: 5px; color: #667784; font-family: Consolas, monospace; font-size: .78rem; overflow-wrap: anywhere; }
.section-gap { margin-top: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.timeline { display: grid; gap: 0; }
.timeline-row { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid #e1e7ec; }
.timeline-row:last-child { border-bottom: 0; }
.timeline-time { color: #61727e; }
@media (max-width: 700px) {
  .metadata-list, .timeline-row { grid-template-columns: 1fr; gap: 4px; }
  .version-row { align-items: flex-start; flex-direction: column; }
}

.section-heading-row,
.processing-run-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.processing-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.processing-run {
  border: 1px solid #d9dee7;
  border-radius: 0.6rem;
  padding: 1rem;
}

.progress-track {
  display: block;
  height: 0.8rem;
  margin: 0.9rem 0 0.4rem;
  width: 100%;
}

.processing-summary {
  margin-top: 0.9rem;
}

.section-gap-small {
  margin-top: 0.75rem;
}

.validation-pass {
  display: inline-block;
  margin: 16px 0 12px;
  padding: 7px 11px;
  border-radius: 8px;
  background: #e3f2e8;
  color: #23633a;
  font-weight: 700;
}
.table-scroll { overflow-x: auto; margin-top: 16px; }
.chapter-map-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.chapter-map-table th,
.chapter-map-table td { padding: 9px 10px; border-bottom: 1px solid #dfe7ec; text-align: left; vertical-align: top; }
.chapter-map-table th { color: #526675; font-weight: 700; background: #f7f9fa; }
.chapter-map-table td:nth-child(n+2),
.chapter-map-table th:nth-child(n+2) { white-space: nowrap; }
