:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #393939;
  background: #f7f7f7;
  font-synthesis: none;
  --brand: #00bcf0;
  --brand-dark: #393939;
  --brand-hover: #00a6d5;
  --brand-soft: #eefbfe;
  --border: #cfcfcf;
  --border-soft: #e7e7e7;
  --muted: #626262;
  --success: #0e7a0d;
  --success-soft: #f1faf1;
  --warning: #8a5400;
  --warning-soft: #fff8e6;
  --danger: #c50f1f;
  --shadow: 0 8px 24px rgba(57, 57, 57, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: #f7f7f7;
}

button,
input,
select { font: inherit; }

button,
input,
select,
a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  z-index: 20;
  left: 16px;
  top: -80px;
  padding: 10px 14px;
  border-radius: 6px;
  color: #fff;
  background: #242424;
}

.skip-link:focus { top: 12px; }

.app-header {
  color: var(--brand-dark);
  background: #fff;
  border-top: 6px solid var(--brand);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 2px 12px rgba(57, 57, 57, .05);
}

.header-inner,
.page-shell,
footer {
  width: min(100% - 40px, 1000px);
  margin-inline: auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  fill: var(--brand);
}

.brand strong { display: block; color: var(--brand-dark); font-size: 14px; line-height: 1.25; font-weight: 600; }

.brand-name {
  display: block;
  margin-bottom: 2px;
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.eyebrow {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  opacity: .82;
}

.hold-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  padding: 5px 9px;
  border: 1px solid #d8b84e;
  border-radius: 999px;
  font-size: 11px;
  color: #5c4900;
  background: #fff9df;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.hold-badge > span { color: #d2a900; font-size: 9px; }

.page-shell { padding: 36px 0 64px; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  margin-bottom: 24px;
}

.section-kicker,
.step-label,
.result-label {
  margin: 0 0 5px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}

h1 {
  max-width: 720px;
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(29px, 5vw, 42px);
  line-height: 1.08;
  letter-spacing: -.025em;
}

.lead {
  max-width: 740px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.safety-note {
  min-width: 225px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #9fd89f;
  border-radius: 8px;
  color: #174f17;
  background: var(--success-soft);
  font-size: 12px;
}

.safety-note strong,
.safety-note span span { display: block; }

.safety-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-weight: 700;
}

.session-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid #b4cddd;
  border-radius: 8px;
  color: #0c3b5e;
  background: var(--brand-soft);
  font-size: 13px;
  font-weight: 600;
}

.session-status.is-empty {
  border-color: #e2c661;
  color: #6d4700;
  background: var(--warning-soft);
}

.session-status.is-ready {
  border-color: #9fd89f;
  color: #174f17;
  background: var(--success-soft);
}

.session-status.is-error {
  border-color: #e6a7ad;
  color: #8e0711;
  background: #fdf3f4;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.review-card {
  margin-top: 14px;
  padding: 26px;
  border: 1px solid var(--border-soft);
  border-top: 3px solid var(--brand);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.step-number {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-dark);
  background: var(--brand);
  font-weight: 700;
}

.step-label { margin-bottom: 2px; }

h2,
h3 { margin: 0; color: var(--brand-dark); }

h2 { font-size: clamp(19px, 3vw, 23px); line-height: 1.25; }

.empty-state {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px;
  border: 1px dashed #b4b4b4;
  border-radius: 8px;
  color: #424242;
  background: #fafafa;
}

.empty-state p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }

.empty-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 22px;
  font-weight: 600;
}

.file-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid #b4cddd;
  border-radius: 8px;
  background: var(--brand-soft);
}

.file-summary strong,
.file-summary span { min-width: 0; }

.file-summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  border-radius: 5px;
  color: #fff;
  background: #c50f1f;
  font-size: 10px;
  font-weight: 800;
}

.verified-label {
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.source-image-panel {
  margin: 0 0 20px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fafafa;
}

.source-image-panel img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 5px;
  background: #fff;
}

.source-image-panel figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.ocr-notice {
  display: grid;
  gap: 3px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  color: #242424;
}

.ocr-notice span { color: var(--muted); font-size: 13px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-grid--source { align-items: end; }

.field {
  display: grid;
  gap: 7px;
  color: #242424;
  font-size: 13px;
  font-weight: 600;
}

.field--wide { margin-top: 20px; }

.field small,
.data-point small,
.choice-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #8a8886;
  border-radius: 5px;
  color: #242424;
  background: #fff;
}

