.workflow-heading .record-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}
.status-draft { color: #526176; background: #eef2f7; border-color: #d8e0ea; }
.status-submitted { color: #174ea6; background: #eaf2ff; border-color: #bdd2ff; }
.status-rejected { color: #9b241c; background: #fff0ee; border-color: #f0c3bd; }
.status-approved { color: #08634f; background: #e5f8f1; border-color: #b4e3d4; }
.status-reopened { color: #865c0c; background: #fff7df; border-color: #ead394; }
.status-archived { color: #4f456f; background: #f0ecfa; border-color: #d6ccef; }

.letter-preview { position: relative; overflow: hidden; }
.preview-unapproved { outline: 1px solid #dde5ef; }
.document-watermark {
  position: absolute;
  z-index: 2;
  top: 47%;
  left: 50%;
  width: 90%;
  transform: translate(-50%, -50%) rotate(-27deg);
  color: rgba(180, 35, 24, .10);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: clamp(2.4rem, 7vw, 6rem);
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  pointer-events: none;
  user-select: none;
}
.document-watermark.subdued { color: rgba(40, 100, 240, .09); }
.document-watermark.warning { color: rgba(166, 106, 18, .10); }
.signature-block { width: 48%; display: grid; justify-items: center; gap: 9px; }
.signature-space .signature-block strong { width: 100%; }
.signature-confirmation { max-width: 260px; color: #247660; font: 600 .72rem/1.35 Inter, "Segoe UI", Arial, sans-serif; }

.summary-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.workflow-card, .official-downloads { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.workflow-card h3, .official-downloads h3 { margin: 0 0 12px; color: var(--navy); }
.workflow-note, .download-lock {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid #d5dfeb;
  border-radius: 12px;
  color: #40516a;
  background: #f5f8fc;
  font-size: .84rem;
  line-height: 1.45;
}
.workflow-note.info { color: #244d86; background: #eef5ff; border-color: #c8daf4; }
.workflow-note.danger { color: #8b2b23; background: #fff1ef; border-color: #efc6c0; }
.workflow-note.warning { color: #76520d; background: #fff8e6; border-color: #ead7a6; }
.workflow-note.success { color: #08604c; background: #eaf8f3; border-color: #bce1d5; }
.workflow-note.archived { color: #4f456f; background: #f4f1fb; border-color: #d8cff0; }
.workflow-action-form { display: grid; gap: 11px; margin-top: 12px; }
.action-form-danger, .reopen-form, .archive-form { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.workflow-action-form label { font-size: .84rem; }
.workflow-action-form textarea { min-height: 92px; font-size: .88rem; }
.button.success { color: white; background: #16856d; box-shadow: 0 9px 24px rgba(22, 133, 109, .2); }
.button.danger { color: white; background: var(--danger); box-shadow: 0 9px 24px rgba(180, 35, 24, .18); }
.button.archive { color: white; background: #5b4a86; box-shadow: 0 9px 24px rgba(91, 74, 134, .18); }
.download-lock { margin-top: 22px; color: #5e6673; background: #f4f6f8; }
.official-downloads { display: grid; gap: 10px; }
.official-downloads .export-button { min-height: 86px; }
.official-output { background: #fffafa; }
.uncontrolled-output { background: #f5f8ff; }
.print-action { min-height: 44px; }
.legacy-export-grid { margin-bottom: 12px; }

.approval-history-panel { margin-top: 24px; }
.approval-history { display: grid; }
.approval-entry {
  display: grid;
  grid-template-columns: 110px minmax(160px, .8fr) minmax(170px, .7fr) minmax(240px, 1.5fr);
  gap: 18px;
  align-items: start;
  padding: 20px 25px;
  border-bottom: 1px solid var(--line);
}
.approval-entry:last-child { border-bottom: 0; }
.approval-entry > div { min-width: 0; }
.approval-entry strong, .approval-entry small, .approval-entry span { display: block; }
.approval-entry small, .approval-entry span { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.approval-version { color: var(--green); font-weight: 700; }
.integrity-hash code { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: .72rem; line-height: 1.45; }
.current-approval-entry { background: #f4fbf8; box-shadow: inset 4px 0 0 #16856d; }
.current-version-label { margin-top: 6px !important; color: #08604c !important; font-weight: 700; }

.oversight-panel, .setup-health-panel, .section-oversight-panel, .workflow-activity-panel, .workflow-timeline-panel { margin-top: 24px; }
.lifecycle-grid, .health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  padding: 0 24px 24px;
}
.lifecycle-grid article, .health-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbfd;
}
.lifecycle-grid article span, .health-grid article span,
.lifecycle-grid article small, .health-grid article small { display: block; color: var(--muted); }
.lifecycle-grid article span, .health-grid article span { margin-bottom: 8px; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.lifecycle-grid article strong { display: block; color: var(--navy); font-size: 1.65rem; }
.health-grid article strong { display: block; color: var(--navy); font-size: .96rem; line-height: 1.4; }
.health-grid article small { margin-top: 7px; font-size: .76rem; line-height: 1.4; }

.advanced-record-search { display: grid; gap: 18px; }
.primary-search-row { display: grid; grid-template-columns: minmax(190px, .55fr) minmax(300px, 1.45fr); gap: 16px; align-items: end; }
.advanced-filter-block { padding-top: 16px; border-top: 1px solid var(--line); }
.filter-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.filter-heading small { color: var(--muted); }
.advanced-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px; }
.advanced-filter-grid label { min-width: 0; }
.archived-table-label { display: block; margin-top: 5px; color: #5b4a86; font-size: .7rem; font-weight: 700; }

.workflow-timeline { position: relative; display: grid; padding: 0 26px 26px; }
.timeline-entry { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 0 0 18px; }
.timeline-entry:last-child { padding-bottom: 0; }
.timeline-entry::before { content: ""; position: absolute; left: 6px; top: 15px; bottom: -3px; width: 2px; background: #dfe6ef; }
.timeline-entry:last-child::before { display: none; }
.timeline-marker { position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 4px; border: 3px solid white; border-radius: 50%; background: #3971cf; box-shadow: 0 0 0 1px #b9c9df; }
.timeline-content { min-width: 0; padding: 0 0 1px; }
.timeline-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.timeline-heading strong { color: var(--navy); }
.timeline-heading span, .timeline-content small { color: var(--muted); font-size: .76rem; }
.timeline-content p { margin: 7px 0 0; padding: 9px 11px; border-radius: 9px; background: #f5f7fa; color: #46566c; font-size: .8rem; line-height: 1.45; white-space: pre-wrap; }

.public-verification-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
  background: radial-gradient(circle at 15% 15%, rgba(40,100,240,.13), transparent 34%), var(--page);
}
.verification-card {
  width: min(760px, 100%);
  padding: clamp(26px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: var(--shadow);
}
.verification-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 18px;
  color: white;
  background: var(--green);
  font-size: 1.6rem;
  font-weight: 800;
}
.verification-card h1 { margin: 7px 0 12px; color: var(--navy); font-size: clamp(2rem, 5vw, 3.2rem); }
.verification-intro { margin: 0 0 24px; color: var(--muted); line-height: 1.6; }
.verification-status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 15px 17px;
  border: 1px solid #d8e0ea;
  border-radius: 14px;
  background: #f5f8fc;
}
.verification-status strong, .verification-status span { display: block; }
.verification-status.verified { color: #08604c; background: #eaf8f3; border-color: #bce1d5; }
.verification-status.not-verified { color: #5d6571; }
.verification-details { display: grid; grid-template-columns: 170px 1fr; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.verification-details dt, .verification-details dd { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.verification-details dt { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.verification-details dd { overflow-wrap: anywhere; font-weight: 600; }
.verification-note { display: grid; gap: 4px; margin-top: 22px; padding: 15px 17px; border-radius: 13px; line-height: 1.45; }
.verification-note.success { color: #08604c; background: #eaf8f3; }
.verification-note.danger { color: #8b2b23; background: #fff1ef; }
.verification-note.neutral { color: #4d5c70; background: #f3f6fa; }

@media (max-width: 1180px) {
  .approval-entry { grid-template-columns: 110px 1fr 1fr; }
  .integrity-hash { grid-column: 1 / -1; }
  .advanced-filter-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 760px) {
  .primary-search-row, .advanced-filter-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .record-meta-line, .summary-title-row { align-items: flex-start; }
  .summary-title-row { display: grid; }
  .document-watermark { font-size: 2.15rem; }
  .signature-block { width: 52%; }
  .approval-entry { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
  .integrity-hash { grid-column: auto; }
  .lifecycle-grid, .health-grid { grid-template-columns: 1fr; padding: 0 18px 18px; }
  .workflow-timeline { padding: 0 18px 20px; }
  .timeline-heading { display: grid; }
  .verification-status { display: grid; }
  .verification-details { grid-template-columns: 1fr; }
  .verification-details dt { padding-bottom: 4px; border-bottom: 0; }
  .verification-details dd { padding-top: 0; }
}
