/* MyPDF — parâmetros de layout em docs/layout.md
   Estrutura (grid, espaçamento, escala tipográfica) replica a referência;
   marca, cor primária, ícones e fonte são nossos. */

:root {
  /* marca — trocar aqui muda o CTA, botões, links e estados ativos */
  --brand: #d7263d;
  --brand-dark: #ab1b2e;
  --brand-soft: #fdeaed;

  /* superfícies e texto */
  --surface: #ffffff;
  --bg: #f5f5fa;
  --border: #d6d6df;
  --text: #33333b;
  --text-2: #47474f;
  --text-muted: #707078;
  --text-strong: #161616;
  --ink: #292931;

  /* estados */
  --success: #4acd86;
  --info: #008ee9;
  --warning: #d76c00;
  --danger: #bd060a;

  --header-h: 60px;

  color-scheme: light;
}

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

/* Estilo de autor vence a folha do navegador, então qualquer regra com
   `display` (ex.: .dynamic-fields{display:flex}) anularia o atributo
   [hidden] que o JS usa para alternar seções. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

/* ---------------------------------------------------------------- header */

.header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1041;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
  text-decoration: none;
}

.header__brand__name {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.header__brand__name strong {
  font-weight: 700;
  color: var(--brand);
}

.header__brand__tld {
  font-weight: 400;
  color: var(--text-muted);
}

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

.header__user {
  font-size: 14px;
  color: var(--text-muted);
}

.main { padding-top: var(--header-h); }

/* --------------------------------------------------------------- botões */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 20px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 26px;
  letter-spacing: 0;
  color: #fff;
  text-align: center;
  text-decoration: none;
  background-color: var(--brand);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.1s linear;
}

.btn:hover { background-color: var(--brand-dark); }

.btn--sm {
  padding: 8px 12px;
  font-size: 14px;
  line-height: 16px;
}

.btn--secondary {
  color: var(--brand);
  background-color: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.btn--secondary:hover {
  color: var(--brand-dark);
  background-color: var(--surface);
  box-shadow: inset 0 0 0 1px var(--text-strong);
}

/* ----------------------------------------------------------- home: hero */

.home-title {
  padding: 56px 24px 40px;
  text-align: center;
}

.home-title__title {
  max-width: 800px;
  margin: 0 auto 16px;
  font-size: 42px;
  font-weight: 600;
  line-height: 52px;
  color: var(--text);
  text-wrap: balance;
}

.home-title__subtitle {
  max-width: 800px;
  margin: 0 auto;
  font-size: 22px;
  font-weight: 400;
  line-height: 32px;
  color: var(--text-2);
}

/* ------------------------------------------------------ home: grid tools */

.tools {
  position: relative;
  max-width: 1872px;
  min-height: 200px;
  margin: auto;
  padding: 0 48px 96px;
}

.tools__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 0 auto 32px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s linear;
}

.chip:hover { border-color: var(--ink); }

.chip.is-active {
  color: var(--text-strong);
  background: var(--bg);
  border-color: var(--ink);
}

.chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tools__container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  width: 100%;
  min-height: 200px;
}

.tools__item {
  position: relative;
  z-index: 1;
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.5s, opacity 0.5s;
}

.tools__item:hover {
  z-index: 2;
  border-color: var(--ink);
  transition: all 0.4s ease-in-out;
}

.tools__item > a,
.tools__item__inner {
  position: relative;
  z-index: 2;
  display: block;
  height: 100%;
  padding: 32px;
  font-weight: 400;
  color: inherit;
  text-decoration: none;
}

.tools__item h3 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  color: var(--text);
}

.tools__item p {
  font-size: 15px;
  line-height: 22px;
  color: var(--text-muted);
}

.tool-icon {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}

/* ainda não implementada: visível no catálogo, mas sem destino */
.tools__item--soon { background: var(--bg); }
.tools__item--soon:hover { border-color: var(--border); }
.tools__item--soon .tool-icon,
.tools__item--soon h3,
.tools__item--soon p { opacity: 0.55; }

