.connection-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.live-state { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; white-space: nowrap; }
.live-state::before, .live-nav-dot { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #aeb7c3; }
.live-state.connected::before { background: #20825d; }
.live-state.connected { color: #20654d; }
.nav[data-view="progress"] { gap: 10px; }
.nav.active .live-nav-dot { background: #1559d9; }
.progress-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 0 26px 22px; color: #687383; font-size: 11px; }
.legend-filter { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: inherit; transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease; }
.legend-filter:hover { background: #f6f8fb; border-color: #e1e6ed; }
.legend-filter:active { transform: translateY(1px); }
.legend-filter small { min-width: 18px; padding: 1px 5px; border-radius: 4px; background: #f0f3f7; color: #687383; font-size: 9px; font-variant-numeric: tabular-nums; text-align: center; }
.legend-filter.active { background: #eef4ff; border-color: #a9c3ef; box-shadow: inset 0 -2px 0 #1559d9; font-weight: 600; }
.legend-filter.waiting.active { background: #fff8ea; border-color: #e5c883; box-shadow: inset 0 -2px 0 #b2761e; }
.legend-filter.failed.active { background: #fff3f4; border-color: #e5b7bd; box-shadow: inset 0 -2px 0 #b33443; }
.legend-dot { font-size: 13px; line-height: 1; }
.progress-legend .done, .progress-legend .running { color: #1044ad; }
.progress-legend .waiting { color: #986111; }
.progress-legend .failed { color: #b33443; }
.process-list { padding: 0 24px 24px; display: grid; gap: 18px; }
.process-row { min-width: 0; border: 1px solid #e0e5ed; border-radius: 12px; background: #fff; overflow: hidden; }
.process-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; padding: 22px 24px 10px; }
.process-heading .eyebrow { font-size: 9px; margin: 0 0 9px; }
.process-heading h3 { margin: 0; display: flex; flex-wrap: wrap; gap: 7px 15px; align-items: baseline; }
.process-heading h3 .link-button { font-size: 19px; font-weight: 700; }
.process-heading h3 > span { font-size: 13px; font-weight: 500; color: #4e5968; }
.process-heading p { margin: 8px 0; font-size: 11px; color: #687383; }
.process-heading p > span { padding: 0 5px; }
.process-summary { display: grid; justify-items: end; gap: 9px; white-space: nowrap; }
.process-summary small { font-size: 10px; color: #687383; }
.process-wait { margin: 4px 24px 0; padding: 10px 13px; border-radius: 5px; background: #fff7e8; color: #805510; font-size: 12px; line-height: 1.6; }
.process-wait > span { display: inline-block; margin-right: 8px; font-weight: 700; }
.process-legacy { margin: 4px 24px 0; font-size: 11px; line-height: 1.6; color: #697382; }
.process-scroll { overflow-x: auto; padding: 10px 18px 6px; scrollbar-width: thin; scrollbar-color: #c9d4e3 transparent; }
.process-scroll:focus-visible { outline: 2px solid #1559d9; outline-offset: -3px; }
.process-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(110px, 1fr); min-width: max-content; list-style: none; padding: 10px 0 18px; margin: 0; }
.process-step { position: relative; text-align: center; min-width: 0; }
.process-step:not(:last-child)::after { content: ""; position: absolute; height: 2px; top: 30px; left: calc(50% + 27px); right: calc(-50% + 27px); background: #e5e9ef; }
.process-step.state-complete:not(:last-child)::after { background: #80a9ee; }
.process-step button { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 8px 5px; border: 0; border-radius: 6px; background: transparent; color: #8d96a3; cursor: pointer; font: inherit; }
.process-step button:hover { background: #f6f8fb; }
.process-step button:focus-visible { outline: 2px solid #1559d9; outline-offset: -2px; }
.step-circle { display: grid; place-items: center; width: 44px; height: 44px; box-sizing: border-box; border: 2px solid #e1e6ed; border-radius: 50%; background: #fff; font-size: 14px; font-weight: 700; position: relative; z-index: 1; }
.step-name { display: block; max-width: 105px; margin: 13px 0 7px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; line-height: 1.5; min-height: 30px; }
.step-status { font-size: 9px; line-height: 1.5; }
.state-complete .step-circle { background: #1559d9; border-color: #1559d9; color: #fff; font-size: 20px; }
.state-complete .step-name { color: #394759; }
.state-running .step-circle { border-color: #1559d9; color: #1559d9; box-shadow: 0 0 0 4px #eaf3ff; }
.state-running .step-name, .state-running .step-status { color: #1044ad; }
.state-waiting .step-circle { border-color: #c89236; color: #986111; background: #fffaf0; }
.state-waiting .step-name, .state-waiting .step-status { color: #986111; }
.state-error .step-circle { border-color: #bf4955; color: #b33443; background: #fff4f5; }
.state-error .step-name, .state-error .step-status { color: #b33443; }
.state-unrecorded .step-circle { border-style: dashed; }
.process-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid #edf0f4; padding: 13px 24px; color: #687383; font-size: 10px; }
.process-foot .link-button { font-size: 11px; }
.step-detail-status { display: inline-block; border: 1px solid #e1e6ed; border-radius: 5px; padding: 7px 12px; font-size: 12px; font-weight: 600; }
.step-detail-status.state-complete, .step-detail-status.state-running { color: #1044ad; background: #f1f7ff; }
.step-detail-status.state-waiting { color: #986111; background: #fffaf0; }
.step-detail-status.state-error { color: #b33443; background: #fff4f5; }
.step-evidence { border-top: 1px solid #e1e6ed; padding-top: 18px; margin-top: 20px; font-size: 13px; line-height: 1.7; }
.step-evidence p { font-size: 12px; color: #687383; }
.step-timestamp { margin-top: 6px; font-size: 10px; line-height: 1.5; color: #687383; font-variant-numeric: tabular-nums; }
#step-dialog { width: min(1100px, calc(100vw - 40px)); max-width: 1100px; }
.step-extras { margin-top: 24px; }
.step-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; margin: 0 0 26px; }
.step-fields dt { font-size: 11px; color: #687383; margin-bottom: 4px; }
.step-fields dd { margin: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.step-table { margin: 18px 0; }
.step-table td { white-space: normal; min-width: 110px; max-width: 320px; vertical-align: top; }
.verification-checks { list-style: none; padding: 0; margin: 16px 0; }
.verification-checks li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e5e9ef; font-size: 13px; }
.verification-checks li > span { flex: 0 0 22px; font-weight: 700; }
.verification-checks .passed > span { color: #20825d; }
.verification-checks .failed > span { color: #b33443; }
.verification-checks .warning > span { color: #986111; }
.verification-checks small { display: block; color: #687383; margin-top: 5px; }
.document-key { margin: 20px 0; }
.document-key code, .document-integrity code { display: block; overflow-wrap: anywhere; font-size: 12px; margin-top: 8px; }
.step-document-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 22px 0 16px; }
.step-document-heading p { font-size: 12px; margin-top: 5px; color: #687383; }
.document-actions { display: flex; gap: 8px; flex-shrink: 0; }
.document-actions a { text-decoration: none; }
.danfe-preview { display: block; width: 100%; height: min(65vh, 760px); min-height: 340px; border: 1px solid #d9e0e9; background: #f5f6f8; border-radius: 5px; }
.document-integrity { margin-top: 20px; font-size: 12px; color: #687383; }
.document-integrity summary { cursor: pointer; }
.document-integrity p { margin-top: 12px; }
@media (max-width: 700px) {
  #step-dialog { width: calc(100vw - 20px); }
  .step-fields { grid-template-columns: 1fr; gap: 14px; }
  .step-document-heading { align-items: flex-start; flex-direction: column; }
  .connection-meta { gap: 8px; }
  .process-list { padding: 0 12px 16px; }
  .process-heading { padding: 18px 15px 8px; gap: 12px; flex-direction: column; }
  .process-summary { justify-items: start; }
  .process-wait, .process-legacy { margin-left: 15px; margin-right: 15px; }
  .process-foot { padding: 13px 15px; }
  .progress-legend { padding-left: 15px; gap: 10px 16px; }
}
