/* =========================================================================
   Extrator de Pedidos — Landing page
   Conceito: papel quadriculado (planilha) como chão; o documento real
   em papel; o painel verde do app como palco. Documentos + planilhas +
   dados + automação.
   ========================================================================= */

/* RESET */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body,
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, fieldset { margin: 0; }

ul, ol { padding: 0; list-style: none; }

fieldset { border: 0; padding: 0; min-width: 0; }

img, svg { display: block; max-width: 100%; }

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

button { cursor: pointer; background: none; border: 0; padding: 0; }

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

table { border-collapse: collapse; }

[hidden] { display: none !important; }

/* VARIABLES */
:root {
  /* Paleta do produto */
  --green: #123D2B;
  --green-light: #1F5A3F;
  --green-deep: #0C2B1E;
  --cream: #F4F0E4;
  --cream-deep: #EAE4D3;
  --off-white: #FAFAF6;
  --dark: #172019;
  --gray: #73786F;
  --border: rgba(23, 32, 25, 0.12);
  --border-strong: rgba(23, 32, 25, 0.22);

  /* Acento dourado (o “Excel.” do app) */
  --gold: #DCC08A;
  --gold-light: #E8D3A6;
  --gold-ink: #8A6A2C;
  --gold-soft: rgba(220, 192, 138, 0.22);

  /* Semânticas */
  --ok: #2C7A4D;
  --ok-soft: rgba(44, 122, 77, 0.1);
  --warn: #A3621B;
  --warn-soft: rgba(163, 98, 27, 0.11);

  /* Sobre o verde */
  --on-dark: #F4F0E4;
  --on-dark-muted: rgba(244, 240, 228, 0.7);
  --on-dark-faint: rgba(244, 240, 228, 0.45);
  --line-dark: rgba(244, 240, 228, 0.14);
  --glass-dark: rgba(12, 43, 30, 0.72);

  /* Grade de planilha no fundo */
  --grid-line: rgba(23, 32, 25, 0.045);
  --grid-line-dark: rgba(244, 240, 228, 0.045);
  --grid-size: 28px;

  /* Tipografia */
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-h3: 1.1875rem;
  --fs-h2: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);
  --fs-h1: clamp(2.4rem, 1.4rem + 2.7vw, 3.55rem);

  /* Forma */
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  --shadow-sm: 0 1px 2px rgba(23, 32, 25, 0.06), 0 2px 8px rgba(23, 32, 25, 0.04);
  --shadow-md: 0 2px 4px rgba(23, 32, 25, 0.05), 0 12px 32px -8px rgba(23, 32, 25, 0.16);
  --shadow-lg: 0 4px 10px rgba(12, 43, 30, 0.12), 0 32px 64px -20px rgba(12, 43, 30, 0.45);

  --container: 1240px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 72px;
  --section-y: clamp(88px, 9vw, 144px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms;
  --t-med: 320ms;
}

/* TYPOGRAPHY */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--cream);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h2 { font-size: var(--fs-h2); }

h3 {
  font-family: var(--font-body);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

em { font-style: italic; }

p { text-wrap: pretty; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-light);
}

.eyebrow__ref {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 22px;
  padding-inline: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--off-white);
  color: var(--gray);
  letter-spacing: 0.02em;
}

.section { padding-block: var(--section-y); }

.section-head {
  display: grid;
  gap: 18px;
  max-width: 760px;
  margin-bottom: clamp(44px, 5vw, 72px);
}

.section-head h2 { max-width: 20ch; }

.section-head__lead {
  font-size: var(--fs-md);
  color: var(--gray);
  max-width: 58ch;
}

.section-head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px 64px;
}

.section-head--split > div {
  display: grid;
  gap: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  background: var(--ok);
  color: var(--off-white);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}

.tag .icon { width: 11px; height: 11px; }

.tag--static {
  background: var(--ok-soft);
  color: var(--ok);
  padding: 3px 9px;
}

.tag--warn {
  background: var(--warn-soft);
  color: var(--warn);
  padding: 3px 9px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
  flex-shrink: 0;
}

/* Botões */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--dark);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    transform var(--t-fast) var(--ease-out),
    background-color var(--t-fast) ease,
    border-color var(--t-fast) ease,
    box-shadow var(--t-fast) ease;
}

.btn .btn__arrow { transition: transform var(--t-med) var(--ease-out); }

.btn:hover { transform: translateY(-1px); }

.btn:hover .btn__arrow { transform: translateX(4px); }

.btn:active { transform: translateY(0); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--lg {
  min-height: 52px;
  padding: 14px 24px;
  font-size: var(--fs-base);
}

.btn--sm {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.8125rem;
}

.btn--primary {
  --btn-bg: var(--gold);
  --btn-fg: var(--dark);
  box-shadow: inset 0 -1px 0 rgba(23, 32, 25, 0.12);
}

.btn--primary:hover {
  --btn-bg: var(--gold-light);
  box-shadow: inset 0 -1px 0 rgba(23, 32, 25, 0.12), 0 8px 20px -8px rgba(220, 192, 138, 0.7);
}

.btn--dark {
  --btn-bg: var(--green);
  --btn-fg: var(--on-dark);
}

.btn--dark:hover:not(:disabled) { --btn-bg: var(--green-light); }

.btn--ghost-light {
  --btn-fg: var(--on-dark);
  --btn-border: var(--line-dark);
}

.btn--ghost-light:hover {
  --btn-bg: rgba(244, 240, 228, 0.06);
  --btn-border: var(--on-dark-faint);
}

.btn--outline {
  --btn-bg: var(--off-white);
  --btn-border: var(--border-strong);
}

.btn--outline:hover { --btn-bg: var(--cream); }

/* Marca */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--dark);
}

.brand__logo {
  display: block;
  height: 44px;          /* a proporção 800x242 do arquivo mantém a largura */
  width: auto;
  transition: opacity var(--t-med) ease;
}

.brand:hover .brand__logo { opacity: 0.86; }
.brand:focus-visible { outline-offset: 6px; }

/* NAVBAR */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  transition: background-color var(--t-med) ease, box-shadow var(--t-med) ease;
}

.site-header.is-scrolled {
  background: rgba(250, 250, 246, 0.86);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  backdrop-filter: saturate(1.2) blur(14px);
  box-shadow: 0 1px 0 var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav__links a:not(.btn) {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--dark);
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}

.nav__links a:not(.btn):hover { background: rgba(23, 32, 25, 0.05); }

.nav__links a.is-active { color: var(--green); }

.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

.nav__menu-cta { display: none; }

.nav__toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--off-white);
}

.nav__toggle-bars {
  display: grid;
  gap: 5px;
  width: 18px;
}

