.submission-context {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 22px;
  background: #fbfcfd;
}

.submission-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.submission-heading > div > span {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 700;
}

.submission-heading h3 {
  font-size: 14px;
  margin: 4px 0 0;
}

.submission-status {
  font-size: 10px;
  color: #805c19;
  background: #fff2d9;
  padding: 5px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.submission-context dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
}

.submission-context dl > div {
  padding: 12px 16px;
  border-bottom: 1px solid #edf1f5;
}

.submission-context dl > div:nth-child(odd) {
  border-right: 1px solid #edf1f5;
}

.submission-context dl > div:nth-last-child(-n+2) {
  border-bottom: 0;
}

.submission-context dt {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 5px;
}

.submission-context dd {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}

.engine-results {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.engine-results-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.engine-results-heading h3 {
  margin: 0;
  font-size: 12px;
}

.engine-results-heading span {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.engine-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.engine-results table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.engine-results thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: white;
  color: var(--muted);
  text-align: left;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.engine-results th,
.engine-results td {
  padding: 9px 12px;
  border-bottom: 1px solid #edf1f5;
  vertical-align: top;
}

.engine-results tbody th {
  text-align: left;
  font-weight: 600;
}

.engine-results tbody tr:last-child th,
.engine-results tbody tr:last-child td {
  border-bottom: 0;
}

.engine-detected {
  background: #fff7f8;
}

.engine-verdict {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.engine-verdict.detected { background: #f9dfe3; color: var(--red); }
.engine-verdict.clean { background: #e4f3ed; color: var(--green); }
.engine-verdict.unknown { background: #edf1f5; color: var(--muted); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.history-nav { border: 1px solid #7193aa; color: white; background: transparent; border-radius: 5px; padding: 7px 11px; font-size: 11px; font-weight: 650; }
.history-nav:hover { background: #ffffff12; }
.history-screen { max-width: 960px; }
.history-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.history-heading p:last-child { color: var(--muted); font-size: 12px; margin: 6px 0 0; line-height: 1.5; }
.history-heading-actions { display: flex; gap: 8px; flex-shrink: 0; }
.history-heading-actions .primary { display: inline-block; }
.history-table-wrap { overflow-x: auto; margin-top: 20px; border: 1px solid var(--line); border-radius: 7px; }
.history-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.history-table th, .history-table td { padding: 11px 12px; border-bottom: 1px solid #edf1f5; text-align: left; vertical-align: middle; }
.history-table thead th { background: #f8fafc; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.history-table tbody tr:last-child td { border-bottom: 0; }
.history-table tbody tr:hover { background: #f8fafc; }
.history-document { font-weight: 650; max-width: 240px; overflow-wrap: anywhere; }
.history-time { color: var(--muted); white-space: nowrap; }
.history-badge { display: inline-block; border-radius: 4px; padding: 4px 7px; white-space: nowrap; background: #edf1f5; color: var(--muted); }
.history-badge.approved { background: #e4f3ed; color: var(--green); }
.history-badge.blocked { background: #f9dfe3; color: var(--red); }
.history-badge.review { background: #fff0d6; color: var(--amber); }
.history-open { border: 0; background: none; color: var(--blue); font-weight: 650; padding: 5px; white-space: nowrap; }
.history-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 20px; }
.history-note { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 14px 0 0; }

@media (max-width: 520px) {
  .submission-context dl { grid-template-columns: 1fr; }
  .submission-context dl > div,
  .submission-context dl > div:nth-child(odd),
  .submission-context dl > div:nth-last-child(-n+2) {
    border-right: 0;
    border-bottom: 1px solid #edf1f5;
  }
  .submission-context dl > div:last-child { border-bottom: 0; }
  .submission-heading { align-items: flex-start; }
  .engine-results-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .engine-results-heading span { text-align: left; }
  .history-heading { flex-direction: column; }
  .history-heading-actions { width: 100%; }
  .history-heading-actions button { flex: 1; }
  .history-table th:nth-child(4), .history-table td:nth-child(4) { display: none; }
  .header-actions { gap: 9px; }
}

/* Enterprise dashboard shell */
:root { --navy: #111827; --blue: #4f46e5; --canvas: #f6f7fb; --line: #e5e7eb; --muted: #667085; --green: #087a5b; }
body { color: #182230; background: var(--canvas); }
.app-header { height: 68px; background: #fff; color: #182230; border-bottom: 1px solid #e4e7ec; padding: 0 max(28px, calc((100vw - 1180px)/2)); box-shadow: 0 1px 3px #1018280d; }
.brand { color: #182230; gap: 11px; font-size: 16px; letter-spacing: 0; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { color: #667085; font-size: 9px; font-weight: 550; letter-spacing: .6px; margin-top: 3px; text-transform: uppercase; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; color: white; background: linear-gradient(145deg, #635bff, #4338ca); font-size: 17px; box-shadow: 0 4px 10px #4f46e535; }
.history-nav { border-color: #d0d5dd; color: #344054; background: #fff; padding: 8px 12px; }
.history-nav:hover { background: #f9fafb; border-color: #98a2b3; }
.demo-label { color: #667085; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #eef2ff; color: #4338ca; display: grid; place-items: center; font-size: 10px; font-weight: 750; }
main { max-width: 1180px; padding-top: 34px; }
.intro { text-align: left; max-width: none; margin: 0 0 22px; }
.intro h1 { font-size: 30px; margin-bottom: 8px; letter-spacing: -.7px; }
.intro > p:last-child { max-width: 700px; color: #667085; }
.eyebrow { color: #667085; font-size: 9px; }
.dashboard-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 24px; }
.dashboard-summary > div { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 14px 16px; background: #fff; border: 1px solid #e4e7ec; border-radius: 10px; box-shadow: 0 1px 2px #10182808; }
.dashboard-summary p { margin: 0; }
.dashboard-summary small { display: block; color: #667085; font-size: 10px; margin-bottom: 4px; }
.dashboard-summary strong { display: block; color: #182230; font-size: 13px; }
.summary-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: #eef2ff; color: #4f46e5; font-size: 12px; font-weight: 750; }
.summary-icon.policy-state { background: #ecfdf3; color: #087a5b; }
.journey { max-width: 820px; margin-bottom: 20px; justify-content: flex-start; }
.journey-step.active > span { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px #4f46e514; }
.card { max-width: 920px; border-color: #e4e7ec; border-radius: 11px; box-shadow: 0 2px 8px #1018280a; padding: 30px; margin-left: 0; }
.card-heading { align-items: center; }
.card h2 { color: #182230; }
.policy { background: #f8f9ff; border-color: #e0e3ff; }
.policy-icon { background: #e8e7ff; color: #4338ca; }
.submission-context { background: #fff; border-color: #e4e7ec; }
.submission-heading { background: #f9fafb; }
.dropzone { background: #fafbff; border: 1.5px dashed #b9bdf5; padding: 32px 18px; }
.dropzone:hover { background: #f7f7ff; border-color: #7772e8; }
.upload-icon { background: #eeedff; color: #4f46e5; }
.primary { background: #4f46e5; }
.primary:hover { background: #4338ca; }
.secondary { border-color: #d0d5dd; color: #344054; }
.connection.connected { background: #ecfdf3; color: #087a5b; }
.history-screen { max-width: 100%; margin-right: 0; }
footer { max-width: 1180px; }

@media (max-width: 720px) {
  .app-header { padding: 0 16px; }
  .dashboard-summary { grid-template-columns: 1fr; }
  .dashboard-summary > div { min-height: 62px; }
  .card { margin-right: 0; }
  .user-avatar { display: none; }
}

/* Reduced demo layout: one clear workflow card, minimal surrounding chrome. */
main { max-width: 980px; }
.intro { max-width: 820px; margin-left: auto; margin-right: auto; }
.journey { justify-content: center; }
.card { max-width: 820px; margin-left: auto; margin-right: auto; }
.api-exchange { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.api-exchange h3 { font-size: 13px; margin: 0 0 16px; }
.api-exchange h4 { color: #475467; font-size: 10px; letter-spacing: .5px; margin: 18px 0 8px; text-transform: uppercase; }
.api-exchange code { display: block; padding: 9px 11px; background: #f8fafc; border: 1px solid var(--line); border-radius: 5px; }
.api-exchange pre { margin: 8px 0 0; }
footer { max-width: 980px; }

/* Per-submission pipeline selection and compact top actions. */
.card-heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card-heading-actions .history-nav {
  color: #344054;
  background: #fff;
  border-color: #d0d5dd;
  padding: 7px 11px;
  white-space: nowrap;
}

.check-selector {
  border: 0;
  border-bottom: 1px solid #edf1f5;
  margin: 0 0 23px;
  padding: 8px 0 22px;
}

.check-selector legend {
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
}

.check-selector > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin: 6px 0 13px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.check-grid label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.check-grid label:has(input:checked) {
  border-color: #a8a5ee;
  background: #f7f7ff;
}

.check-grid input {
  accent-color: #4f46e5;
  margin: 2px 0 0;
}

.check-grid strong,
.check-grid small { display: block; }
.check-grid strong { color: #253244; font-size: 12px; }
.check-grid small { color: var(--muted); font-size: 10px; line-height: 1.4; margin-top: 3px; }
.inspection-steps li.disabled { color: #a3adb8; background: #fafbfc; }
.inspection-steps li.disabled .stage-icon { background: #f1f3f5; border-color: #dfe3e8; }

@media (max-width: 720px) {
  .card-heading-actions { width: 100%; justify-content: space-between; }
  .check-grid label { flex-direction: column; gap: 6px; padding: 9px 8px; }
  .check-grid strong { font-size: 11px; overflow-wrap: anywhere; }
}
