:root {
  --ink: #17211c;
  --muted: #5f6d68;
  --line: #dfe7e2;
  --paper: #fbfcfa;
  --white: #ffffff;
  --teal: #087f6b;
  --teal-dark: #056253;
  --mint: #e8f4ef;
  --amber: #d89422;
  --amber-soft: #fff4dd;
  --rose: #c95045;
  --rose-soft: #fff0ef;
  --stone: #f2f0ea;
  --shadow: 0 20px 50px rgba(23, 33, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  align-items: center;
  background: rgba(251, 252, 250, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px clamp(18px, 4vw, 40px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: flex;
  font-weight: 850;
  gap: 10px;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: var(--white);
  display: inline-flex;
  font-size: 0.78rem;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.topbar-status {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.status-pill,
.version-pill {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  max-width: min(48vw, 420px);
  overflow: hidden;
  padding: 8px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-pill {
  background: var(--stone);
  font-size: 0.78rem;
  max-width: none;
}

.workspace {
  display: grid;
  gap: clamp(18px, 3vw, 30px);
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  padding: clamp(18px, 4vw, 40px);
}

.panel,
.table-section,
.metric-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.setup-panel {
  align-self: start;
  box-shadow: var(--shadow);
  padding: 24px;
  position: sticky;
  top: 86px;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 0.98;
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
  margin-bottom: 0;
}

.lede,
.disclaimer,
.metric-card span,
.breakdown span {
  color: var(--muted);
}

.dropzone {
  align-items: center;
  background: var(--mint);
  border: 1px dashed var(--teal);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  margin: 22px 0 14px;
  min-height: 142px;
  padding: 20px;
  text-align: center;
}

.dropzone.dragover {
  background: #dff0e9;
  border-style: solid;
}

.dropzone input {
  display: none;
}

.file-input-hidden {
  display: none;
}

.dropzone strong {
  font-size: 1.05rem;
}

.dropzone span {
  color: var(--muted);
}

.actions,
.backend-actions,
.download-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.grouped-downloads {
  align-items: flex-start;
  gap: 8px;
  max-width: 920px;
}

.export-group-label {
  border-top: 1px solid var(--line);
  color: var(--muted);
  flex: 0 0 100%;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-top: 4px;
  padding-top: 10px;
  text-transform: uppercase;
}

.export-group-label:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.grouped-downloads .icon-button {
  min-height: 38px;
  padding: 0 12px;
}

.button,
.icon-button,
.sample-select {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
}

.button,
.icon-button {
  cursor: pointer;
}

.button {
  border: 1px solid transparent;
}

.primary {
  background: var(--teal);
  color: var(--white);
}

.primary:hover {
  background: var(--teal-dark);
}

.secondary,
.icon-button,
.sample-select {
  background: var(--white);
  border: 1px solid var(--line);
}

.secondary:hover,
.icon-button:hover:not(:disabled) {
  border-color: var(--teal);
}

.danger-button {
  color: var(--rose);
}

.danger-button:hover:not(:disabled) {
  border-color: var(--rose);
}

.icon-button:disabled {
  color: #9aa8a2;
  cursor: not-allowed;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--teal);
  cursor: pointer;
  font-weight: 850;
  padding: 0;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.active-pack {
  color: var(--teal);
  font-weight: 850;
}

.history-review-pill,
.history-hash,
.history-schema {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  margin: 2px 4px 2px 0;
  padding: 4px 7px;
}

.history-review-pill.ready {
  background: var(--mint);
  border-color: #b7d8ce;
  color: var(--teal);
}

.history-review-pill.review {
  background: var(--amber-soft);
  border-color: #efd09a;
  color: #98640e;
}

.history-review-pill.info {
  background: #e9f2ef;
  border-color: #bed5cd;
  color: var(--teal);
}

.history-review-pill.blocked {
  background: var(--rose-soft);
  border-color: #f0c6c1;
  color: var(--rose);
}

.history-schema.ready {
  background: var(--mint);
  border-color: #b7d8ce;
  color: var(--teal);
}

.history-schema.review {
  background: var(--amber-soft);
  border-color: #efd09a;
  color: #98640e;
}

.history-schema.blocked {
  background: var(--rose-soft);
  border-color: #f0c6c1;
  color: var(--rose);
}

.danger-text {
  color: var(--rose);
}

.form-section {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 16px;
}

.form-section-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.form-section-header .eyebrow {
  margin-bottom: 0;
}

.settings {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.settings.compact {
  margin-top: 0;
}

.settings.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings label {
  color: var(--muted);
  display: grid;
  font-size: 0.9rem;
  font-weight: 750;
  gap: 6px;
}

.settings input,
.settings select,
.settings textarea {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

.settings textarea {
  line-height: 1.35;
  min-height: 104px;
  padding: 10px 12px;
  resize: vertical;
}

.backend-actions {
  margin-top: 12px;
}

.backend-report-download {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 12px;
}

.backend-report-download label {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 850;
  gap: 6px;
}

.backend-report-download select {
  appearance: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

.backend-status {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  margin: 12px 0 0;
  padding: 10px 12px;
}

.backend-status[data-status="ready"] {
  background: var(--mint);
  border-color: #b7d8ce;
  color: var(--teal);
}

.backend-status[data-status="review"] {
  background: var(--amber-soft);
  border-color: #efd09a;
  color: #98640e;
}

.backend-status[data-status="blocked"] {
  background: var(--rose-soft);
  border-color: #f0c6c1;
  color: var(--rose);
}

.backend-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.backend-meta span {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
}

@media (max-width: 720px) {
  .backend-report-download {
    grid-template-columns: 1fr;
  }
}

.settings input::placeholder,
.settings textarea::placeholder {
  color: #98a7a1;
}

.disclaimer {
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  margin: 20px 0 0;
  padding-top: 16px;
}

.period-status {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  margin: 10px 0 0;
}

.content {
  display: grid;
  gap: 18px;
}

.workflow-steps {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 18px;
}

.workflow-step {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  min-height: 78px;
  padding: 12px;
}

.workflow-step > span {
  align-items: center;
  background: var(--stone);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 30px;
  font-size: 0.82rem;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.workflow-step div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workflow-step strong,
.workflow-step small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-step strong {
  font-size: 0.95rem;
}

.workflow-step small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.workflow-step.complete {
  border-color: #c8e2d7;
}

.workflow-step.complete > span,
.workflow-step.current > span {
  background: var(--mint);
  color: var(--teal);
}

.workflow-step.current {
  box-shadow: inset 0 0 0 1px var(--teal);
}

.workflow-step.blocked {
  background: var(--rose-soft);
  border-color: #f0c6c1;
}

.workflow-step.blocked > span {
  background: #ffd8d5;
  color: var(--rose);
}

.next-action-card {
  padding: 0 18px 18px;
}

.status-card.next-action {
  background: var(--white);
}

.status-card.next-action small {
  color: var(--ink);
  font-weight: 850;
  line-height: 1.35;
}

.mapping-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.mapping-note {
  background: var(--mint);
  border: 1px solid #c8e2d7;
  border-radius: 8px;
  color: var(--teal);
  font-weight: 750;
  margin: 0;
  padding: 12px 14px;
}

.mapping-note.warning {
  background: var(--amber-soft);
  border-color: #efd09a;
  color: #98640e;
}

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

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

.mapping-review-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.diagnostic-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
}

.diagnostic-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.diagnostic-card strong {
  font-size: 1.1rem;
}

.diagnostic-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.diagnostic-card.ok {
  border-color: #c8e2d7;
}

.diagnostic-card.warning {
  background: var(--amber-soft);
  border-color: #efd09a;
}

.diagnostic-card.info {
  background: #f7f7f3;
}

.mapping-review-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 12px;
}

.mapping-review-card div {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.mapping-review-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}

.mapping-review-card strong {
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 4px 7px;
}

.mapping-review-card p,
.mapping-review-card small {
  overflow-wrap: anywhere;
}

.mapping-review-card p {
  font-size: 0.94rem;
  font-weight: 800;
  margin: 0;
}

.mapping-review-card small {
  color: var(--muted);
  line-height: 1.35;
}

.mapping-review-card.ready {
  border-color: #c8e2d7;
}

.mapping-review-card.ready strong {
  background: var(--mint);
  color: var(--teal);
}

.mapping-review-card.review {
  background: var(--amber-soft);
  border-color: #efd09a;
}

.mapping-review-card.review strong {
  background: #f4dcae;
  color: #98640e;
}

.mapping-review-card.blocked {
  background: var(--rose-soft);
  border-color: #efc1c1;
}

.mapping-review-card.blocked strong {
  background: #f1caca;
  color: var(--rose);
}

.mapping-field {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 14px;
}

.confidence {
  align-self: start;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  justify-self: start;
  padding: 4px 8px;
}

.confidence.exact,
.confidence.saved {
  background: var(--mint);
  color: var(--teal);
}

.confidence.partial,
.confidence.manual {
  background: var(--amber-soft);
  color: #98640e;
}

.confidence.missing {
  background: var(--rose-soft);
  color: var(--rose);
}

.mapping-field label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.mapping-field .required {
  color: var(--rose);
}

.mapping-field select {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 40px;
  padding: 0 10px;
  width: 100%;
}

.mapping-field small {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card {
  min-height: 118px;
  padding: 18px;
}

.metric-card strong {
  display: block;
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.05;
  margin-top: 16px;
}

.metric-card.attention {
  background: var(--amber-soft);
  border-color: #efd09a;
}

.metric-card.handoff {
  background: #e9f2ef;
  border-color: #bed5cd;
}

.quality-strip {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}

.quality-strip article {
  background: var(--paper);
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 14px;
}

.quality-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quality-strip strong {
  color: var(--ink);
  font-size: 1rem;
}

.quality-strip.ready {
  border-color: #c8e2d7;
}

.quality-strip.review {
  border-color: #efd09a;
}

.quality-strip.review article:first-child {
  background: var(--amber-soft);
}

.quality-strip.blocked {
  border-color: #f0c6c1;
}

.quality-strip.blocked article:first-child {
  background: var(--rose-soft);
}

.table-section {
  overflow: hidden;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 18px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--stone);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  font-size: 0.94rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.severity {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 5px 9px;
}

.severity.high {
  background: var(--rose-soft);
  color: var(--rose);
}

.severity.medium {
  background: var(--amber-soft);
  color: #98640e;
}

.severity.info {
  background: var(--mint);
  color: var(--teal);
}

.breakdown {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 18px;
}

.einvoice-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.einvoice-strip article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 92px;
  padding: 16px;
}

.einvoice-strip span {
  color: var(--muted);
  display: block;
  font-size: 0.86rem;
  font-weight: 750;
}

.einvoice-strip strong {
  display: block;
  font-size: 1.45rem;
  margin-top: 10px;
}

.einvoice-strip article.ready {
  border-color: #c8e2d7;
}

.einvoice-strip article.review {
  background: var(--amber-soft);
  border-color: #efd09a;
}

.einvoice-strip article.blocked {
  background: var(--rose-soft);
  border-color: #f0c6c1;
}

.pack-completeness-strip,
.decision-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin: 0 0 18px;
}

.pack-completeness-strip article,
.decision-strip article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 106px;
  padding: 16px;
}

.pack-completeness-strip span,
.decision-strip span {
  color: var(--muted);
  display: block;
  font-size: 0.86rem;
  font-weight: 750;
}

.pack-completeness-strip strong,
.decision-strip strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.pack-completeness-strip small,
.decision-strip small {
  color: var(--muted);
  display: block;
  font-weight: 750;
  line-height: 1.3;
  margin-top: 8px;
}

.pack-completeness-strip article.ready,
.decision-strip article.ready {
  border-color: #c8e2d7;
}

.pack-completeness-strip article.ready strong,
.decision-strip article.ready strong {
  color: var(--teal);
}

.pack-completeness-strip article.review,
.decision-strip article.review {
  background: var(--amber-soft);
  border-color: #efd09a;
}

.pack-completeness-strip article.review strong,
.decision-strip article.review strong {
  color: #98640e;
}

.pack-completeness-strip article.blocked,
.decision-strip article.blocked {
  background: var(--rose-soft);
  border-color: #f0c6c1;
}

.decision-strip strong {
  font-size: 1.02rem;
  line-height: 1.22;
}

.pack-completeness-strip article.blocked strong,
.decision-strip article.blocked strong {
  color: var(--rose);
}

.export-status,
.provider-import-status {
  padding: 0 18px 18px;
}

.provider-import-status:empty {
  display: none;
}

.status-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  padding: 14px;
}

.status-card span {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 900;
  justify-self: start;
  padding: 4px 8px;
  text-transform: uppercase;
}

.status-card strong {
  font-size: 1rem;
}

.status-card p {
  color: var(--muted);
  margin: 0;
}

.status-card.ready {
  border-color: #c8e2d7;
}

.status-card.ready span {
  background: var(--mint);
  color: var(--teal);
}

.status-card.review {
  background: var(--amber-soft);
  border-color: #efd09a;
}

.status-card.review span {
  background: #ffe8b8;
  color: #98640e;
}

.status-card.blocked {
  background: var(--rose-soft);
  border-color: #f0c6c1;
}

.status-card.blocked span {
  background: #ffd8d5;
  color: var(--rose);
}

.breakdown div,
.finalize-grid div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 96px;
  padding: 16px;
}

.breakdown strong,
.finalize-grid strong {
  display: block;
  font-size: 1.25rem;
  margin-top: 12px;
}

.finalize-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 18px 18px 0;
}

.finalize-grid span {
  color: var(--muted);
}

.finalize-grid small {
  color: var(--muted);
  display: block;
  font-weight: 750;
  margin-top: 8px;
}

.health-card.ready {
  border-color: #c8e2d7;
}

.health-card.ready strong {
  color: var(--teal);
}

.health-card.review {
  background: var(--amber-soft);
  border-color: #efd09a;
}

.health-card.review strong {
  color: #98640e;
}

.health-card.blocked {
  background: var(--rose-soft);
  border-color: #f0c6c1;
}

.health-card.blocked strong {
  color: var(--rose);
}

.finalize-note {
  color: var(--muted);
  margin: 0;
  padding: 16px 18px 18px;
}

.finalize-note.warning {
  color: #98640e;
}

.finalize-note.locked {
  color: var(--teal);
  font-weight: 750;
}

.readiness-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 18px 18px;
}

.readiness-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 14px;
}

.readiness-item span {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 900;
  justify-self: start;
  padding: 4px 8px;
  text-transform: uppercase;
}

.readiness-item strong {
  font-size: 1rem;
}

.readiness-item p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.readiness-item.ready span {
  background: var(--mint);
  color: var(--teal);
}

.readiness-item.review {
  background: var(--amber-soft);
  border-color: #efd09a;
}

.readiness-item.review span {
  background: #ffe8b8;
  color: #98640e;
}

.readiness-item.blocked {
  background: var(--rose-soft);
  border-color: #f0c6c1;
}

.readiness-item.blocked span {
  background: #ffd8d5;
  color: var(--rose);
}

.exception-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 10px;
}