.nav__toggle-bars span {
  display: block;
  height: 1.6px;
  border-radius: 2px;
  background: var(--dark);
  transition: transform var(--t-med) var(--ease-out);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bars span:first-child { transform: translateY(3.3px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars span:last-child { transform: translateY(-3.3px) rotate(-45deg); }

/* HERO */
.hero { padding-block: 8px clamp(24px, 3vw, 48px); }

.hero__panel {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
  padding: clamp(28px, 5vw, 72px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  color: var(--on-dark);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(31, 90, 63, 0.85) 0%, transparent 55%),
    radial-gradient(70% 60% at 0% 100%, rgba(220, 192, 138, 0.1) 0%, transparent 60%),
    linear-gradient(165deg, var(--green) 0%, var(--green-deep) 100%);
  box-shadow: var(--shadow-lg);
}

.hero__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-dark) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: linear-gradient(120deg, transparent 10%, #000 70%);
  mask-image: linear-gradient(120deg, transparent 10%, #000 70%);
}

.hero__copy {
  display: grid;
  gap: 26px;
  justify-items: start;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(244, 240, 228, 0.05);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark);
}

.badge .icon { width: 15px; height: 15px; color: var(--gold); }

.hero__title {
  font-size: var(--fs-h1);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero__title em {
  display: block;
  color: var(--gold);
}

.hero__lead {
  max-width: 46ch;
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--on-dark-muted);
}

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

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero__chips li {
  padding: 6px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--on-dark-muted);
}

/* Palco do hero */
.hero__stage {
  position: relative;
  min-width: 0;
  height: 690px;
}

/* PDF */
.doc {
  position: absolute;
  top: 0;
  left: 0;
  width: 62%;
  max-width: 380px;
  padding: 20px 20px 14px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--off-white);
  color: var(--dark);
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 60px -18px rgba(0, 0, 0, 0.55);
  transform: rotate(-1.6deg);
  transform-origin: 30% 20%;
}

.doc::after {
  /* textura sutil de papel escaneado */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(23, 32, 25, 0.025), transparent 18%, transparent 82%, rgba(23, 32, 25, 0.03));
}

.doc__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--dark);
}

.doc__kind {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.doc__number {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.doc__page {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--gray);
}

.doc__fields {
  display: grid;
  gap: 4px;
  margin-block: 10px 12px;
}

.doc__field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding: 7px 8px;
  border: 1px dashed transparent;
  border-radius: 5px;
  transition: background-color var(--t-med) ease, border-color var(--t-med) ease;
}

.doc__field.is-hit {
  border-color: rgba(138, 106, 44, 0.55);
  background: var(--gold-soft);
}

.doc__field dt {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

.doc__field dt { grid-row: 1; }

.doc__field dd {
  grid-column: 1 / -1;
  overflow: hidden;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc__field dd.doc__meta {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 9.5px;
  color: var(--gray);
}

.doc__field .tag {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.doc__field.doc__field--row {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 8px;
}

.doc__table {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.doc__table th {
  padding: 5px 4px;
  border-block: 1px solid var(--border-strong);
  font-weight: 500;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  color: var(--gray);
}

.doc__table td {
  padding: 5px 4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.doc__table td:nth-child(2) {
  overflow: hidden;
  max-width: 1px;
  width: 100%;
  text-overflow: ellipsis;
}

.doc__table th:nth-child(n+3),
.doc__table td:nth-child(n+3) { text-align: right; }

.doc__more td {
  color: var(--gray);
  font-style: italic;
  text-align: left !important;
}

.doc__total {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 9px 8px;
  border: 1px dashed transparent;
  border-top: 2px solid var(--dark);
  border-radius: 0 0 5px 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background-color var(--t-med) ease, border-color var(--t-med) ease;
}

.doc__total.is-hit {
  border-color: rgba(138, 106, 44, 0.55);
  border-top-color: var(--dark);
  background: var(--gold-soft);
}

.doc__total strong {
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
}

.doc__total .tag {
  position: absolute;
  top: -11px;
  right: 6px;
}

.doc__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  height: 64px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(220, 192, 138, 0.28) 85%, var(--gold) 100%);
  border-bottom: 1.5px solid var(--gold);
  will-change: transform, opacity;
}

/* Processamento */
.process {
  position: absolute;
  top: 28px;
  right: 0;
  z-index: 3;
  width: 206px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.5);
}

.process__title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
}

.process__steps {
  display: grid;
  gap: 10px;
  counter-reset: step;
}

.process__steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--on-dark-faint);
  transition: color var(--t-med) ease;
}

.process__steps li::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-dark);
  border-radius: 50%;
  transition: background-color var(--t-med) ease, border-color var(--t-med) ease;
}

.process__steps li.is-active { color: var(--on-dark); }

.process__steps li.is-active::before {
  border-color: var(--gold);
  border-top-color: transparent;
  animation: spin 0.9s linear infinite;
}

.process__steps li.is-done { color: var(--on-dark); }

.process__steps li.is-done::before {
  border-color: var(--gold);
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4L18 8.5' fill='none' stroke='%23172019' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.process__count {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--on-dark-muted);
  font-variant-numeric: tabular-nums;
}

.process__count span { color: var(--gold); font-weight: 500; }

/* Planilha do hero */
.mini-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: 82%;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--off-white);
  color: var(--dark);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
}

.mini-sheet__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.mini-sheet__file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dark);
}

.mini-sheet__file .icon { color: var(--ok); width: 15px; height: 15px; }

.mini-sheet__ready {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--ok);
  color: var(--off-white);
  font-size: 11px;
  font-weight: 600;
}

.mini-sheet__ready .icon { width: 12px; height: 12px; }

/* SPREADSHEET (base compartilhada) */
.spreadsheet {
  display: grid;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.spreadsheet-header,
.spreadsheet-row,
.spreadsheet-letters {
  display: grid;
  grid-template-columns: var(--cols);
}

.cell {
  position: relative;
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.45;
  transition: background-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

.cell:last-child { border-right: 0; }

.cell--num { text-align: right; }

.cell--mono { font-family: var(--font-mono); }

.spreadsheet-header .cell {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gray);
  background: var(--cream);
}

.spreadsheet-row .cell:hover {
  background: rgba(220, 192, 138, 0.14);
  box-shadow: inset 0 0 0 1px rgba(138, 106, 44, 0.35);
}

.cell.is-highlight { background: var(--gold-soft); }

.spreadsheet-letters span.is-hover,
.rownum.is-hover {
  background: rgba(220, 192, 138, 0.2);
  color: var(--dark);
}

.spreadsheet--mini {
  --cols: 6.4rem minmax(0, 1.15fr) minmax(0, 1fr) 3.6rem 7rem;
  font-size: 0.75rem;
}

.spreadsheet--mini .cell { padding: 8px 10px; }

.spreadsheet--mini .spreadsheet-header .cell { font-size: 0.625rem; letter-spacing: 0.05em; }

.spreadsheet--mini .spreadsheet-row.is-new .cell {
  font-weight: 600;
  background: rgba(220, 192, 138, 0.16);
}

.spreadsheet--mini .spreadsheet-row--sub .cell {
  color: var(--gray);
  font-size: 0.7rem;
}

.spreadsheet--mini .spreadsheet-row--sub .cell:first-child { padding-left: 22px; }

.spreadsheet--mini .cell--span { grid-column: span 2; }

.spreadsheet--mini .spreadsheet-row:last-child .cell { border-bottom: 0; }

.replay {
  position: absolute;
  top: 262px;
  right: 0;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 14px 6px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--glass-dark);
  color: var(--on-dark-muted);
  font-size: 0.8125rem;
  transition: color var(--t-fast) ease, border-color var(--t-fast) ease, transform var(--t-fast) var(--ease-out);
}