.tools__item__badge {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.tools__item[hidden] { display: none; }

.tools__empty {
  padding: 48px 0;
  font-size: 16px;
  color: var(--text-muted);
  text-align: center;
}

/* ----------------------------------------------------------- responsivo */

@media (max-width: 1380px) {
  .tools__container { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1180px) {
  .tools__container { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .tools__container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991.98px) {
  .tool-icon { width: 42px; height: 42px; }
  .tools { padding: 0 32px 32px; }
}

@media (max-width: 767.98px) {
  .home-title { padding: 32px 20px 28px; }
  .home-title__title { font-size: 24px; line-height: 34px; }
  .home-title__subtitle { font-size: 20px; line-height: 28px; }
  .tools { padding: 0 24px 24px; }
  .tools__item > a,
  .tools__item__inner { padding: 24px; }
  .tools__item h3 { font-size: 18px; line-height: 24px; }
  .tool-icon { width: 32px; height: 32px; margin-bottom: 12px; }
  .header { padding: 0 16px; }
}

@media (max-width: 640px) {
  .tools__filter { gap: 8px; }
}

@media (max-width: 560px) {
  .tools__container { grid-template-columns: repeat(1, 1fr); }
}

/* ==================================================================
   Páginas internas — PROVISÓRIO

   A tela de ferramenta (upload/fila/resultado) ainda não foi refeita no
   layout de referência; ver docs/layout.md §4 e §5. O que vem abaixo só
   mantém essas telas apresentáveis, usando os tokens novos, até lá.
   ================================================================== */

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.back {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

.back:hover { color: var(--brand); }

.page h1 {
  margin: 8px 0 6px;
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
}

.muted { color: var(--text-muted); }
.muted.small { font-size: 13px; }

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  margin-top: 24px;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="file"] {
  padding: 9px 11px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.form input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.action-tabs {
  display: flex;
  gap: 8px;
  margin: 24px 0 4px;
}

.action-tab {
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.action-tab.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.hint { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }

.dynamic-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dynamic-fields label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.job-status {
  margin-top: 28px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.job-status h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }

.job-status ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.job-status a { font-weight: 600; color: var(--brand); }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--warning);
  background: #ffedc2;
  border-radius: 999px;
}

.status-pill--processing { color: var(--info); background: #def2ff; }
.status-pill--done { color: #1d7a52; background: #c0fddc; }
.status-pill--failed { color: var(--danger); background: #fde4df; }

.alert {
  margin: 10px 0 0;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.alert--error { color: var(--danger); background: #fde4df; }

/* ==================================================================
   Editor de fluxo — a esteira de bloquinhos
   Entrada → [etapa] → [etapa] → Resultado, com "+" entre os blocos.
   ================================================================== */

.flow {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.flow__head { text-align: center; }

.flow h1 {
  margin: 10px 0 8px;
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
}

.flow__lead {
  max-width: 620px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 26px;
  color: var(--text-2);
}

.flow__canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 36px;
}

.flow__steps {
  display: contents;
}

/* --- bloco --- */

.block {
  width: 100%;
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.block--upload { border-color: var(--ink); }

.block--result { background: var(--bg); }

.block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.block--result .block__head { background: var(--surface); }

.block__kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.block__remove {
  padding: 0 4px;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.block__remove:hover { color: var(--danger); }

.block__body { padding: 18px; }

.block__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}

.block__icon svg {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0;
}

.block__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.block__field input,
.block__field select {
  padding: 9px 11px;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.block__select { max-width: 280px; }

.block__formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 6px;
  border: none;
  padding: 0;
}

.block__formats legend {
  width: 100%;
  padding: 0;
  margin-bottom: 4px;
  font: inherit;
  font-weight: 600;
  color: var(--text-2);
}

.block__format-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
}

.block__format-opt input {
  margin: 0;
}

.block__note,
.block__status {
  margin-top: 10px;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-muted);
}

.block__state:empty { display: none; }
.block__state { margin-top: 12px; }

/* --- conector com o "+" --- */

.connector {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2px;
  height: 44px;
  background: var(--border);
}

.connector__add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 19px;
  line-height: 1;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s linear;
}

.connector__add:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  transform: scale(1.1);
}

/* --- entrada de arquivos --- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 26px 18px;
  text-align: center;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s linear;
}

.dropzone:hover,
.dropzone.is-over {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.dropzone__icon {
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  color: var(--brand);
}

.dropzone__title { font-size: 16px; font-weight: 600; }
.dropzone__hint { font-size: 13px; color: var(--text-muted); }

.filelist {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.filelist__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.filelist__item:last-child { border-bottom: none; }

.filelist__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filelist__remove {
  font-size: 17px;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.filelist__remove:hover { color: var(--danger); }

.filelist--out a { font-weight: 600; color: var(--brand); }

/* --- ações --- */

.flow__actions {
  margin-top: 32px;
  text-align: center;
}

.btn--run {
  min-width: 240px;
  min-height: 56px;
  padding: 14px 40px;
  font-size: 18px;
  border-radius: 12px;
  box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.14);
}

.btn--run:disabled {
  background: var(--border);
  box-shadow: none;
  cursor: default;
}

.flow__error {
  max-width: 440px;
  margin: 14px auto 0;
}

/* --- seletor de funcionalidade --- */

.picker {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 22, 22, 0.45);
}

.picker__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: 80vh;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
}

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

.picker__head h2 { font-size: 17px; font-weight: 600; }

.picker__close {
  font-size: 26px;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  padding: 20px;
  overflow-y: auto;
}

.picker__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  font: inherit;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s linear;
}

.picker__item:hover:not([disabled]) { border-color: var(--ink); }

.picker__item .tool-icon {
  width: 32px;
  height: 32px;
  margin: 0;
}

.picker__item__name { font-size: 14px; font-weight: 500; }

.picker__item--soon {
  background: var(--bg);
  cursor: default;
}

.picker__item--soon .tool-icon,
.picker__item--soon .picker__item__name { opacity: 0.5; }

.picker__item__badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.status-pill--waiting { color: var(--text-muted); background: #ebebf4; }
.status-pill--pending { color: var(--warning); background: #ffedc2; }
.status-pill--cancelled { color: var(--text-muted); background: #ebebf4; }

@media (max-width: 767.98px) {
  .flow { padding: 20px 16px 56px; }
  .flow h1 { font-size: 24px; line-height: 32px; }
  .flow__lead { font-size: 15px; line-height: 23px; }
}

/* --- reordenação (arquivos de entrada e etapas do fluxo) --- */

.reorder {
  display: inline-flex;
  flex: none;
  gap: 2px;
}

.reorder__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 9px;
  line-height: 1;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s linear;
}

.reorder__btn:hover:not(:disabled) {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.reorder__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.filelist__num {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 6px;
}

.filelist__name { flex: 1 1 auto; min-width: 0; }

.block__controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.block__remove:disabled {
  opacity: 0.35;
  cursor: default;
}

.dropzone__limit {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* --- bandeja de páginas (organizar / dividir) --- */

.tray {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
}

.tray--cuts { gap: 2px; }

.thumb {
  position: relative;
  width: 72px;
  cursor: grab;
}

.thumb--static { cursor: default; }
.thumb.is-dragging { opacity: 0.4; }
.thumb.is-target .thumb__img { outline: 2px solid var(--brand); outline-offset: 2px; }

.thumb__img {
  width: 72px;
  height: 92px;
  background-color: var(--surface);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.thumb__num {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  text-align: center;
}

.thumb__drop {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  font-size: 13px;
  line-height: 1;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s linear;
}

.thumb:hover .thumb__drop { opacity: 1; }
.thumb__drop:hover { color: #fff; background: var(--danger); border-color: var(--danger); }

.thumb__move {
  position: absolute;
  bottom: 24px;
  left: 50%;
  display: flex;
  gap: 2px;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.12s linear;
}

.thumb:hover .thumb__move { opacity: 1; }

.thumb__move button {
  width: 22px;
  height: 20px;
  padding: 0;
  font-size: 9px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.thumb__move button:hover:not(:disabled) { color: #fff; background: var(--brand); border-color: var(--brand); }
.thumb__move button:disabled { opacity: 0.3; cursor: default; }

.scissor {
  align-self: center;
  width: 22px;
  height: 92px;
  padding: 0;
  font-size: 13px;
  color: var(--border);
  background: none;
  border: none;
  border-left: 2px dashed var(--border);
  cursor: pointer;
}

.scissor:hover { color: var(--brand); border-left-color: var(--brand); }
.scissor.is-on { color: var(--brand); border-left: 2px solid var(--brand); }

.block__warn {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 19px;
  color: var(--warning);
  background: #ffedc2;
  border-radius: 8px;
}

.filelist__pages {
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.filelist__item--bad .filelist__name,
.filelist__item--bad .filelist__pages { color: var(--danger); }

.linkish {
  padding: 0;
  font: inherit;
  color: var(--brand);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

/* ==================================================================
   Planos — cartões + quadro comparativo
   ================================================================== */

.plans { max-width: 980px; margin: 0 auto; padding: 40px 24px 80px; }
.plans__head { text-align: center; }
.plans h1 { margin-bottom: 10px; font-size: 32px; font-weight: 600; line-height: 40px; }
.plans__lead { max-width: 620px; margin: 0 auto; font-size: 17px; line-height: 26px; color: var(--text-2); }

.plans__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 36px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 22px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.plan--highlight { border: 2px solid var(--brand); }

.plan__flag {
  position: absolute;
  top: -11px;
  left: 50%;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  transform: translateX(-50%);
}

.plan__name { font-size: 20px; font-weight: 600; }
.plan__tagline { min-height: 40px; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.plan__price { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 10px; }
.plan__amount { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.plan__cycle { font-size: 13px; color: var(--text-muted); }
.plan .btn, .plan form { width: 100%; }
.plan .btn { width: 100%; }
.btn--current { color: var(--text-muted); background: var(--bg); cursor: default; }

.plans__notice {
  margin-top: 20px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 20px;
  color: var(--warning);
  background: #ffedc2;
  border-radius: 10px;
}

.plans__notice code {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 1px 5px;
}

.plans__table-title { margin: 48px 0 16px; font-size: 22px; font-weight: 600; text-align: center; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
}

.compare th, .compare td { padding: 13px 16px; text-align: center; }
.compare thead th { font-weight: 600; background: var(--bg); border-bottom: 1px solid var(--border); }
.compare tbody th { font-weight: 400; text-align: left; color: var(--text-2); }
.compare tbody tr { border-bottom: 1px solid var(--border); }
.compare tbody tr:last-child { border-bottom: none; }
.compare td { font-variant-numeric: tabular-nums; }
.compare .is-highlight { background: var(--brand-soft); }
.compare__yes { font-size: 17px; font-weight: 700; color: var(--success); }
.compare__no { color: var(--text-muted); }
.compare__unlimited { font-weight: 600; color: var(--success); }

.plans__fineprint { margin-top: 20px; font-size: 13px; color: var(--text-muted); text-align: center; }

@media (max-width: 767.98px) {
  .plans { padding: 24px 16px 56px; }
  .plans h1 { font-size: 24px; line-height: 32px; }
  .plans__grid { grid-template-columns: 1fr; gap: 20px; }
  .plan__tagline { min-height: 0; }
}

.header__link { font-size: 14px; font-weight: 500; color: var(--text-2); text-decoration: none; }
.header__link:hover { color: var(--brand); }

.header__link--highlight { color: var(--brand); font-weight: 700; }
.header__link--highlight:hover { color: var(--brand-dark); }

.header__link__badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  vertical-align: middle;
}

.block__fix { display: block; margin-top: 10px; }

/* --- gatinho brincando enquanto o fluxo roda --- */

.catplay { text-align: center; color: var(--ink); }
.catplay svg { width: 190px; max-width: 100%; height: auto; }

.catplay__caption {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

/* a bolinha quica e rola de um lado para o outro */
.catplay__ball {
  transform: translate(118px, 89px);
  animation: catplay-ball 1.4s ease-in-out infinite;
}

@keyframes catplay-ball {
  0%   { transform: translate(118px, 89px) rotate(0deg); }
  25%  { transform: translate(104px, 52px) rotate(-120deg); }
  50%  { transform: translate(88px, 89px) rotate(-240deg); }
  75%  { transform: translate(104px, 52px) rotate(-300deg); }
  100% { transform: translate(118px, 89px) rotate(-360deg); }
}

/* a patinha dá o tapa quando a bola chega perto */
.catplay__paw {
  transform-origin: 61px 97px;
  animation: catplay-paw 1.4s ease-in-out infinite;
}

@keyframes catplay-paw {
  0%, 40%, 100% { transform: translateY(0) rotate(0deg); }
  50%           { transform: translateY(-9px) rotate(-18deg); }
  60%           { transform: translateY(0) rotate(0deg); }
}

/* a cabeça acompanha a bola */
.catplay__head {
  transform-origin: 53px 66px;
  animation: catplay-head 1.4s ease-in-out infinite;
}

@keyframes catplay-head {
  0%, 100% { transform: rotate(5deg); }
  50%      { transform: rotate(-5deg); }
}

/* o rabo balança fora de compasso, que é o que dá vida */
.catplay__tail {
  transform-origin: 74px 90px;
  animation: catplay-tail 1.9s ease-in-out infinite;
}

@keyframes catplay-tail {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-13deg); }
}

/* piscadinha de vez em quando */
.catplay__eye {
  transform-origin: center;
  animation: catplay-blink 4.6s infinite;
}

@keyframes catplay-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(0.12); }
}

@media (prefers-reduced-motion: reduce) {
  .catplay__ball,
  .catplay__paw,
  .catplay__head,
  .catplay__tail,
  .catplay__eye { animation: none; }
}

/* ==================================================================
   Pilha de execuções — painel fixo à direita (visível quando logado)
   ================================================================== */

.execstack__tab {
  position: fixed;
  top: calc(var(--header-h) + 24px);
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.execstack__tab:hover { color: var(--brand); }

.execstack__tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
}

.execstack__panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  z-index: 1035;
  display: flex;
  flex-direction: column;
  width: 320px;
  max-width: 88vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 18px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.2s ease-in-out;
}

.execstack__panel.is-open { transform: translateX(0); }

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

.execstack__head h2 { font-size: 16px; font-weight: 600; }

.execstack__close {
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.execstack__list {
  flex: 1 1 auto;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  list-style: none;
}

.execstack__item {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 6px;
}

.execstack__item__link {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  text-decoration: none;
  background: var(--bg);
  border-radius: 10px;
  transition: background 0.12s linear;
}

.execstack__item__link:hover { background: var(--brand-soft); }

.execstack__item__label {
  display: block;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.execstack__item__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.execstack__item__meta .status-pill { padding: 2px 8px; font-size: 10px; }
.execstack__item__time { font-size: 11px; color: var(--text-muted); }
.execstack__item__progress { display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted); }

.execstack__item__download {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  font-size: 15px;
  color: var(--brand);
  text-decoration: none;
  background: var(--bg);
  border-radius: 10px;
}

.execstack__item__download:hover { background: var(--brand-soft); }

.execstack__empty {
  padding: 24px 18px;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 640px) {
  .execstack__tab__label { display: none; }
}

/* --- modo "ver fluxo" (?pipeline=ID), aberto a partir da pilha --- */

.flow__viewer { max-width: 440px; margin: 40px auto 0; text-align: center; }
.viewer__label { margin-bottom: 10px; font-size: 20px; font-weight: 600; }
.viewer__status { margin-bottom: 20px; }
.viewer__new { margin-top: 20px; }

.viewer-steps {
  margin: 0 0 20px;
  padding: 0;
  text-align: left;
  list-style: none;
}

.viewer-steps__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  font-size: 14px;
  background: var(--bg);
  border-radius: 10px;
}

.field-hint {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
}

/* ==================================================================
   Admin — tela de planos
   ================================================================== */

.admin { max-width: 960px; margin: 0 auto; padding: 40px 24px 80px; }
.admin h1 { margin-bottom: 8px; font-size: 28px; font-weight: 600; }
.admin__section-title { margin: 36px 0 6px; font-size: 18px; font-weight: 600; }

.alert--ok {
  padding: 10px 14px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--success);
  background: #dff1e8;
  border-radius: 8px;
}

.alert--error ul { margin: 6px 0 0; padding-left: 18px; }

.compare--admin th, .compare--admin td { padding: 8px 10px; }
.compare--admin input[type="number"] {
  width: 90px;
  padding: 6px 8px;
  font: inherit;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.compare--admin input[readonly] { color: var(--text-muted); background: var(--bg); }
.compare--admin input[type="checkbox"] { width: 18px; height: 18px; }

.admin__system {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
  margin-top: 10px;
}

.admin__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.admin__field input {
  width: 120px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 400;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.admin__mimes { border: none; padding: 0; margin: 0; flex: 1 1 320px; }
.admin__mimes legend { padding: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }

.admin__check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 14px 8px 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
}

.admin__soon {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin__actions { margin-top: 28px; }

.compare__group th {
  padding-top: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
}

.viewer__expired {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

/* --- verificação de autenticidade --- */

.verify__result {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 12px;
}

.verify__result--ok { background: #dff1e8; }
.verify__result--no { background: var(--bg); }

.verify__result dl {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 12px 0 0;
}

.verify__result dt { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); }
.verify__result dd { margin: 2px 0 0; font-size: 14px; }
.verify__result p { margin-top: 10px; font-size: 13px; line-height: 20px; color: var(--text-2); }

.verify__hash {
  margin-top: 12px;
  padding: 10px 12px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  word-break: break-all;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}


/* ---------------------------------------------------------------- retomada
   Uma etapa parou porque decide por número de página e a entrada dela é a
   saída de um bloco anterior — ninguém sabia os parâmetros no envio. O painel
   mostra as páginas do intermediário (miniaturas geradas pela máquina de
   processamento) para a escolha acontecer agora. */
.pause {
  margin: 24px 0 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: 12px;
}

.pause__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.pause__kind {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.pause__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.pause__lead { margin: 0 0 16px; font-size: 14px; color: var(--text-2); }

.pause__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.pause__hint { font-size: 13px; color: var(--text-muted); margin: 0; }

.pause__error {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--danger);
  background: #fde4df;
  border-radius: 8px;
}

/* A miniatura do intermediário já vem pronta do servidor: é imagem de fundo
   como as do editor, mas a fonte é uma URL, não um canvas do pdf.js. */
.thumb__img--remote { background-size: cover; background-position: center; }

.status-pill--awaiting_params { color: var(--brand); background: var(--brand-soft); }
.status-pill--awaiting { color: var(--brand); background: var(--brand-soft); }

/* No editor a tesoura pode ser discreta: a pessoa acabou de arrastar arquivos e
   está em fluxo, e as páginas é que são o assunto. No painel de retomada ela é
   a ÚNICA ação, numa tela que a pessoa nunca viu — em var(--border) ela
   simplesmente não é encontrada. */
.pause .scissor,
.block__pause .scissor {
  color: var(--text-muted);
  border-left-color: var(--text-muted);
  font-size: 15px;
}

.pause .scissor:hover,
.pause .scissor.is-on,
.block__pause .scissor:hover,
.block__pause .scissor.is-on { color: var(--brand); border-left-color: var(--brand); }

/* A escolha mora DENTRO da etapa que está esperando — é lá que a pessoa está
   olhando, e é o único arranjo em que não existem duas interfaces de corte na
   tela ao mesmo tempo (a do editor, montada sobre um documento que o navegador
   nunca viu, fica oculta). */
.block__pause {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px dashed var(--brand);
}

.block__pause .pause__actions { margin-top: 12px; }

/* O item da lista de visualização vira coluna quando recebe a escolha. */
.viewer-steps__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.viewer-steps__item:has(.block__pause:not([hidden])) { display: block; }

/* Ferramenta que não encaixa depois da etapa anterior: a saída daquela não é
   o que esta consome. Fica visível e apagada, não escondida — ver que a
   ferramenta existe e por que ela não serve ali é mais útil que ela sumir. */
.picker__item--incompativel {
  opacity: 0.38;
  cursor: not-allowed;
}

.picker__item--incompativel:hover {
  border-color: var(--border);
  transform: none;
}

/* Alerta de PDF perigoso — distinto do erro comum de validação. Vermelho
   cheio, não a tarja leve: é a informação que mais protege a pessoa, e ela
   precisa parar e ler. */
.flow-error--ameaca {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 14px 16px;
  border-radius: 10px;
  line-height: 1.45;
}
.flow-error--ameaca strong { display: inline; }

/* Alerta de PDF perigoso, dentro da caixa de Entrada — ao lado do arquivo
   recusado. Vermelho cheio, para a pessoa parar e ler. */
.entrada-ameaca {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.45;
}
.entrada-ameaca strong { display: inline; }

/* Cortar: as 4 margens lado a lado. */
.crop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 12px; }
.block__field--inline { flex-direction: row; align-items: center; gap: 8px; }
.block__field--inline input { width: 72px; }
.block__unit { color: var(--text-muted); font-weight: 400; }

/* Botão "Reparar este PDF" dentro do alerta de ameaça — a saída oferecida. */
.entrada-ameaca__reparar {
  display: inline-block;
  margin-top: 10px;
  background: #fff;
  color: var(--danger);
  border: none;
}
.entrada-ameaca__reparar:hover { background: #fff; opacity: 0.9; }