input:hover:not(:disabled),
select:hover:not(:disabled) { border-color: #242424; }

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0,188,240,.32);
  outline-offset: 2px;
}

input[aria-invalid="true"],
select[aria-invalid="true"] { border-color: var(--danger); }

input:disabled,
select:disabled,
button:disabled { cursor: not-allowed; opacity: .55; }

.data-point {
  min-height: 40px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 10px 12px;
  border-left: 3px solid var(--success);
  background: #fafafa;
}

.data-label { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }

.digest {
  overflow-wrap: anywhere;
  font-family: Consolas, "SFMono-Regular", monospace;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  cursor: pointer;
}

.check-row input,
.choice-card input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.check-row strong,
.check-row span span { display: block; }

.check-row span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.check-row strong { color: #242424; }

.choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: var(--brand-soft);
}

.choice-card strong,
.choice-card small { display: block; }
.choice-card small { margin-top: 3px; }

.invoice-fields { margin-top: 22px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.divider::after { content: ""; height: 1px; flex: 1; background: var(--border-soft); }

.review-summary {
  min-height: 92px;
  padding: 17px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fafafa;
}

.review-summary > .muted { margin: 17px 0; text-align: center; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 24px;
  margin: 0;
}

.summary-grid div { min-width: 0; }
.summary-grid dt { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.summary-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 600; }

.muted { display: block; color: var(--muted); font-size: 12px; }

.check-row--final { border-color: #b4cddd; background: var(--brand-soft); }

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 18px;
}

.action-bar p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid var(--brand);
  border-radius: 5px;
  color: var(--brand-dark);
  background: var(--brand);
  font-weight: 650;
  cursor: pointer;
}

button:hover:not(:disabled) { border-color: var(--brand-hover); background: var(--brand-hover); }

.error-summary {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid #e6a7ad;
  border-left: 4px solid var(--danger);
  border-radius: 7px;
  color: #8e0711;
  background: #fdf3f4;
}

.error-summary ul { margin: 8px 0 0; padding-left: 20px; }
.error-summary a { color: inherit; }

.final-result {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #9fd89f;
  border-radius: 8px;
  background: var(--success-soft);
}

.final-result[hidden] { display: none; }
.final-result h3 { margin-bottom: 5px; font-size: 18px; }
.final-result p { margin: 0; color: #3b3b3b; font-size: 13px; line-height: 1.45; }
.result-label { color: var(--success); }

.result-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-weight: 700;
}

.hold-badge--result {
  margin-top: 10px;
  border-color: #d6b656;
  color: #604300;
  background: var(--warning-soft);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 34px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

footer strong,
footer span { display: block; }
footer nav { display: flex; gap: 18px; }
footer a { color: #424242; }

.shell {
  width: min(100% - 40px, 860px);
  margin: 0 auto;
  padding: 64px 0;
}

.card {
  padding: clamp(24px, 5vw, 48px);
  border-top: 6px solid var(--brand);
  background: #fff;
  box-shadow: var(--shadow);
}

.card .eyebrow { color: var(--brand-dark); opacity: 1; }
.card p { line-height: 1.65; }
.card a { color: #006987; font-weight: 650; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .header-inner,
  .page-shell,
  footer { width: min(100% - 28px, 1000px); }
  .header-inner { min-height: 62px; }
  .brand-name { font-size: 17px; }
  .brand strong { font-size: 12px; }
  .eyebrow { font-size: 9px; }
  .header-inner > .hold-badge { display: none; }
  .page-shell { padding-top: 26px; }
  .intro { grid-template-columns: 1fr; align-items: start; gap: 18px; }
  .safety-note { min-width: 0; width: 100%; }
  .review-card { padding: 20px 16px; }
  .form-grid,
  .choice-group,
  .summary-grid { grid-template-columns: 1fr; }
  .action-bar { align-items: stretch; flex-direction: column; }
  .action-bar button { width: 100%; }
  footer { flex-direction: column; }
}

@media (max-width: 420px) {
  .brand-mark { width: 36px; height: 36px; }
  .step-heading { align-items: flex-start; }
  .file-summary { grid-template-columns: auto minmax(0, 1fr); }
  .verified-label { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