.replay:hover { color: var(--on-dark); border-color: var(--on-dark-faint); transform: translateY(-1px); }

.replay .icon { width: 15px; height: 15px; }

/* DOCUMENT → EXCEL */
.flow__track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 72px;
}

.flow__step { position: relative; min-width: 0; }

.flow-node {
  display: grid;
  gap: 14px;
}

.flow-node h3 { margin-top: 10px; }

.flow-node > p {
  color: var(--gray);
  font-size: 0.9688rem;
  max-width: 36ch;
}

.flow-node__card {
  position: relative;
  display: grid;
  align-content: start;
  height: 196px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--off-white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) ease;
}

.flow-node__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.flow-node__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--cream);
  color: var(--green);
}

.flow-node__icon .icon { width: 20px; height: 20px; }

.flow-node__label {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

.flow-node__value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.flow-node__meta {
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--gray);
}

.flow-node__card--active {
  border-color: transparent;
  background: linear-gradient(160deg, var(--green-light), var(--green) 60%);
  color: var(--on-dark);
  box-shadow: var(--shadow-lg);
}

.flow-node__card--active .flow-node__icon {
  border-color: var(--line-dark);
  background: rgba(244, 240, 228, 0.08);
  color: var(--gold);
}

.flow-node__card--active .flow-node__label,
.flow-node__card--active .flow-node__meta { color: var(--on-dark-muted); }

.flow-node__card--done .flow-node__value { color: var(--ok); }

.flow-node__card--done .flow-node__icon { color: var(--ok); background: var(--ok-soft); border-color: transparent; }

.check-pop { width: 26px; height: 26px; }

.flow__connector {
  position: absolute;
  top: 98px;
  left: 100%;
  width: 72px;
  height: 2px;
}

.flow__line {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, var(--green-light) 60%, transparent 0);
  background-size: 8px 2px;
  transform-origin: left center;
}

.flow__line::after {
  /* ponta da seta */
  content: "";
  position: absolute;
  right: -2px;
  top: -4px;
  border: 5px solid transparent;
  border-left: 7px solid var(--green-light);
  border-right: 0;
}

.flow__packet {
  position: absolute;
  top: -3px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  animation: packet-x 2.4s var(--ease-out) infinite;
}

.flow__step:nth-child(2) .flow__packet { animation-delay: 1.2s; }

/* Before / After */
.ba {
  --pos: 50%;
  position: relative;
  height: 440px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--cream-deep);
  box-shadow: var(--shadow-md);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.ba__pane {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 64px 32px 32px;
}

.ba__pane--before {
  background-color: var(--cream-deep);
  background-image:
    repeating-linear-gradient(-45deg, rgba(23, 32, 25, 0.025) 0 2px, transparent 2px 9px);
}

.ba__pane--after {
  background-color: var(--off-white);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  clip-path: inset(0 0 0 var(--pos));
}

.ba__label {
  position: absolute;
  top: 20px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--gray);
}

.ba__label span {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--dark);
  color: var(--off-white);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ba__label--after {
  left: auto;
  right: 22px;
  flex-direction: row-reverse;
}

.ba__label--after span { background: var(--green); }

.ba__art {
  position: relative;
  width: min(640px, 100%);
}

.scan-page {
  display: grid;
  gap: 0;
  padding: 22px 24px;
  border-radius: 4px;
  background: var(--off-white);
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(23, 32, 25, 0.78);
  box-shadow: var(--shadow-md);
  transform: rotate(-1.2deg);
  filter: contrast(0.92);
}

.scan-page__head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1.5px solid rgba(23, 32, 25, 0.6);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.scan-page__row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) 2.5rem 4.5rem;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dotted rgba(23, 32, 25, 0.25);
}

.scan-page__row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.scan-page__row span:nth-child(n+3) { text-align: right; }

.scan-page__row:nth-child(odd) span:nth-child(2) { transform: translateX(1px) skewX(-1deg); }

.scan-page__row--marked {
  background: linear-gradient(transparent 20%, rgba(220, 192, 138, 0.55) 20%, rgba(220, 192, 138, 0.55) 80%, transparent 80%);
}

.scan-page__row--faded { opacity: 0.45; filter: blur(0.6px); }

.scan-page__typing {
  margin-top: 12px;
  font-size: 11px;
  color: var(--gray);
}

.caret {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 4px;
  vertical-align: -2px;
  background: var(--dark);
  animation: blink 1s steps(2) infinite;
}

.sticky-note {
  position: absolute;
  right: -18px;
  bottom: -26px;
  padding: 12px 14px;
  background: var(--gold-light);
  color: var(--dark);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.3;
  box-shadow: var(--shadow-md);
  transform: rotate(3deg);
}

.ba-sheet {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--off-white);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-md);
}

.ba-sheet__row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) 3.6rem 5.5rem;
  border-bottom: 1px solid var(--border);
}

.ba-sheet__row:last-child { border-bottom: 0; }

.ba-sheet__row span {
  padding: 8px 12px;
  border-right: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ba-sheet__row span:last-child { border-right: 0; }

.ba-sheet__row span:first-child { font-family: var(--font-mono); font-size: 0.95em; }

.ba-sheet__row span:nth-child(n+3) { text-align: right; }

.ba-sheet__row--head span {
  background: var(--cream);
  font-family: var(--font-body) !important;
  font-size: 0.6875rem !important;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gray);
}

.ba-sheet__row--sum span {
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 600;
}

.ok-note {
  position: absolute;
  right: 16px;
  bottom: -44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: var(--ok);
  color: var(--off-white);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.ba__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 48px;
  margin-left: -24px;
  cursor: ew-resize;
  transform: translateX(var(--pos-px, 0px));
  outline: none;
}

.ba:not(.is-ready) .ba__handle {
  left: 50%;
  transform: none;
}

.ba__handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--green);
}

.ba__knob {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--off-white);
  border-radius: 50%;
  background: var(--green);
  color: var(--gold);
  box-shadow: var(--shadow-md);
  transition: transform var(--t-fast) var(--ease-out);
}

.ba__knob .icon { width: 22px; height: 22px; }

.ba__handle:hover .ba__knob,
.ba.is-dragging .ba__knob { transform: scale(1.08); }

.ba__handle:focus-visible .ba__knob {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.ba-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 64px;
  margin-top: 36px;
}

.ba-legend__col {
  display: grid;
  gap: 12px;
  align-content: start;
}

.ba-legend__col h3 {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

.ba-legend__col ul { display: grid; gap: 8px; }

.ba-legend__col li {
  position: relative;
  padding-left: 22px;
  color: var(--gray);
}

.ba-legend__col li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.7em;
  width: 10px;
  height: 1.5px;
  background: var(--border-strong);
}