.exception-summary.secondary {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.exception-summary span {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 6px 10px;
}

.exception-summary span.blocked {
  background: var(--rose-soft);
  border-color: #f0c6c1;
  color: var(--rose);
}

.exception-summary span.review {
  background: var(--amber-soft);
  border-color: #efd09a;
  color: #98640e;
}

.exception-summary span.info {
  background: #e9f2ef;
  border-color: #bed5cd;
  color: var(--teal);
}

.exception-summary span.ready {
  background: var(--mint);
  border-color: #b7d8ce;
  color: var(--teal);
}

.exception-filter-note {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  margin: 0;
  padding: 0 18px 16px;
}

.document-select {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  min-width: 170px;
  padding: 0 12px;
}

.review-status-select {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 36px;
  min-width: 150px;
  padding: 0 10px;
}

.review-status-select:disabled {
  background: #f2f3f1;
  color: var(--muted);
}

.document-preview {
  background: #f7f7f3;
  padding: 18px;
}

.empty-document {
  color: var(--muted);
  margin: 0;
}

.empty-state {
  max-width: 560px;
}

.print-document {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #111;
  margin: 0 auto;
  max-width: 820px;
  min-height: 1040px;
  padding: 44px;
}

.document-head,
.document-parties,
.document-totals {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 1fr;
}

.document-head {
  border-bottom: 2px solid #111;
  padding-bottom: 24px;
}

.document-title {
  font-size: 2.2rem;
  line-height: 1;
  margin: 0 0 12px;
}

.document-meta,
.party-box,
.document-summary {
  color: #333;
  display: grid;
  gap: 6px;
}

.party-box {
  background: #f7f7f3;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
}

.document-parties,
.document-lines,
.document-totals,
.document-footer {
  margin-top: 28px;
}

.document-lines table {
  min-width: 0;
}

.document-lines th,
.document-lines td {
  color: #111;
  padding: 10px;
}

.document-totals {
  align-items: start;
}

.totals-box {
  border-top: 2px solid #111;
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.totals-box div {
  display: flex;
  justify-content: space-between;
}

.totals-box strong {
  font-size: 1.2rem;
}

.document-footer {
  border-top: 1px solid #ddd;
  color: #555;
  font-size: 0.88rem;
  padding-top: 16px;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .setup-panel {
    position: static;
  }

  .mapping-grid,
  .mapping-review-grid,
  .diagnostics-grid,
  .workflow-steps,
  .summary-grid,
  .quality-strip,
  .einvoice-strip,
  .pack-completeness-strip,
  .finalize-grid,
  .readiness-list,
  .breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topbar-status {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .status-pill,
  .version-pill {
    max-width: 100%;
  }

  .mapping-grid,
  .mapping-review-grid,
  .diagnostics-grid,
  .workflow-steps,
  .summary-grid,
  .quality-strip,
  .einvoice-strip,
  .pack-completeness-strip,
  .finalize-grid,
  .readiness-list,
  .breakdown {
    grid-template-columns: 1fr;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-head,
  .document-parties,
  .document-totals {
    grid-template-columns: 1fr;
  }

  .print-document {
    padding: 24px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .setup-panel,
  .summary-grid,
  .mapping-section,
  .finalize-section,
  .table-section:not(.document-section),
  .no-print {
    display: none !important;
  }

  .workspace,
  .content,
  .document-section,
  .document-preview {
    display: block;
    padding: 0;
  }

  .workspace {
    margin: 0;
  }

  .document-section {
    border: 0;
  }

  .document-preview {
    background: #fff;
  }

  .print-document {
    border: 0;
    border-radius: 0;
    margin: 0;
    max-width: none;
    min-height: 0;
    padding: 0;
  }
}
