:root {
  --ink: #182b27;
  --muted: #58675f;
  --green: #183f37;
  --green-hover: #285b4f;
  --line: #dce2dc;
  --paper: #fff;
  --background: #f5f6f1;
  --error: #9d302b;
  --error-bg: #fff1ed;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 15px; line-height: 1.6; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #397cda; outline-offset: 4px; }
button { touch-action: manipulation; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
p, h1, h2 { margin: 0; }
.page { width: min(100% - 64px, 860px); margin: 0 auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding: 30px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 750; letter-spacing: .12em; }
.brand svg { width: 26px; height: 26px; }
.format-label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.format-label span { margin: 0 7px; }
.intro { padding: 42px 0 28px; max-width: 640px; }
h1 { font-size: clamp(30px, 4.5vw, 40px); font-weight: 650; line-height: 1.16; letter-spacing: -.035em; text-wrap: balance; }
.lead { margin-top: 14px; max-width: 520px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.workspace { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.muted { color: var(--muted); font-size: 13px; }
.drop-zone { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; color: var(--green); background: #f8faf6; border: 1px dashed #9dab9f; border-radius: 10px; transition: background .15s, border-color .15s; }
.drop-zone:hover:not(:disabled), .drop-zone.is-dragging { background: #edf4eb; border-color: var(--green); }
.drop-zone:disabled { opacity: .55; }
.drop-zone svg { width: 36px; height: 36px; margin-bottom: 9px; }
.drop-title { font-size: 15px; font-weight: 650; }
.drop-caption { font-size: 13px; color: var(--muted); }
.limits { margin-top: 10px; font-size: 12px; color: var(--muted); }
.inline-error { color: var(--error); font-size: 13px; margin-top: 12px; white-space: pre-line; overflow-wrap: anywhere; }
.notice { padding: 14px 16px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: #eef2ec; overflow-wrap: anywhere; }
.notice-error { color: var(--error); background: var(--error-bg); border-color: #ebc4b9; }
.notice-warning { color: #715020; background: #fff8e9; border-color: #e6d4ae; }
#action-error { margin-top: 16px; margin-bottom: 0; white-space: pre-line; }
.text-button { background: none; color: inherit; border: 0; padding: 8px 0; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.file-list { padding: 0; margin: 20px 0 0; list-style: none; }
.file-list:empty { margin: 0; }
.file-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.file-row:first-child { border-top: 1px solid var(--line); }
.file-icon { display: grid; place-items: center; width: 34px; height: 40px; border-radius: 5px; background: #f0f3ed; color: var(--green); font-size: 9px; font-weight: 750; letter-spacing: .03em; }
.file-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.file-details, .file-error { font-size: 12px; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.file-error { color: var(--error); }
.file-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.remove-button { background: transparent; border: 0; color: var(--muted); padding: 8px 2px; min-height: 44px; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.remove-button:hover:not(:disabled) { color: var(--error); }
.remove-button:disabled { opacity: .5; }
.status-badge { color: var(--muted); font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 5px; background: #f0f2ef; text-align: center; }
.status-badge[data-state="completed"] { color: #24553c; background: #eaf4e8; }
.status-badge[data-state="processing"], .status-badge[data-state="uploading"] { color: #305e78; background: #edf3f7; }
.status-badge[data-state="failed"], .status-badge[data-state="unavailable"] { color: var(--error); background: var(--error-bg); }
.status-badge[data-state="paused"] { color: #715020; background: #fff8e9; }
.file-progress { width: 100%; height: 4px; margin-top: 8px; display: block; }
.guidance { margin: 18px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.guidance summary { width: fit-content; color: #3e5048; cursor: pointer; font-weight: 600; }
.guidance p { max-width: 680px; margin: 8px 0 0; }
.job-panel { padding-top: 24px; margin: 24px 0; border-top: 1px solid var(--line); }
.job-panel .section-heading { margin-bottom: 10px; }
#job-message { font-size: 14px; overflow-wrap: anywhere; }
progress { appearance: none; -webkit-appearance: none; border: 0; background: #edf0ea; color: var(--green); accent-color: var(--green); border-radius: 8px; overflow: hidden; }
progress::-webkit-progress-bar { background: #edf0ea; border-radius: 8px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 8px; }
progress:not([value]) { background: #e0e9df; }
.job-progress { display: block; width: 100%; height: 6px; margin-top: 16px; }
.progress-detail { margin-top: 8px; font-variant-numeric: tabular-nums; }
.summary { margin-top: 22px; padding: 18px 20px; border: 1px solid #dbe7d7; border-radius: 10px; background: #f5f9f1; }
.summary > p:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.summary strong { font-size: 32px; line-height: 1.2; font-weight: 650; letter-spacing: -.03em; }
.summary span { font-size: 14px; }
.summary .muted { margin-top: 6px; }
.review-panel { margin: 28px 0; padding-top: 24px; border-top: 1px solid var(--line); }
.review-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; margin: 14px 0; padding: 12px; contain: inline-size; }
.review-table-wrap table { width: 100%; min-width: 590px; border-collapse: collapse; font-size: 13px; }
.review-table-wrap th, .review-table-wrap td { padding: 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.review-table-wrap th { background: #f5f7f3; font-size: 11px; letter-spacing: .03em; }
.review-table-wrap tbody tr:last-child td { border-bottom: 0; }
.review-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-toggle-cell { text-align: right !important; white-space: nowrap; }
.review-toggle { min-height: 32px; padding: 4px 0; font-size: 12px; }
.review-detail td { padding: 0; background: #fafbf8; }
.review-detail-content { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 14px 16px; }
.review-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; margin: 0; flex: 1; }
.review-facts dt { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.review-facts dd { margin: 1px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.review-actions { display: flex; flex-wrap: wrap; gap: 12px; flex-shrink: 0; }
.review-actions .text-button { min-height: 32px; padding: 4px 0; font-size: 12px; }
#confirm-warnings-wrap { display: block; margin: 14px 0; font-size: 13px; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.action-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.primary-button, .secondary-button { border-radius: 7px; padding: 12px 18px; min-height: 46px; font-size: 12px; font-weight: 700; line-height: 1.5; }
.primary-button { background: var(--green); color: white; border: 1px solid var(--green); letter-spacing: .045em; }
.primary-button:hover:not(:disabled) { background: var(--green-hover); }
.primary-button:disabled { background: #e6eae3; color: #59665f; border-color: #e6eae3; }
.secondary-button { background: white; color: var(--green); border: 1px solid #c7d2c7; }
.secondary-button:hover:not(:disabled) { background: #f3f6ef; }
.secondary-button:disabled { opacity: .6; }
#download-button span { margin-left: 8px; }
.download-status { margin-top: 12px; text-align: right; }
.footnote { font-size: 12px; color: var(--muted); padding: 18px 12px; text-align: center; line-height: 1.7; }
footer { color: var(--muted); font-size: 11px; padding: 24px 0 32px; text-align: center; }
.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; }
.skip-link { position: absolute; top: -100px; left: 16px; color: white; background: var(--green); padding: 12px 16px; z-index: 2; }
.skip-link:focus { top: 12px; }

@media (max-width: 600px) {
  .page { width: min(100% - 32px, 860px); }
  .masthead { padding: 20px 0; }
  .intro { padding: 32px 0 24px; }
  .lead { font-size: 15px; }
  .workspace { padding: 20px 16px; border-radius: 12px; }
  .section-heading { gap: 10px; }
  .file-row { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .file-icon { width: 28px; }
  .file-controls { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .review-table-wrap { overflow: visible; padding: 8px; contain: none; }
  .review-table-wrap table, .review-table-wrap tbody { display: block; width: 100%; min-width: 0; }
  .review-table-wrap thead { display: none; }
  .review-table-wrap tr { display: block; width: 100%; }
  .review-row { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; padding: 14px 12px; }
  .review-table-wrap th, .review-table-wrap td { border: 0; padding: 0; }
  .review-row td { min-width: 0; }
  .review-row td::before { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .02em; }
  .review-row td:nth-child(1)::before { content: "Data"; }
  .review-row td:nth-child(2)::before { content: "Transação"; }
  .review-row td:nth-child(3)::before { content: "Valor"; }
  .review-row td:nth-child(4)::before { content: "Revisão"; }
  .review-row .review-toggle-cell { grid-column: 1 / -1; text-align: left !important; }
  .review-detail, .review-detail td { display: block; width: 100%; }
  .review-detail-content { align-items: stretch; flex-direction: column; gap: 12px; padding: 14px 12px; border-top: 1px solid var(--line); }
  .review-facts { grid-template-columns: 1fr; gap: 2px; }
  .review-facts dt { margin-top: 8px; }
  .review-actions { gap: 14px; }
  .actions { align-items: stretch; flex-direction: column; gap: 14px; }
  .action-buttons { flex-direction: column; }
  .action-buttons button { width: 100%; }
  .download-status { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