.ba-legend__col--after h3 { color: var(--green); }

.ba-legend__col--after li { color: var(--dark); }

.ba-legend__col--after li::before {
  top: 0.45em;
  width: 10px;
  height: 6px;
  background: none;
  border-left: 1.8px solid var(--ok);
  border-bottom: 1.8px solid var(--ok);
  transform: rotate(-45deg);
}

/* FEATURES */
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
  padding: 14px 14px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--off-white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) ease, border-color var(--t-med) ease;
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.feature--wide { grid-column: span 2; }

.feature--wide:last-child {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  padding: 14px 32px 14px 14px;
  gap: 32px;
}

.feature__visual {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 156px;
  padding: 20px;
  border-radius: var(--radius-md);
  background-color: var(--cream);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 20px 20px;
}

.feature__body {
  display: grid;
  gap: 8px;
  align-content: start;
  padding-inline: 12px;
}

.feature__body h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature__body h3 .icon { width: 18px; height: 18px; color: var(--green-light); }

.feature__body p { color: var(--gray); font-size: 0.9688rem; }

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 360px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--off-white);
  font-family: var(--font-mono);
  font-size: 12px;
}

.status-line .dot { order: 2; }

.status-line--off { color: var(--gray); text-decoration: line-through; text-decoration-color: rgba(115, 120, 111, 0.6); }

.status-line--off .dot { background: var(--gray); box-shadow: none; opacity: 0.5; }

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-row li {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--off-white);
  font-size: 0.8125rem;
  font-weight: 500;
}

.pill-row li:first-child { background: var(--green); color: var(--on-dark); border-color: transparent; }

.stack-list { display: grid; gap: 6px; }

.stack-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--off-white);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.stack-list li:nth-child(2) { margin-left: 10px; }
.stack-list li:nth-child(3) { margin-left: 20px; }

.stack-list li span:last-child { color: var(--gray); }

.kv {
  display: grid;
  gap: 6px;
}

.kv div {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--off-white);
}

.kv dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray);
}

.kv dd {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(163, 98, 27, 0.28);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  background: var(--off-white);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--dark);
}

.alert-chip .icon { width: 18px; height: 18px; color: var(--warn); margin-top: 1px; }

.alert-chip strong { display: block; font-weight: 600; color: var(--warn); }

.fake-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--off-white);
  font-size: 0.8125rem;
  color: var(--gray);
}

.history { display: grid; gap: 6px; }

.history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--off-white);
  font-family: var(--font-mono);
  font-size: 12px;
}

.history li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* CONFERÊNCIA */
.review { background: linear-gradient(180deg, transparent, rgba(234, 228, 211, 0.55) 30%, rgba(234, 228, 211, 0.55) 70%, transparent); }

.review__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.review__copy {
  display: grid;
  gap: 20px;
  align-content: start;
}

.review__copy h2 { max-width: 16ch; }

.checklist { display: grid; gap: 12px; margin-top: 6px; }

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.checklist .icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--green);
  color: var(--gold);
}

.review__hint {
  margin-top: 8px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--green-light);
}

.review-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--off-white);
  box-shadow: var(--shadow-lg);
}

.review-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}

.review-card__kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

.review-card__head h3 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.confidence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ok);
}

.confidence__ring svg { width: 32px; height: 32px; transform: rotate(-90deg); }

.confidence__ring circle {
  fill: none;
  stroke: var(--ok-soft);
  stroke-width: 4;
}

.confidence__ring .confidence__value {
  stroke: var(--ok);
  stroke-linecap: round;
  stroke-dasharray: 98 100;
}

.review-card__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.review-card__stats div {
  display: grid;
  gap: 2px;
  padding: 12px 24px;
  border-right: 1px solid var(--border);
}

.review-card__stats div:last-child { border-right: 0; }

.review-card__stats dt {
  order: 2;
  font-size: 0.75rem;
  color: var(--gray);
}

.review-card__stats dd {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.review-card__stats .is-pending dd { color: var(--gold-ink); }

.review-card__stats .is-warn dd { color: var(--warn); }

.review-list { display: grid; }

.review-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px 4.25rem minmax(0, 1fr) auto 4.5rem;
  align-items: center;
  gap: 14px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color var(--t-fast) ease;
}

.review-item:hover { background: rgba(220, 192, 138, 0.1); }

.review-item input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.review-item__box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--off-white);
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease;
}

.review-item__box .icon {
  width: 14px;
  height: 14px;
  color: var(--off-white);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--t-fast) ease, transform var(--t-med) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.review-item input:checked ~ .review-item__box {
  border-color: var(--green);
  background: var(--green);
}

.review-item input:checked ~ .review-item__box .icon {
  opacity: 1;
  transform: scale(1);
}

.review-item input:focus-visible ~ .review-item__box {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.review-item:has(input:checked) { background: var(--ok-soft); }

.review-item__code { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--gray); }

.review-item__desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.review-item__qty { font-size: 0.8125rem; color: var(--gray); white-space: nowrap; }

.review-item__total { text-align: right; font-weight: 600; }

.review-item.is-diverg { box-shadow: inset 3px 0 0 var(--warn); }

.flag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.6875rem;
  font-style: normal;
  font-weight: 600;
  vertical-align: 1px;
}

.review-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 24px;
  background: var(--cream);
}

.review-card__sum { font-size: 0.875rem; color: var(--gray); }

.review-card__sum strong {
  margin-left: 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--dark);
}

.review-card__actions { display: flex; gap: 8px; }

.review-card__toast {
  position: absolute;
  left: 50%;
  bottom: 76px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--dark);
  color: var(--off-white);
  font-size: 0.8125rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity var(--t-med) ease, transform var(--t-med) var(--ease-out);
}

.review-card__toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* SPREADSHEET */
.workbook {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--off-white);
  box-shadow: var(--shadow-lg);
}

.workbook__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--green);
  color: var(--on-dark);
}

.workbook__file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbook__file .icon { color: var(--gold); width: 18px; height: 18px; }

.workbook__saved {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--on-dark-muted);
  white-space: nowrap;
}

.workbook__saved .dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(220, 192, 138, 0.2); }

.workbook__formula {
  display: grid;
  grid-template-columns: 4.5rem auto minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--border-strong);
  background: var(--off-white);
  font-size: 0.8125rem;
}

.workbook__ref {
  padding: 9px 12px;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: center;
}

.workbook__fx {
  padding: 9px 14px;
  border-right: 1px solid var(--border);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  line-height: 1;
  color: var(--gray);
}

.workbook__value {
  display: block;
  padding: 9px 14px;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.spreadsheet--full {
  min-width: max-content;
  width: 100%;
  font-size: 0.875rem;
}

.spreadsheet--pedidos {
  --cols: 2.75rem minmax(7rem, 0.9fr) minmax(9.5rem, 1.4fr) minmax(9.5rem, 1.4fr) minmax(6.5rem, 0.8fr) minmax(4rem, 0.5fr) minmax(8rem, 1fr) minmax(8.5rem, 0.9fr);
}

.spreadsheet--itens {
  --cols: 2.75rem minmax(4rem, 0.5fr) minmax(5.5rem, 0.7fr) minmax(14rem, 2.2fr) minmax(3rem, 0.4fr) minmax(4rem, 0.5fr) minmax(5.5rem, 0.7fr) minmax(6.5rem, 0.8fr);
}

.spreadsheet--linhas {
  --cols: 2.75rem minmax(7rem, 0.9fr) minmax(4rem, 0.5fr) minmax(4rem, 0.5fr) minmax(22rem, 3fr);
}

.spreadsheet--validacao {
  --cols: 2.75rem minmax(7rem, 0.9fr) minmax(8rem, 1fr) minmax(8.5rem, 1fr) minmax(6rem, 0.8fr) minmax(9rem, 1fr);
}

.spreadsheet--metadados {
  --cols: 2.75rem minmax(12rem, 1.6fr) minmax(4.5rem, 0.5fr) minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(6rem, 0.7fr);
}

.spreadsheet-letters span {
  padding: 4px 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--cream-deep);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-align: center;
  color: var(--gray);
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}

.spreadsheet-letters span:last-child { border-right: 0; }

.spreadsheet-letters span.is-active,
.rownum.is-active {
  background: var(--gold-soft);
  color: var(--dark);
}

.rownum {
  position: sticky;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--cream-deep);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--gray);
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}

.spreadsheet--full .cell { padding: 11px 14px; }

.spreadsheet--full .spreadsheet-header .cell { padding-block: 9px; }

.spreadsheet--full .spreadsheet-row .cell { cursor: cell; outline: none; }

.spreadsheet--full .cell[aria-selected="true"] {
  z-index: 2;
  background: rgba(220, 192, 138, 0.16);
  box-shadow: inset 0 0 0 2px var(--green);
}

.spreadsheet--full .cell[aria-selected="true"]::after {
  /* alça de preenchimento, como no Excel */
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--off-white);
  background: var(--green);
}

.spreadsheet--full .cell:focus-visible { box-shadow: inset 0 0 0 2px var(--green), 0 0 0 2px var(--gold); }

.spreadsheet-row:last-child .cell,
.spreadsheet-row:last-child .rownum { border-bottom: 0; }

.spreadsheet-row--total .cell {
  font-weight: 600;
  background: var(--cream);
}

.spreadsheet-row--total .cell[data-formula] { color: var(--green); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status .icon { width: 13px; height: 13px; }

.status--ok { background: var(--ok-soft); color: var(--ok); }

.status--warn { background: var(--warn-soft); color: var(--warn); }

.status--pending {
  padding-left: 10px;
  background: rgba(23, 32, 25, 0.06);
  color: var(--gray);
}

.workbook__tabs {
  display: flex;
  gap: 2px;
  padding: 0 10px;
  overflow-x: auto;
  border-top: 1px solid var(--border-strong);
  background: var(--cream-deep);
  scrollbar-width: none;
}

.workbook__tabs::-webkit-scrollbar { display: none; }

.workbook__tab {
  position: relative;
  flex-shrink: 0;
  min-height: 42px;
  padding: 10px 18px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray);
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}

.workbook__tab:hover { color: var(--dark); background: rgba(250, 250, 246, 0.6); }

.workbook__tab[aria-selected="true"] {
  background: var(--off-white);
  color: var(--green);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--green), 1px 0 0 var(--border), -1px 0 0 var(--border);
}

/* FATURAS DE CARTÃO */
.fatura-panel {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: clamp(32px, 4vw, 56px);
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  color: var(--on-dark);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(31, 90, 63, 0.85) 0%, transparent 55%),
    radial-gradient(70% 60% at 100% 100%, rgba(220, 192, 138, 0.1) 0%, transparent 60%),
    linear-gradient(200deg, var(--green) 0%, var(--green-deep) 100%);
  box-shadow: var(--shadow-lg);
}

.fatura-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-dark) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: linear-gradient(300deg, transparent 10%, #000 70%);
  mask-image: linear-gradient(300deg, transparent 10%, #000 70%);
}

.fatura-panel__copy {
  display: grid;
  gap: 22px;
  justify-items: start;
  min-width: 0;
}

.fatura-panel__title {
  font-size: clamp(2.05rem, 1.3rem + 2.3vw, 3.05rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.fatura-panel__title em {
  display: block;
  color: var(--gold);
}

.fatura-panel__lead {
  max-width: 44ch;
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--on-dark-muted);
}

.fatura-panel__list { margin-top: 2px; }

.fatura-panel__list li { color: var(--on-dark-muted); }

.fatura-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Palco da fatura: grade estável (doc | leitura + separação / planilha) */
.fatura-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: 20px;
  align-content: start;
  min-width: 0;
}

.fatura-stage .doc {
  position: relative;
  top: auto;
  left: auto;
  align-self: start;
  width: 100%;
  max-width: none;
  transform: rotate(-1.2deg);
}

.fatura-side {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.fatura-stage .process {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
}

.fatura-stage .mini-sheet {
  position: relative;
  right: auto;
  bottom: auto;
  grid-column: 1 / -1;
  width: 100%;
}

.fatura-stage .replay {
  position: static;
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: -4px;
  color: var(--on-dark-muted);
}

/* Cestos de separação */
.fatura-bins {
  display: grid;
  gap: 10px;
}

.fatura-bin {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.fatura-bin__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: rgba(244, 240, 228, 0.06);
  color: var(--gold);
}

.fatura-bin__icon .icon { width: 18px; height: 18px; }

.fatura-bin__text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.fatura-bin__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--on-dark);
}

.fatura-bin__meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--on-dark-faint);
}

.fatura-bin__value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--on-dark);
  font-variant-numeric: tabular-nums;
}

/* Planilha dos totais por cartão */
.spreadsheet--fatura {
  --cols: minmax(7rem, 1.2fr) repeat(4, minmax(5rem, 1fr));
  font-size: 0.75rem;
}

.spreadsheet--fatura .cell { padding: 9px 10px; }

.spreadsheet--fatura .spreadsheet-header .cell {
  font-size: 0.625rem;
  letter-spacing: 0.05em;
}

.spreadsheet--fatura .spreadsheet-row:last-child .cell { border-bottom: 0; }

.spreadsheet--fatura .spreadsheet-row--total .cell { background: var(--cream); }

/* INTEGRAÇÃO PROTHEUS */
.erp-section { padding-top: calc(var(--section-y) * 0.5); }

.erp__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.erp__copy {
  display: grid;
  gap: 20px;
  align-content: start;
}

.erp__copy h2 { max-width: 15ch; }

.erp__copy h2 em {
  color: var(--green-light);
  font-style: italic;
}

.erp {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--on-dark);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(31, 90, 63, 0.9) 0%, transparent 60%),
    linear-gradient(165deg, var(--green) 0%, var(--green-deep) 100%);
  box-shadow: var(--shadow-lg);
}

.erp::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-dark) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%);
  mask-image: linear-gradient(180deg, transparent, #000 45%);
}

.erp__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-dark);
}

.erp__kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
}

.erp__head h3 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--on-dark);
}

.erp__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(244, 240, 228, 0.06);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.erp__status .dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(220, 192, 138, 0.2);
}

/* Diagrama Extrator → Protheus */
.erp__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line-dark);
}

.erp__node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: rgba(244, 240, 228, 0.06);
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--on-dark);
}

.erp__node .icon { width: 15px; height: 15px; color: var(--gold); }

.erp__node--erp {
  border-color: transparent;
  background: var(--gold);
  color: var(--dark);
  font-weight: 500;
}

.erp__node--erp .icon { color: var(--dark); }

.erp__wire {
  position: relative;
  flex: 1;
  min-width: 40px;
  height: 2px;
  background-image: linear-gradient(90deg, rgba(244, 240, 228, 0.35) 60%, transparent 0);
  background-size: 8px 2px;
}

.erp__packet {
  position: absolute;
  top: -3px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  animation: packet-run 2.6s linear infinite;
}

/* Configuração da API */
.erp__config {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-dark);
}

.erp__config div {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
  padding: 14px 24px;
  border-right: 1px solid var(--line-dark);
}

.erp__config div:last-child { border-right: 0; }

.erp__config dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
}

.erp__config dd {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--on-dark);
}

/* Importação */
.erp__sync,
.erp__orders {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line-dark);
}

.erp__label {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
}

.erp__sync ul { display: grid; gap: 12px; }

.erp__sync li {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  font-size: 0.8125rem;
}

.erp__bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(244, 240, 228, 0.12);
}

.erp__bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  transform-origin: left center;
}

.erp__sync-count {
  min-width: 3.75rem;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* Pedidos */
.erp__orders ul { display: grid; gap: 8px; }

.erp__order {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: rgba(244, 240, 228, 0.04);
  font-size: 0.8125rem;
  transition: border-color var(--t-med) ease, background-color var(--t-med) ease;
}

.erp__order[data-status="sent"] {
  border-color: rgba(220, 192, 138, 0.45);
  background: rgba(220, 192, 138, 0.08);
}

.erp__order-id {
  font-family: var(--font-mono);
  font-weight: 500;
}

.erp__order-total {
  justify-self: end;
  font-family: var(--font-mono);
  color: var(--on-dark-muted);
  font-variant-numeric: tabular-nums;
}

.erp .status--ok {
  background: rgba(126, 217, 162, 0.14);
  color: #8FE3B4;
}

.erp .status--warn {
  background: rgba(232, 211, 166, 0.14);
  color: var(--gold-light);
}

.erp .status--pending {
  background: rgba(244, 240, 228, 0.1);
  color: var(--on-dark-muted);
}

/* Rodapé do console */
.erp__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 24px;
  background: rgba(12, 43, 30, 0.55);
}

.erp__note {
  max-width: 32ch;
  font-size: 0.8125rem;
  color: var(--on-dark-faint);
}

.erp__toast {
  position: absolute;
  left: 50%;
  bottom: 78px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--off-white);
  color: var(--dark);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity var(--t-med) ease, transform var(--t-med) var(--ease-out);
}

.erp__toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.erp__toast .icon { color: var(--ok); }

/* Animação do pacote na integração */
@keyframes packet-run {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: calc(100% - 8px); opacity: 0; }
}

/* CTA */
.cta { padding-block: 0 var(--section-y); }

.cta__panel {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  padding: clamp(32px, 6vw, 80px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: var(--on-dark);
  background:
    radial-gradient(80% 120% at 100% 100%, rgba(31, 90, 63, 0.9), transparent 60%),
    linear-gradient(160deg, var(--green), var(--green-deep));
  box-shadow: var(--shadow-lg);
}

.cta__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-dark) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

.cta__copy { display: grid; gap: 22px; justify-items: start; }

.cta__copy h2 { max-width: 18ch; }

.cta__copy h2 em { color: var(--gold); }

.cta__copy p { max-width: 46ch; color: var(--on-dark-muted); font-size: var(--fs-md); }

.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.cta__drop {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 28px;
  border: 1.5px dashed rgba(220, 192, 138, 0.5);
  border-radius: var(--radius-lg);
  background: rgba(244, 240, 228, 0.03);
  text-align: center;
}

.cta__drop-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  background: rgba(244, 240, 228, 0.06);
  color: var(--gold);
}

.cta__drop-icon .icon { width: 24px; height: 24px; transform: rotate(180deg); }

.cta__drop-title { font-family: var(--font-display); font-size: 1.5rem; }

.cta__drop-sub { font-size: 0.875rem; color: var(--on-dark-faint); }

/* FOOTER */
.site-footer {
  padding-block: 48px calc(40px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--off-white);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 48px;
  align-items: start;
}

.site-footer__brand { display: grid; gap: 14px; }

.site-footer__local {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--gray);
}

.site-footer__local .icon { color: var(--ok); width: 16px; height: 16px; }

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  justify-content: flex-end;
}

.site-footer__nav a {
  display: inline-block;
  padding-block: 6px;
  font-size: 0.875rem;
  color: var(--dark);
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1.5px;
  transition: background-size var(--t-med) var(--ease-out);
}

.site-footer__nav a:hover { background-size: 100% 1.5px; }

.site-footer__legal {
  grid-column: 1 / -1;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--gray);
}

/* VOLTAR AO TOPO */
.back-to-top {
  position: fixed;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: var(--green);
  color: var(--on-dark);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity var(--t-med) var(--ease-out),
    transform var(--t-med) var(--ease-out),
    background-color var(--t-fast) ease,
    visibility var(--t-med);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover { background: var(--green-light); }

.back-to-top .icon {
  width: 20px;
  height: 20px;
  transform: rotate(-90deg);
}

/* ANIMATIONS */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes packet-x {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(60px); opacity: 0; }
}

@keyframes packet-y {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(40px); opacity: 0; }
}

@keyframes cell-flash {
  0% { background-color: rgba(220, 192, 138, 0.55); }
  100% { background-color: transparent; }
}

.cell.is-flash { animation: cell-flash 900ms ease-out; }

/* RESPONSIVE */
@media (max-width: 1100px) {
  /* Links extras no menu: esconde o CTA da nav para não apertar os itens */
  .nav__cta { display: none; }

  .nav__links a:not(.btn) {
    padding: 8px 10px;
    font-size: 0.8125rem;
  }
}

@media (max-width: 1180px) {
  .hero__panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .hero__copy { max-width: 640px; }

  .hero__stage {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
  }

  .fatura-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .fatura-panel__copy { max-width: 660px; }

  .fatura-stage {
    width: 100%;
    max-width: 700px;
    margin-inline: auto;
  }
}

@media (max-width: 1024px) {
  :root { --header-h: 64px; }

  .section-head--split { grid-template-columns: minmax(0, 1fr); }

  .flow__track { gap: 48px; }

  .flow__connector { width: 48px; }

  @keyframes packet-x {
    0% { transform: translateX(0); opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateX(38px); opacity: 0; }
  }

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

  .feature--wide { grid-column: 1 / -1; }

  .review__grid { grid-template-columns: minmax(0, 1fr); }

  .review__copy h2 { max-width: 20ch; }

  .erp__grid { grid-template-columns: minmax(0, 1fr); }

  .erp__copy h2 { max-width: 20ch; }

  .cta__panel { grid-template-columns: minmax(0, 1fr); }

  .cta__drop { justify-self: stretch; }
}

@media (max-width: 900px) {
  .nav__cta { display: none; }

  .nav__toggle { display: grid; }

  .nav__links {
    position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 49;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px max(var(--gutter), env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
    background: var(--off-white);
    border-top: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--t-med) ease, transform var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
  }

  .site-header.is-open .nav__links {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--t-med) ease, transform var(--t-med) var(--ease-out), visibility 0s;
  }

  .site-header.is-open {
    background: var(--off-white);
    box-shadow: 0 1px 0 var(--border);
  }

  .nav__links li { border-bottom: 1px solid var(--border); }

  .nav__links a:not(.btn) {
    display: block;
    padding: 18px 4px;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    border-radius: 0;
  }

  .nav__links a:not(.btn):hover { background: none; color: var(--green-light); }

  .nav__links a.is-active::after { display: none; }

  .nav__menu-cta {
    display: block;
    margin-top: 24px;
    border-bottom: 0 !important;
  }

  .nav__menu-cta .btn { width: 100%; min-height: 54px; font-size: var(--fs-base); }

  body.menu-open { overflow: hidden; }
}

@media (max-width: 767px) {
  :root {
    --radius-xl: 24px;
    --radius-lg: 18px;
  }

  .hero { padding-top: 4px; }

  .hero__panel {
    padding: 28px 20px 24px;
    gap: 40px;
  }

  .hero__copy { gap: 22px; }

  .hero__actions { width: 100%; }

  .hero__actions .btn { flex: 1 1 100%; }

  /* Palco vertical: PDF → processamento → planilha */
  .hero__stage {
    height: auto;
    display: grid;
    gap: 40px;
    justify-items: center;
  }

  .doc,
  .process,
  .mini-sheet {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 420px;
  }

  .doc { transform: rotate(-1deg); padding: 18px 16px 14px; }

  .process::before,
  .mini-sheet::before {
    content: "";
    position: absolute;
    top: -33px;
    left: 50%;
    width: 2px;
    height: 26px;
    margin-left: -1px;
    background-image: linear-gradient(180deg, var(--gold) 60%, transparent 0);
    background-size: 2px 7px;
  }

  .mini-sheet { overflow: visible; }

  .mini-sheet::before { top: -33px; }

  .mini-sheet > .spreadsheet,
  .mini-sheet > .mini-sheet__bar { border-radius: inherit; }

  .mini-sheet__bar { border-radius: var(--radius-md) var(--radius-md) 0 0; }

  .spreadsheet--mini {
    --cols: 5.4rem minmax(0, 1fr) 2.9rem 6.6rem;
    overflow: hidden;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }

  /* No celular a planilha do hero esconde a coluna Fornecedor */
  .spreadsheet--mini .spreadsheet-header .cell:nth-child(3),
  .spreadsheet--mini .spreadsheet-row.is-new .cell:nth-child(3) { display: none; }

  .spreadsheet--mini .cell--span { grid-column: span 1; }

  .spreadsheet--mini .cell { padding-inline: 7px; }

  .spreadsheet--mini .spreadsheet-row--sub .cell:first-child { padding-left: 12px; }

  .replay {
    position: static;
    justify-self: center;
    margin-top: -16px;
  }

  /* Fluxo vertical */
  .flow__track {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }

  .flow-node__card { height: auto; min-height: 172px; }

  .flow__connector {
    top: 100%;
    left: 44px;
    width: 2px;
    height: 56px;
  }

  .flow__line {
    background-image: linear-gradient(180deg, var(--green-light) 60%, transparent 0);
    background-size: 2px 8px;
    transform-origin: center top;
  }

  .flow__line::after {
    right: auto;
    left: -4px;
    top: auto;
    bottom: -2px;
    border: 5px solid transparent;
    border-top: 7px solid var(--green-light);
    border-bottom: 0;
  }

  .flow__packet {
    left: -3px;
    top: 0;
    animation-name: packet-y;
  }

  /* Antes / depois */
  .ba { height: 420px; }

  .ba__pane { padding: 64px 16px 40px; }

  .ba__label { top: 16px; left: 14px; font-size: 0; gap: 0; }
  .ba__label--after { left: auto; right: 14px; }

  .scan-page { padding: 16px 14px; font-size: 10.5px; }

  .scan-page__row { grid-template-columns: 3.4rem minmax(0, 1fr) 1.6rem 3.6rem; gap: 6px; }

  .ba-sheet { font-size: 0.75rem; }

  .ba-sheet__row { grid-template-columns: 3.9rem minmax(0, 1fr) 2.6rem 5rem; }

  .ba-sheet__row span { padding: 7px 6px; }

  .ba-sheet__row--head span { letter-spacing: 0.02em; }

  .sticky-note { right: -4px; bottom: -30px; font-size: 0.875rem; }

  .ok-note { right: 8px; bottom: -40px; font-size: 0.75rem; }

  .ba-legend { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  /* Recursos */
  .features__grid { grid-template-columns: minmax(0, 1fr); }

  .feature--wide { grid-column: auto; }

  .feature--wide:last-child {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 14px 26px;
    gap: 22px;
  }

  /* Conferência */
  .review-card__head { padding: 18px 18px 14px; }

  .review-card__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .review-card__stats div { padding: 10px 18px; }

  .review-card__stats div:nth-child(2) { border-right: 0; }

  .review-card__stats div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }

  .review-item {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    grid-template-areas:
      "box code total"
      "box desc desc"
      "box qty qty";
    gap: 2px 14px;
    padding: 12px 18px;
  }

  .review-item__box { grid-area: box; align-self: start; margin-top: 2px; }
  .review-item__code { grid-area: code; }
  .review-item__desc { grid-area: desc; white-space: normal; }
  .review-item__qty { grid-area: qty; }
  .review-item__total { grid-area: total; }

  .review-card__foot { padding: 16px 18px; }

  .review-card__actions { width: 100%; }

  .review-card__actions .btn { flex: 1; }

  .review-card__toast { bottom: 130px; }

  /* Faturas */
  .fatura-panel { padding: 28px 20px 24px; gap: 40px; }

  .fatura-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .fatura-stage .doc { max-width: 420px; margin-inline: auto; }

  .fatura-stage .replay { margin-top: -12px; }

  .fatura-bin { padding: 10px 12px; gap: 10px; }

  .fatura-bin__icon { width: 32px; height: 32px; }

  .fatura-bin__value { font-size: 1rem; }

  /* A planilha da fatura vira cards */
  .spreadsheet--fatura {
    gap: 12px;
    padding: 14px;
    background: var(--cream);
  }

  .spreadsheet--fatura .spreadsheet-header { display: none; }

  .spreadsheet--fatura .spreadsheet-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--off-white);
  }

  .spreadsheet--fatura .cell {
    display: grid;
    gap: 2px;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow: visible;
    text-align: left;
    font-size: 0.9375rem;
  }

  .spreadsheet--fatura .cell::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray);
  }

  .spreadsheet--fatura .cell--title {
    grid-column: 1 / -1;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
  }

  .spreadsheet--fatura .spreadsheet-row--total {
    background: var(--green);
    color: var(--on-dark);
    border-color: transparent;
  }

  .spreadsheet--fatura .spreadsheet-row--total .cell::before { color: var(--on-dark-faint); }

  .spreadsheet--fatura .spreadsheet-row--total .cell--title {
    border-color: var(--line-dark);
  }

  .spreadsheet--fatura .spreadsheet-row--total .cell[data-formula] { color: var(--gold); }

  /* Integração */
  .erp__head { padding: 18px 18px 14px; }

  .erp__link { padding: 14px 18px; gap: 10px; }

  .erp__config { grid-template-columns: minmax(0, 1fr); }

  .erp__config div {
    padding: 12px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }

  .erp__config div:last-child { border-bottom: 0; }

  .erp__sync,
  .erp__orders { padding: 16px 18px; }

  .erp__sync li { grid-template-columns: 4.75rem minmax(0, 1fr) auto; gap: 10px; }

  .erp__order {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 12px;
  }

  .erp__order .status {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 2px;
  }

  .erp__foot { padding: 16px 18px; }

  .erp__foot .btn { width: 100%; }

  .erp__note { max-width: none; }

  .erp__toast { bottom: 120px; max-width: calc(100% - 32px); white-space: normal; text-align: center; }

  /* Planilha vira cards */
  .workbook__formula { grid-template-columns: 3.5rem auto minmax(0, 1fr); }

  .sheet-scroll { overflow: visible; }

  .spreadsheet--full {
    min-width: 0;
    gap: 12px;
    padding: 14px;
    background: var(--cream);
  }

  .spreadsheet--full .spreadsheet-letters,
  .spreadsheet--full .spreadsheet-header,
  .spreadsheet--full .rownum { display: none; }

  .spreadsheet--full .spreadsheet-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--off-white);
    box-shadow: var(--shadow-sm);
  }

  .spreadsheet--full .cell {
    display: grid;
    gap: 2px;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow: visible;
    align-content: start;
    text-align: left;
    font-size: 0.9375rem;
  }

  .spreadsheet--full .cell::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray);
  }

  .spreadsheet--full .cell--title {
    grid-column: 1 / -1;
    display: block;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .spreadsheet--full .cell--title::before {
    content: attr(data-label) " ";
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    color: var(--dark);
  }

  .spreadsheet--pedidos .cell--title::before { content: ""; }

  .spreadsheet--metadados .cell--title::before { content: ""; }

  .spreadsheet--full .cell--status,
  .spreadsheet--full .cell--wide { grid-column: 1 / -1; }

  .spreadsheet--full .cell--status::before { display: none; }

  .spreadsheet--full .cell--status .status {
    justify-self: start;
    padding: 6px 14px 6px 10px;
    font-size: 0.8125rem;
  }

  .spreadsheet--full .cell--empty { display: none; }

  .spreadsheet--full .cell[aria-selected="true"] {
    box-shadow: 0 0 0 2px var(--green);
    border-radius: 4px;
  }

  .spreadsheet--full .cell[aria-selected="true"]::after { display: none; }

  .spreadsheet--full .cell:hover { box-shadow: none; background: none; }

  .spreadsheet--full .spreadsheet-row--total {
    background: var(--green);
    color: var(--on-dark);
    border-color: transparent;
  }

  .spreadsheet--full .spreadsheet-row--total .cell { background: none; }

  .spreadsheet--full .spreadsheet-row--total .cell::before { color: var(--on-dark-faint); }

  .spreadsheet--full .spreadsheet-row--total .cell--title { border-color: var(--line-dark); }

  .spreadsheet--full .spreadsheet-row--total .cell--title::before { content: ""; }

  .spreadsheet--full .spreadsheet-row--total .cell[data-formula] { color: var(--gold); }

  /* CTA + footer */
  .cta__panel { padding: 32px 22px; }

  .cta__actions .btn { flex: 1 1 100%; }

  .cta__drop { padding: 32px 20px; }

  .site-footer__inner { grid-template-columns: minmax(0, 1fr); }

  .site-footer__nav ul { justify-content: flex-start; }
}

@media (max-width: 480px) {
  :root { --gutter: 16px; }

  .brand__logo { height: 38px; }

  .hero__panel { padding: 24px 18px 22px; margin-inline: -4px; }

  .badge { font-size: 10.5px; letter-spacing: 0.06em; }

  .hero__lead { font-size: var(--fs-base); }

  .doc { padding: 16px 12px 12px; font-size: 10px; }

  .doc__number { font-size: 1.15rem; }

  .doc__field--row { grid-template-columns: repeat(3, auto); }

  .doc__table td:nth-child(3),
  .doc__table th:nth-child(3) { display: none; }

  .process { padding: 14px 16px; }

  .process__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  .process__steps li { font-size: 0.75rem; gap: 8px; }

  .ba { height: 400px; }

  .ba-sheet__row { grid-template-columns: 3.4rem minmax(0, 1fr) 2.4rem 4.9rem; }

  .scan-page__row { grid-template-columns: 3rem minmax(0, 1fr) 1.6rem 3.4rem; }

  .review-card__head h3 { font-size: 1.25rem; }

  .fatura-panel__actions { width: 100%; }

  .fatura-panel__actions .btn { flex: 1 1 100%; }

  .fatura-bin__meta { font-size: 10px; }

  .confidence__ring { display: none; }

  .workbook__saved { display: none; }

  .workbook__tab { padding: 10px 14px; }

  .spreadsheet--full { padding: 10px; }

  .spreadsheet--full .spreadsheet-row { padding: 16px; gap: 12px; }
}

/* ACCESSIBILITY */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: var(--on-dark);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--t-fast) ease;
}

.skip-link:focus { transform: none; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.hero :focus-visible,
.cta :focus-visible,
.faturas :focus-visible,
.erp :focus-visible { outline-color: var(--gold); }

html { scroll-padding-top: calc(var(--header-h) + 16px); }

html:not(.lenis) { scroll-behavior: smooth; }

html.lenis, html.lenis body { height: auto; }

.lenis.lenis-stopped { overflow: hidden; }

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .flow__packet,
  .caret { animation: none !important; }

  .flow__packet { display: none; }

  .btn:hover,
  .feature:hover,
  .flow-node__card:hover { transform: none; }
}
