/* Feedback de processos da VPC ADM — porte fiel do sistema de feedback do SICARD (SIGMA-PLI v3.0).
   Estrutura, medidas, animações e comportamento seguem o original; só cores e famílias de fonte vêm dos tokens VPC
   (base.css). Os papéis de cor do SICARD foram mapeados ao token mais próximo; o mapeamento completo está em
   docs/feedback-de-processos.md. Semáforo dos cabeçalhos: azul em andamento, verde sucesso, âmbar parcial, vermelho erro. */
:root {
  --pfs-navy: var(--navy);
  --pfs-deep: var(--deep);
  --pfs-blue: var(--blue);
  --pfs-blue-deep: var(--blue-deep);
  --pfs-green: var(--green);
  --pfs-green-dark: var(--sucesso);
  --pfs-green-text: var(--botao-salvar-borda);
  --pfs-green-bg: var(--sucesso-fundo);
  --pfs-green-border: #cfe5ad;                 /* mesma borda de .aviso-sucesso (base.css) */
  --pfs-green-light: #e4f2d1;                  /* de --green a 18% sobre branco */
  /* Exceção a aprovar: a paleta VPC não tem tom de alerta; o estado "parcial" precisa ser distinto de sucesso e erro. */
  --pfs-amber: #b98900;
  --pfs-amber-dark: #7a5500;
  --pfs-amber-fill: #b98900;                   /* preenchimento do parcial; fixo nos dois temas (texto branco sobre ele) */
  --pfs-amber-fill-dark: #7a5500;
  --pfs-amber-light: #fdf3d3;
  --pfs-amber-bg: #fffaeb;
  --pfs-amber-border: #f2dc8c;
  --pfs-red: var(--erro);
  --pfs-red-dark: var(--botao-excluir-borda);
  --pfs-red-bg: var(--erro-fundo);
  --pfs-red-border: #e9bcbc;                   /* mesma borda de .aviso-erro (base.css) */
  --pfs-red-light: #f3e4e4;                    /* de --erro a 12% sobre branco */
  --pfs-info-light: var(--selecionada);
  --pfs-info-bg: #f3f8fd;                      /* de --blue a 5% sobre branco */
  --pfs-info-border: #c1ddf4;                  /* de --blue a 25% sobre branco */
  --pfs-loading-light: #e6e8ec;                /* de --navy a 10% sobre branco */
  --pfs-gray-100: var(--paper);
  --pfs-gray-200: var(--line);
  --pfs-gray-500: var(--muted);
  --pfs-gray-700: var(--ink);
  --pfs-gray-900: var(--ink);
  --pfs-white: #fff;
  --pfs-surface: var(--superficie);            /* fundo de caixas, campos e toasts (muda no tema escuro) */
}

/* Tema escuro: textos e tons claros passam a versões claras/escuras próprias; os preenchimentos com texto branco
   (cabeçalhos, botões, ações) são reafirmados com os tokens base logo abaixo, para manter o contraste. */
:root[data-tema="escuro"] {
  --pfs-deep: #e4ecf8; --pfs-navy: #cfe0f7; --pfs-blue-deep: #8ec1f5; --pfs-blue: #4db3ff;
  --pfs-green: var(--lime); --pfs-green-dark: #b9d868; --pfs-green-text: #cfe5ad;
  --pfs-green-bg: #173a31; --pfs-green-border: #3b8067; --pfs-green-light: #1f4a3a;
  --pfs-amber: #e0a800; --pfs-amber-dark: #f2c94c; --pfs-amber-light: #3a2f10; --pfs-amber-bg: #2b2410; --pfs-amber-border: #6b5214;
  --pfs-red: #ff9d9d; --pfs-red-dark: #ffb3b3; --pfs-red-border: #7a3340; --pfs-red-light: #4a2029;
  --pfs-info-bg: #0c1f3d; --pfs-info-border: #26507f; --pfs-loading-light: #1b2d4d;
}
:root[data-tema="escuro"] .pfs-overlay { background: rgb(8 19 39 / 88%); }
:root[data-tema="escuro"] .pfs-box { box-shadow: 0 25px 50px -12px rgb(0 0 0 / 60%); }
:root[data-tema="escuro"] .pfs-header, :root[data-tema="escuro"] .pfs-btn--primary,
:root[data-tema="escuro"] .pfs-credential-header--gestor, :root[data-tema="escuro"] .pfs-btn--credential-ok--gestor { background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%); }
:root[data-tema="escuro"] .pfs-header--success, :root[data-tema="escuro"] .pfs-btn--success { background: linear-gradient(135deg, var(--grupo-4) 0%, var(--green) 100%); }
:root[data-tema="escuro"] .pfs-header--partial, :root[data-tema="escuro"] .pfs-btn--partial { background: linear-gradient(135deg, var(--pfs-amber-fill-dark) 0%, var(--pfs-amber-fill) 100%); }
:root[data-tema="escuro"] .pfs-header--error, :root[data-tema="escuro"] .pfs-btn--error, :root[data-tema="escuro"] .pfs-btn--cancel,
:root[data-tema="escuro"] .pfs-credential-header--admin, :root[data-tema="escuro"] .pfs-btn--credential-ok--admin { background: linear-gradient(135deg, var(--botao-excluir-borda) 0%, var(--botao-excluir) 100%); }
:root[data-tema="escuro"] .pfs-progress-fill { background: linear-gradient(90deg, var(--blue-deep) 0%, var(--blue) 100%); }
:root[data-tema="escuro"] .pfs-sp-action-btn { background: var(--blue); }
:root[data-tema="escuro"] .pfs-sp-action-btn:hover, :root[data-tema="escuro"] .pfs-sp-action-btn:focus-visible { background: var(--blue-deep); }
:root[data-tema="escuro"] #pfsComponente #pfsProgressBox #pfsCancelBtn { background: var(--botao-excluir); }
:root[data-tema="escuro"] #pfsComponente #pfsProgressBox #pfsCancelBtn:hover { background: var(--botao-excluir-borda); }
:root[data-tema="escuro"] .pfs-reopen { background: var(--blue-deep); }

/* Base tipográfica do componente (no SICARD vem do body: 16px/1,5; Arial no corpo e Exo 2 nos títulos h2/h3). */
#pfsComponente { font: 16px/1.5 var(--fonte-corpo); color: var(--ink); text-align: start; text-rendering: auto; }
:where(#pfsComponente) button, :where(#pfsComponente) input { font-family: var(--fonte-corpo); }
:where(#pfsComponente) h2, :where(#pfsComponente) h3 { font-family: var(--fonte-titulos); line-height: 1.5; }
:where(#pfsComponente) p { margin-top: 1em; }
.pfs-svg { display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: -.125em; }
.pfs-giro { animation: pfsGiro 2s linear infinite; }
@keyframes pfsGiro { to { transform: rotate(360deg); } }

/* ── Overlays ── */
.pfs-overlay { position: fixed; inset: 0; z-index: 30000; display: none; align-items: center; justify-content: center; padding: 16px; background: rgb(244 248 251 / 88%); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.pfs-overlay.pfs-active { display: flex; }
/* Resultado e decisão ficam acima do progresso; o feedback.js reforça a ordem de abertura. */
#pfsStatusOverlay { z-index: 30010; }
#pfsConfirmOverlay, #pfsCredentialOverlay { z-index: 30020; }

.pfs-box { display: none; flex-direction: column; width: min(600px, 100%); max-height: 90vh; overflow: hidden; background: var(--pfs-surface); border-radius: 16px; box-shadow: 0 25px 50px -12px rgb(3 16 43 / 28%); }
.pfs-box.pfs-active { display: flex; animation: pfsSlideIn .35s ease both; }
.pfs-box:focus { outline: none; }
@keyframes pfsSlideIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }

/* ── Cabeçalho (semáforo) ── */
.pfs-header { display: flex; align-items: center; gap: 12px; padding: 18px 22px; flex-shrink: 0; color: var(--pfs-white); background: linear-gradient(135deg, var(--pfs-navy) 0%, var(--pfs-blue) 100%); }
.pfs-header--success { background: linear-gradient(135deg, var(--pfs-green-dark) 0%, var(--pfs-green) 100%); }
.pfs-header--partial { background: linear-gradient(135deg, var(--pfs-amber-dark) 0%, var(--pfs-amber) 100%); }
.pfs-header--error { background: linear-gradient(135deg, var(--pfs-red-dark) 0%, var(--pfs-red) 100%); }
.pfs-header-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; background: rgb(255 255 255 / 20%); font-size: 22px; }
.pfs-header-text { flex: 1; min-width: 0; }
.pfs-header-text h3 { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.3; color: inherit; }
.pfs-header-text p { margin: 3px 0 0; font-size: .82rem; opacity: .9; overflow-wrap: anywhere; }
.pfs-header-text p:empty { display: none; }
.pfs-close { flex-shrink: 0; width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgb(255 255 255 / 15%); color: inherit; font-size: 1rem; cursor: pointer; }
.pfs-close:hover, .pfs-close:focus-visible { background: rgb(255 255 255 / 30%); }

.pfs-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 22px; }
.pfs-hidden { display: none !important; }

/* ── Progresso: tarefa atual ── */
.pfs-task-card { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; padding: 14px 18px; border: 1px solid var(--pfs-info-border); border-radius: 10px; background: linear-gradient(135deg, var(--pfs-info-bg) 0%, var(--pfs-info-light) 100%); }
.pfs-task-card-enter { animation: pfsTaskIn .35s ease; }
@keyframes pfsTaskIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.pfs-task-step { display: flex; flex-direction: column; align-items: center; min-width: 42px; }
.pfs-task-step-num { font-size: 22px; font-weight: 700; line-height: 1; color: var(--pfs-blue); }
.pfs-task-step-total { margin-top: 2px; font-size: 11px; color: var(--pfs-gray-500); }
.pfs-task-info { flex: 1; min-width: 0; }
.pfs-task-name { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--pfs-deep); overflow-wrap: anywhere; }
.pfs-task-desc { margin-top: 3px; font-size: 12px; line-height: 1.4; color: var(--pfs-gray-500); white-space: pre-line; }
.pfs-task-desc:empty { display: none; }
.pfs-task-spinner { flex-shrink: 0; font-size: 20px; color: var(--pfs-blue); line-height: 1; }

/* ── Progresso: tarefas concluídas ── */
.pfs-completed-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.pfs-completed-list:empty { display: none; }
.pfs-completed-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--pfs-green-border); border-radius: 6px; background: var(--pfs-green-bg); font-size: 12px; animation: pfsDoneIn .3s ease; }
@keyframes pfsDoneIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.pfs-completed-check { flex-shrink: 0; font-size: 14px; line-height: 1; color: var(--pfs-green-dark); }
.pfs-completed-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--pfs-green-text); }
.pfs-completed-msg { flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--pfs-green-dark); }
.pfs-completed-name, .pfs-completed-msg { white-space: normal; overflow: visible; overflow-wrap: anywhere; }

/* ── Progresso: log ── */
.pfs-log { max-height: 260px; overflow-y: auto; padding: 14px 16px; border: 1px solid var(--pfs-gray-200); border-radius: 8px; background: var(--pfs-gray-100); color: var(--pfs-gray-700); font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12px; line-height: 1.6; }
.pfs-log:empty { display: none; }
.pfs-log::-webkit-scrollbar { width: 6px; }
.pfs-log::-webkit-scrollbar-thumb { background: var(--silver); border-radius: 3px; }
.pfs-log-entry { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 5px; animation: pfsLogIn .25s ease; }
@keyframes pfsLogIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.pfs-log-time { flex-shrink: 0; font-size: 11px; color: var(--pfs-gray-500); }
.pfs-log-icon { flex-shrink: 0; width: 16px; text-align: center; }
.pfs-log-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.pfs-log-entry--task-start { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--pfs-gray-200); font-weight: 600; color: var(--pfs-blue); }
.pfs-log-entry--task-start:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pfs-log-entry--step { color: var(--pfs-gray-700); }
.pfs-log-entry--success { color: var(--pfs-green-dark); }
.pfs-log-entry--error { color: var(--pfs-red); }
.pfs-log-entry--warning { color: var(--pfs-amber-dark); }
.pfs-log-entry--info { color: var(--pfs-deep); }
.pfs-log-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--pfs-blue); border-right-color: transparent; border-radius: 50%; animation: pfsSpin .6s linear infinite; }
@keyframes pfsSpin { to { transform: rotate(360deg); } }

/* ── Progresso: rodapé e barra ── */
.pfs-progress-footer { display: flex; justify-content: center; padding: 0 22px 12px; }
.pfs-progress-footer:has(> [hidden]:only-child) { display: none; }
.pfs-progress-wrapper { flex-shrink: 0; padding: 4px 22px 20px; }
.pfs-progress-info { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 12px; color: var(--pfs-gray-500); }
.pfs-progress-percent { font-weight: 600; color: var(--pfs-blue); }
.pfs-progress-bar { position: relative; height: 8px; overflow: hidden; border-radius: 4px; background: var(--pfs-gray-200); }
.pfs-progress-fill { position: relative; width: 0; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--pfs-navy) 0%, var(--pfs-blue) 100%); transition: width .3s ease; }
.pfs-progress-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0%, rgb(255 255 255 / 30%) 50%, transparent 100%); animation: pfsShine 1.5s ease infinite; }
@keyframes pfsShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.pfs-segments { display: flex; gap: 2px; margin-top: 6px; }
.pfs-segment { flex: 1; height: 4px; border-radius: 2px; background: var(--pfs-gray-200); transition: background .3s ease; }
.pfs-segment--completed { background: var(--pfs-green); }
.pfs-segment--active { background: var(--pfs-amber); animation: pfsPulse 1s ease infinite; }
.pfs-segment--error { background: var(--pfs-red); }
@keyframes pfsPulse { 50% { opacity: .55; } }

/* ── Resultado: sucesso e parcial ── */
.pfs-result-content { padding: 12px 0 4px; text-align: center; }
.pfs-result-icon { display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; font-size: 36px; background: var(--pfs-green-light); color: var(--pfs-green-dark); animation: pfsBounce .6s ease; }
.pfs-result-icon--partial { background: var(--pfs-amber-light); color: var(--pfs-amber-dark); }
@keyframes pfsBounce { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
.pfs-result-title { margin: 0 0 8px; font-size: 1.35rem; font-weight: 700; color: var(--pfs-deep); }
.pfs-result-message { margin: 0 0 20px; font-size: .9rem; line-height: 1.5; color: var(--pfs-deep); white-space: pre-line; overflow-wrap: anywhere; }

.pfs-file-summary { margin-bottom: 16px; padding: 12px 18px; border-radius: 10px; background: var(--pfs-gray-100); text-align: left; }
.pfs-file-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgb(0 0 0 / 5%); font-size: 13px; }
.pfs-file-row:last-child { border-bottom: 0; }
.pfs-file-label { display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-width: 110px; max-width: 45%; font-size: 12px; color: var(--pfs-gray-500); }
.pfs-file-label .pfs-ico { display: inline-block; width: 14px; line-height: 1; text-align: center; color: var(--pfs-blue); }
.pfs-file-value { font-weight: 600; color: var(--pfs-gray-900); overflow-wrap: anywhere; white-space: pre-line; }

/* ── Resultado: subprocessos ── */
.pfs-subprocess-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; text-align: left; }
.pfs-subprocess-list:empty { display: none; }
.pfs-sp-item { display: grid; grid-template-columns: 28px 1fr 20px; grid-template-rows: auto auto; align-items: center; gap: 4px 8px; padding: 10px 14px; border: 1px solid; border-radius: 8px; animation: pfsSpIn .3s ease both; }
@keyframes pfsSpIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pfs-sp-icon { display: flex; align-items: center; justify-content: center; grid-row: 1 / -1; width: 28px; height: 28px; border-radius: 6px; font-size: 14px; }
.pfs-sp-name { grid-column: 2; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.pfs-sp-status { grid-column: 3; grid-row: 1; font-size: 14px; text-align: center; }
.pfs-sp-detail { grid-column: 2 / 4; font-size: 12px; opacity: .85; white-space: pre-line; overflow-wrap: anywhere; }
.pfs-sp-action-btn { grid-column: 2 / 4; justify-self: start; display: inline-flex; align-items: center; margin-top: 8px; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--pfs-blue); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.pfs-sp-action-btn:hover, .pfs-sp-action-btn:focus-visible { background: var(--pfs-deep); color: #fff; }
.pfs-sp--success { background: var(--pfs-green-bg); border-color: var(--pfs-green-border); }
.pfs-sp--success .pfs-sp-icon { background: var(--pfs-green-light); color: var(--pfs-green-dark); }
.pfs-sp--success .pfs-sp-name, .pfs-sp--success .pfs-sp-detail { color: var(--pfs-green-text); }
.pfs-sp--success .pfs-sp-status { color: var(--pfs-green-dark); }
.pfs-sp--warning { background: var(--pfs-amber-bg); border-color: var(--pfs-amber-border); }
.pfs-sp--warning .pfs-sp-icon { background: var(--pfs-amber-light); color: var(--pfs-amber-dark); }
.pfs-sp--warning .pfs-sp-name, .pfs-sp--warning .pfs-sp-detail, .pfs-sp--warning .pfs-sp-status { color: var(--pfs-amber-dark); }
.pfs-sp--skip { background: var(--pfs-gray-100); border-color: var(--pfs-gray-200); }
.pfs-sp--skip .pfs-sp-icon { background: var(--pfs-gray-200); }
.pfs-sp--skip .pfs-sp-icon, .pfs-sp--skip .pfs-sp-name, .pfs-sp--skip .pfs-sp-status, .pfs-sp--skip .pfs-sp-detail { color: var(--pfs-gray-500); }
.pfs-sp--error { background: var(--pfs-red-bg); border-color: var(--pfs-red-border); }
.pfs-sp--error .pfs-sp-icon { background: var(--pfs-red-light); color: var(--pfs-red); }
.pfs-sp--error .pfs-sp-name, .pfs-sp--error .pfs-sp-detail { color: var(--pfs-red-dark); }
.pfs-sp--error .pfs-sp-status { color: var(--pfs-red); }

/* ── Resultado: erro ── */
.pfs-error-icon { display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; background: var(--pfs-red-light); color: var(--pfs-red); font-size: 36px; animation: pfsShake .6s ease; }
@keyframes pfsShake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pfs-error-title { margin: 0 0 8px; font-size: 1.35rem; font-weight: 700; color: var(--pfs-red-dark); }
.pfs-error-message { margin: 0 0 18px; font-size: .9rem; line-height: 1.5; color: var(--pfs-gray-700); white-space: pre-line; overflow-wrap: anywhere; }
.pfs-error-message:empty { display: none; }
.pfs-error-technical { margin: -6px 0 18px; padding: 10px 12px; border-radius: 6px; background: var(--pfs-gray-100); color: var(--pfs-gray-500); font-family: Consolas, "Courier New", monospace; font-size: .75rem; line-height: 1.5; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.pfs-error-technical[hidden] { display: none; }
.pfs-error-details { margin-bottom: 14px; padding: 14px 16px; border-radius: 12px; background: var(--pfs-gray-100); text-align: left; }
.pfs-error-details:has(.pfs-error-log:empty) { display: none; }
.pfs-error-details-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--pfs-red); }
.pfs-error-log { max-height: 150px; overflow-y: auto; padding: 12px; border: 1px solid var(--pfs-gray-200); border-radius: 8px; background: var(--pfs-surface); color: var(--pfs-gray-700); font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.pfs-solution { padding: 12px 16px; border-left: 4px solid var(--pfs-blue); border-radius: 0 8px 8px 0; background: var(--pfs-info-light); text-align: left; }
.pfs-solution-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--pfs-blue); }
.pfs-solution-text { margin: 0; font-size: 13px; color: var(--pfs-gray-700); }

/* ── Rodapé e botões ── */
.pfs-footer { display: flex; flex-shrink: 0; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--pfs-gray-200); }
.pfs-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 28px; border: 0; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--pfs-white); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.pfs-btn:hover { transform: translateY(-2px); }
.pfs-btn:focus-visible { outline: 3px solid rgb(8 120 209 / 45%); outline-offset: 2px; }
.pfs-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.pfs-btn--primary { background: linear-gradient(135deg, var(--pfs-navy) 0%, var(--pfs-blue) 100%); }
.pfs-btn--primary:hover { box-shadow: 0 4px 12px rgb(8 120 209 / 40%); }
.pfs-btn--success { background: linear-gradient(135deg, var(--pfs-green-dark) 0%, var(--pfs-green) 100%); }
.pfs-btn--success:hover { box-shadow: 0 4px 12px rgb(103 185 0 / 40%); }
.pfs-btn--partial { background: linear-gradient(135deg, var(--pfs-amber-dark) 0%, var(--pfs-amber) 100%); }
.pfs-btn--partial:hover { box-shadow: 0 4px 12px rgb(185 137 0 / 40%); }
.pfs-btn--error, .pfs-btn--cancel { background: linear-gradient(135deg, var(--pfs-red-dark) 0%, var(--pfs-red) 100%); }
.pfs-btn--error:hover, .pfs-btn--cancel:hover { box-shadow: 0 4px 12px rgb(153 27 27 / 40%); }
.pfs-btn--secondary { background: var(--pfs-surface); color: var(--pfs-gray-700); border: 1px solid var(--pfs-gray-200); }
.pfs-btn--secondary:hover { background: var(--pfs-gray-100); }

/* ── Confirmação ── */
.pfs-confirm-box { width: min(520px, 100%); }
.pfs-confirm-body { text-align: center; }
.pfs-confirm-message { margin: 0 0 12px; font-size: .95rem; line-height: 1.5; color: var(--pfs-gray-900); white-space: pre-line; overflow-wrap: anywhere; }
.pfs-confirm-warning { margin: 0 0 12px; padding: 10px 14px; border-left: 4px solid var(--pfs-amber); border-radius: 0 8px 8px 0; background: var(--pfs-amber-light); color: var(--pfs-amber-dark); font-size: .85rem; line-height: 1.5; text-align: left; white-space: pre-line; overflow-wrap: anywhere; }
.pfs-confirm-warning:empty, .pfs-confirm-message:empty, .pfs-confirm-prompt:empty { display: none; }
.pfs-confirm-prompt { margin: 0; font-size: .9rem; font-weight: 600; color: var(--pfs-deep); }
.pfs-confirm-input-wrap { display: none; margin-top: 12px; text-align: left; }
.pfs-confirm-input-wrap.pfs-active { display: block; }
.pfs-confirm-input, .pfs-credential-input { width: 100%; padding: 10px 12px; border: 1px solid var(--silver); border-radius: 8px; font-size: .95rem; color: var(--pfs-gray-900); box-sizing: border-box; }
/* No SICARD o campo de texto e o rótulo da confirmação herdam as regras globais de formulário (app.css): rótulo 15px/600 e campo 13px com 8,8 x 10,4 px de preenchimento. */
.pfs-confirm-input-wrap > .pfs-credential-field { display: block; margin-bottom: .35rem; font-size: .9375rem; font-weight: 600; color: var(--titulo); }
.pfs-confirm-input { padding: .55rem .65rem; border-color: var(--line); border-radius: 6px; font-size: .8125rem; color: var(--ink); background: var(--pfs-surface); }
.pfs-confirm-input:focus, .pfs-credential-input:focus { outline: 3px solid rgb(8 120 209 / 30%); border-color: var(--pfs-blue); }

/* ── Credencial (gestor/administrador) ── */
.pfs-credential-header--gestor { background: linear-gradient(135deg, var(--pfs-navy) 0%, var(--pfs-blue) 100%); }
.pfs-credential-header--admin { background: linear-gradient(135deg, var(--pfs-red-dark) 0%, var(--pfs-red) 100%); }
.pfs-credential-body { text-align: center; }
.pfs-credential-icon-area { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; font-size: 32px; }
.pfs-credential-icon-area--gestor { background: var(--pfs-info-light); color: var(--pfs-blue); }
.pfs-credential-icon-area--admin { background: var(--pfs-red-light); color: var(--pfs-red); }
.pfs-credential-restricted-label { margin: 0 0 8px; font-size: 1.1rem; font-weight: 700; }
.pfs-credential-restricted-label--gestor { color: var(--pfs-blue); }
.pfs-credential-restricted-label--admin { color: var(--pfs-red); }
.pfs-credential-message { margin: 0 0 16px; font-size: .9rem; line-height: 1.5; color: var(--pfs-gray-700); white-space: pre-line; }
.pfs-credential-field { text-align: left; }
.pfs-credential-field label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 600; color: var(--pfs-gray-700); }
.pfs-credential-input--admin:focus { outline-color: rgb(153 27 27 / 30%); border-color: var(--pfs-red); }
.pfs-credential-error { min-height: 1.2em; margin: 6px 0 0; font-size: .82rem; color: var(--pfs-red); text-align: left; }
.pfs-btn--credential-ok--gestor { background: linear-gradient(135deg, var(--pfs-navy) 0%, var(--pfs-blue) 100%); }
.pfs-btn--credential-ok--admin { background: linear-gradient(135deg, var(--pfs-red-dark) 0%, var(--pfs-red) 100%); }

@media (max-width: 640px) {
  .pfs-header { padding: 14px 16px; }
  .pfs-body { padding: 16px; }
  .pfs-log { max-height: 190px; font-size: 11px; }
  .pfs-footer { padding: 14px 16px; }
  .pfs-btn { padding: 10px 20px; font-size: 13px; }
  .pfs-task-card { gap: 10px; padding: 12px 14px; }
  .pfs-file-row { flex-direction: column; gap: 2px; }
  .pfs-file-label { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pfs-box.pfs-active, .pfs-task-card-enter, .pfs-completed-item, .pfs-log-entry, .pfs-sp-item,
  .pfs-result-icon, .pfs-error-icon, .pfs-segment--active, .pfs-progress-fill::after { animation: none; }
  .pfs-log-spinner { animation-duration: 1.5s; }
}

/* Medição da tarefa corrente, separada do progresso geral. */
.pfs-task-progress { padding: 0 0 14px; }
.pfs-task-progress .pfs-progress-bar { height: 8px; }
.pfs-progress-indeterminate .pfs-progress-fill { width: 28%; animation: pfs-indeterminate 1.5s ease-in-out infinite; }
@keyframes pfs-indeterminate { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
@media (prefers-reduced-motion: reduce) { .pfs-progress-indeterminate .pfs-progress-fill { animation: none; transform: none; } }

/* Mensagens prioritárias e resumo acessível. */
#pfsProgressBox { width: min(840px, 100%); }
#pfsProgressBox .pfs-task-card { display: none; }
.pfs-contact { font-size: 12px; line-height: 1.4; color: var(--pfs-gray-500); margin: 8px 0; }
.pfs-contact:empty { display: none; }
#pfsProgressBox .pfs-log { max-height: 36vh; min-height: 100px; }
.pfs-log:focus-visible { outline: 3px solid var(--pfs-blue); outline-offset: 2px; }

/* Modais compactos: as três famílias mantêm dimensões próprias e corpo rolável. */
#pfsComponente .pfs-header { gap: 9px; padding: 9px 16px; }
#pfsComponente .pfs-header-icon { width: 34px; height: 34px; border-radius: 8px; font-size: 17px; }
#pfsComponente .pfs-header-text h3 { font-size: 1rem; }
#pfsComponente .pfs-close { width: 30px; height: 30px; font-size: .9rem; }
#pfsComponente .pfs-footer, #pfsComponente .pfs-progress-footer { gap: 8px; padding: 8px 16px; background: var(--pfs-gray-100); }
#pfsComponente .pfs-btn { min-height: 34px; padding: 7px 16px; font-size: 13px; }
#pfsComponente .pfs-confirm-input-wrap .pfs-credential-field > span { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 600; color: var(--pfs-gray-700); }
#pfsComponente #pfsProgressBox, #pfsComponente #pfsSuccessBox,
#pfsComponente #pfsPartialBox, #pfsComponente #pfsErrorBox { width: min(540px, 100%); height: min(450px, calc(100dvh - 32px)); }
#pfsComponente #pfsConfirmBox { width: min(520px, 100%); height: min(255px, calc(100dvh - 32px)); }
#pfsComponente #pfsCredentialBox { width: min(520px, 100%); height: min(390px, calc(100dvh - 32px)); }
#pfsComponente #pfsSuccessBox .pfs-body, #pfsComponente #pfsPartialBox .pfs-body,
#pfsComponente #pfsErrorBox .pfs-body { display: flex; flex-direction: column; }
#pfsComponente #pfsSuccessBox .pfs-result-content, #pfsComponente #pfsPartialBox .pfs-result-content,
#pfsComponente #pfsErrorBox .pfs-result-content { width: 100%; margin-block: auto; }
#pfsComponente #pfsConfirmBox .pfs-body, #pfsComponente #pfsCredentialBox .pfs-body { display: flex; flex-direction: column; justify-content: center; }
#pfsComponente #pfsProgressBox .pfs-header-text p,
#pfsComponente #pfsProgressBox .pfs-task-card { display: none; }
#pfsComponente #pfsProgressBox { height: auto; max-height: calc(100dvh - 32px); }
#pfsComponente #pfsProgressBox .pfs-body { display: flex; flex-direction: column; gap: 12px; }
#pfsComponente #pfsProgressBox .pfs-body > * { flex-shrink: 0; min-width: 0; }
#pfsComponente #pfsProgressBox h4 { margin: 0 0 5px; font-size: 12px; font-weight: 600; color: var(--pfs-deep); }
#pfsComponente #pfsProgressBox .pfs-progress-description { margin: 0; color: var(--pfs-gray-700); font-size: 14px; font-weight: 600; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
#pfsComponente #pfsProgressBox .pfs-run-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
#pfsComponente #pfsProgressBox .pfs-run-info > div,
#pfsComponente #pfsProgressBox .pfs-activity-panel { padding: 10px 12px; border: 1px solid var(--pfs-gray-200); border-radius: 8px; background: var(--pfs-gray-100); }
#pfsComponente #pfsProgressBox .pfs-run-info dt { font-size: 12px; color: var(--pfs-gray-500); }
#pfsComponente #pfsProgressBox .pfs-run-info dd { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--pfs-deep); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#pfsComponente #pfsProgressBox .pfs-task-progress { padding: 0; }
#pfsComponente #pfsProgressBox .pfs-progress-wrapper { display: block; padding: 0; border: 0; background: transparent; }
#pfsComponente #pfsProgressBox .pfs-active-details { color: var(--pfs-gray-700); font-size: 13px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
#pfsComponente #pfsProgressBox .pfs-contact { margin: 6px 0 0; font-size: 12px; line-height: 1.5; }
#pfsComponente #pfsProgressBox .pfs-messages:not(:has(.pfs-active-details:not(:empty), .pfs-contact:not(:empty))),
#pfsComponente #pfsProgressBox .pfs-activity-panel:has(.pfs-active-details:empty),
#pfsComponente #pfsProgressBox .pfs-contact:empty,
#pfsComponente #pfsProgressBox .pfs-last-completed:empty { display: none; }
#pfsComponente #pfsProgressBox .pfs-warning-panel { padding: 10px 12px; border-left: 3px solid var(--pfs-amber); border-radius: 6px; background: var(--pfs-amber-light); color: var(--pfs-amber-dark); }
#pfsComponente #pfsProgressBox .pfs-warning-panel h4 { color: inherit; }
#pfsComponente #pfsProgressBox .pfs-warning-panel p { margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
#pfsComponente #pfsProgressBox .pfs-warning-error { border-color: var(--pfs-red); background: var(--pfs-red-light); color: var(--pfs-red-dark); }
#pfsComponente #pfsProgressBox .pfs-last-completed { margin: 0; font-size: 12px; color: var(--pfs-green-dark); overflow-wrap: anywhere; }
#pfsComponente #pfsProgressBox .pfs-progress-note,
#pfsComponente #pfsProgressBox .pfs-progress-guidance { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--pfs-gray-500); }
#pfsComponente #pfsProgressBox .pfs-progress-guidance { margin: 0; }
#pfsComponente #pfsProgressBox .pfs-progress-footer:not(:has(button:not([hidden]))) { display: none; }
#pfsComponente .pfs-result-content { text-align: left; }
#pfsComponente .pfs-result-icon, #pfsComponente .pfs-error-icon { margin: 0 auto 12px; }
#pfsComponente .pfs-result-title, #pfsComponente .pfs-error-title { margin-bottom: 12px; text-align: center; }
#pfsComponente .pfs-result-message, #pfsComponente .pfs-error-message { margin-bottom: 18px; text-align: justify; }
#pfsComponente .pfs-detail-panel { min-width: 0; padding: 14px; border: 1px solid var(--pfs-gray-200); border-radius: 10px; background: var(--pfs-gray-100); }
#pfsComponente .pfs-detail-panel[hidden], #pfsComponente .pfs-error-details[hidden] { display: none; }
#pfsComponente .pfs-detail-panel > :last-child { margin-bottom: 0; }
#pfsComponente #pfsSuccessBox .pfs-detail-panel { padding: 10px 12px; }
#pfsComponente #pfsSuccessBox .pfs-file-summary { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0 0 8px; padding: 0 0 8px; border: 0; border-bottom: 1px solid var(--pfs-gray-200); border-radius: 0; }
#pfsComponente #pfsSuccessBox .pfs-file-summary:empty { display: none; }
#pfsComponente #pfsSuccessBox .pfs-file-row { gap: 5px; padding: 1px 0; border: 0; }
#pfsComponente #pfsSuccessBox .pfs-file-label { min-width: 0; max-width: none; }
#pfsComponente #pfsSuccessBox .pfs-subprocess-list { gap: 4px; margin: 0; }
#pfsComponente #pfsSuccessBox .pfs-sp-item { grid-template-columns: 22px minmax(0, 1fr) 18px minmax(0, 1fr); grid-template-rows: auto; gap: 6px; padding: 5px 8px; }
#pfsComponente #pfsSuccessBox .pfs-sp-icon { grid-row: 1; width: 22px; height: 22px; font-size: 12px; }
#pfsComponente #pfsSuccessBox .pfs-sp-detail { grid-column: 4; grid-row: 1; font-size: 11px; }
#pfsComponente #pfsErrorBox .pfs-detail-panel .pfs-error-details { padding: 0; border: 0; }
#pfsComponente #pfsErrorBox .pfs-detail-panel .pfs-solution { margin-top: 14px; }
#pfsComponente .pfs-download-report { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--pfs-blue); text-decoration: underline; cursor: pointer; }
#pfsComponente .pfs-download-report:focus-visible { outline: 3px solid var(--pfs-blue); }
#pfsComponente #pfsPartialBox .pfs-footer, #pfsComponente #pfsErrorBox .pfs-footer,
#pfsComponente .pfs-progress-footer { justify-content: center; border-top: 1px solid var(--pfs-gray-200); }
#pfsComponente #pfsProgressBox #pfsCancelBtn { width: auto; justify-content: center; background: var(--pfs-red); color: var(--pfs-white); }
#pfsComponente #pfsProgressBox #pfsCancelBtn:hover { background: var(--pfs-red-dark); }

@media (max-width: 560px) {
  #pfsComponente .pfs-footer .pfs-btn { width: auto; justify-content: center; }
  #pfsComponente #pfsSuccessBox .pfs-file-row { flex-direction: row; }
  #pfsComponente #pfsSuccessBox .pfs-sp-item { grid-template-columns: 22px minmax(0, 1fr) 18px; }
  #pfsComponente #pfsSuccessBox .pfs-sp-detail { grid-column: 2 / 4; grid-row: 2; }
}
@media (max-width: 560px), (max-height: 600px) {
  #pfsComponente .pfs-overlay { padding: 8px; }
  #pfsComponente .pfs-box { border-radius: 12px; }
  #pfsComponente #pfsSuccessBox,
  #pfsComponente #pfsPartialBox, #pfsComponente #pfsErrorBox { height: min(350px, calc(100dvh - 16px)); }
  #pfsComponente #pfsProgressBox { max-height: calc(100dvh - 16px); }
  #pfsComponente #pfsConfirmBox { height: min(245px, calc(100dvh - 16px)); }
  #pfsComponente #pfsCredentialBox { height: min(340px, calc(100dvh - 16px)); }
  #pfsComponente .pfs-header { gap: 7px; padding: 6px 10px; }
  #pfsComponente .pfs-header-icon { width: 28px; height: 28px; font-size: 14px; }
  #pfsComponente .pfs-header-text h3 { font-size: .9rem; }
  #pfsComponente .pfs-close { width: 28px; height: 28px; }
  #pfsComponente .pfs-body { padding: 12px; }
  #pfsComponente .pfs-footer, #pfsComponente .pfs-progress-footer { gap: 6px; padding: 6px 10px; }
  #pfsComponente .pfs-btn { min-height: 32px; padding: 6px 12px; font-size: 12px; }
  #pfsComponente .pfs-result-content { padding: 4px 0 0; }
  #pfsComponente .pfs-result-icon, #pfsComponente .pfs-error-icon,
  #pfsComponente .pfs-credential-icon-area { width: 52px; height: 52px; margin-bottom: 8px; font-size: 25px; }
  #pfsComponente .pfs-result-title, #pfsComponente .pfs-error-title { margin-bottom: 8px; font-size: 1.1rem; }
  #pfsComponente .pfs-result-message, #pfsComponente .pfs-error-message,
  #pfsComponente .pfs-confirm-message, #pfsComponente .pfs-credential-message { margin-bottom: 10px; font-size: .82rem; }
  #pfsComponente #pfsProgressBox .pfs-body { gap: 10px; }
  #pfsComponente #pfsProgressBox .pfs-progress-description { font-size: .82rem; }
  #pfsComponente #pfsProgressBox .pfs-active-details { font-size: 12px; }
  #pfsComponente #pfsProgressBox .pfs-progress-info { margin-bottom: 4px; font-size: 11px; }
  #pfsComponente #pfsProgressBox .pfs-progress-bar { height: 6px; }
  #pfsComponente .pfs-detail-panel { padding: 9px; }
  #pfsComponente #pfsSuccessBox .pfs-detail-panel { padding: 8px; }
  #pfsComponente .pfs-sp-item { gap: 2px 6px; padding: 6px 8px; }
  #pfsComponente .pfs-sp-icon { width: 22px; height: 22px; font-size: 12px; }
  #pfsComponente .pfs-sp-name, #pfsComponente .pfs-solution-text { font-size: 12px; }
  #pfsComponente .pfs-sp-detail { font-size: 11px; }
  #pfsComponente .pfs-file-label { font-size: 11px; }
  #pfsComponente .pfs-file-value { font-size: 12px; }
  #pfsComponente .pfs-error-details-header { margin-bottom: 6px; font-size: 12px; }
  #pfsComponente .pfs-error-log { padding: 7px; font-size: 11px; }
  #pfsComponente .pfs-solution { padding: 8px 10px; }
  #pfsComponente .pfs-solution-title { font-size: 12px; }
  #pfsComponente .pfs-confirm-warning { padding: 7px 10px; font-size: .78rem; }
  #pfsComponente .pfs-confirm-prompt, #pfsComponente .pfs-credential-restricted-label { font-size: .9rem; }
  #pfsComponente .pfs-confirm-input-wrap { margin-top: 8px; }
  #pfsComponente .pfs-confirm-input, #pfsComponente .pfs-credential-input { padding: 7px 9px; font-size: .85rem; }
  #pfsComponente .pfs-credential-field label,
  #pfsComponente .pfs-confirm-input-wrap .pfs-credential-field > span { font-size: .78rem; }
}
@media (max-width: 360px), (max-height: 450px) {
  #pfsComponente #pfsSuccessBox,
  #pfsComponente #pfsPartialBox, #pfsComponente #pfsErrorBox { height: min(310px, calc(100dvh - 16px)); }
  #pfsComponente #pfsCredentialBox { height: min(320px, calc(100dvh - 16px)); }
  #pfsComponente .pfs-body { padding: 8px 10px; }
  #pfsComponente .pfs-result-icon, #pfsComponente .pfs-error-icon,
  #pfsComponente .pfs-credential-icon-area { width: 42px; height: 42px; margin-bottom: 6px; font-size: 21px; }
  #pfsComponente .pfs-result-title, #pfsComponente .pfs-error-title { margin-bottom: 6px; font-size: 1rem; }
  #pfsComponente #pfsProgressBox .pfs-body { gap: 7px; }
  #pfsComponente .pfs-confirm-message, #pfsComponente .pfs-credential-message { margin-bottom: 7px; }
}

/* Hierarquia persistente no mesmo modal; expansão e foco sobrevivem aos snapshots. */
.pfs-hierarchy { max-height: min(48vh, 520px); overflow: auto; padding: 4px; overscroll-behavior: contain; }
.pfs-reopen { position: fixed; right: 16px; bottom: 16px; z-index: 10020; padding: 10px 16px; background: var(--pfs-blue-deep); color: #fff; border: 2px solid #fff; border-radius: 6px; cursor: pointer; }
.pfs-reopen[hidden] { display: none; }
.pfs-has-hierarchy #pfsTaskCard, .pfs-has-hierarchy #pfsTaskProgress,
.pfs-has-hierarchy .pfs-progress-wrapper { display: none !important; }
#pfsDiagnostics { margin-top: 12px; }
#pfsDiagnostics summary:focus-visible { outline: 3px solid var(--pfs-blue); outline-offset: 2px; }
#pfsDiagnostics .pfs-log { max-height: 180px; overflow: auto; }
@media (max-width: 600px) { .pfs-hierarchy { max-height: 42vh; } }

/* Apresentação aprovada: título no corpo e três mensagens sem cartões aninhados. */
#pfsComponente #pfsProgressBox { width: min(960px, 100%); }
#pfsComponente #pfsProgressBox .pfs-body { padding: 30px 28px; gap: 0; }
#pfsComponente .pfs-flow-title { margin: 0 0 22px; text-align: center; color: var(--titulo); font-size: clamp(20px, 3vw, 28px); font-weight: 650; line-height: 1.3; }
.pfs-flow-icone { display: block; margin-bottom: 12px; color: var(--pfs-blue); font-size: 36px; line-height: 1; }
.pfs-flow-icone .pfs-svg { display: block; margin-inline: auto; }
.pfs-flow-title > span { display: block; }
#pfsComponente #pfsProgressBox .pfs-current-stage,
#pfsComponente #pfsProgressBox .pfs-run-info > div:first-child,
#pfsComponente #pfsProgressBox .pfs-messages,
#pfsComponente #pfsProgressBox .pfs-last-completed,
#pfsComponente #pfsProgressBox #pfsProgressWarning { display: none; }
#pfsComponente #pfsProgressBox .pfs-run-info { grid-template-columns: minmax(0, 260px); justify-content: center; text-align: center; }
#pfsComponente #pfsProgressBox .pfs-progress-guidance { display: flex; align-items: flex-start; gap: 9px; margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.pfs-progress-guidance > .pfs-svg { flex: none; margin-top: 3px; color: var(--pfs-blue); }
#pfsComponente #pfsHierarchy { display: grid; gap: 24px; width: 100%; margin: 22px 0; max-height: none; overflow: visible; padding: 0; }
#pfsComponente #pfsHierarchy[hidden] { display: none; }
.pfs-level { min-width: 0; margin: 0; padding: 0; border: 0; background: none; }
.pfs-level-line { display: flex; align-items: baseline; gap: 12px; min-width: 0; margin-bottom: 9px; white-space: nowrap; }
.pfs-level-message { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--titulo); font-size: 14px; font-weight: 550; }
.pfs-level-percent { flex: 0 0 42px; text-align: right; font-size: 13px; font-weight: 700; color: var(--pfs-blue-deep); font-variant-numeric: tabular-nums; }
#pfsComponente .pfs-level .pfs-progress-bar { width: 100%; height: 8px; background: var(--pfs-gray-200); border-radius: 4px; }
#pfsComponente .pfs-level .pfs-progress-fill { border-radius: inherit; background: var(--pfs-blue); }
#pfsComponente .pfs-level[data-state="concluido"] .pfs-progress-fill { background: var(--pfs-green-dark); }
#pfsComponente .pfs-level[data-state="erro"] .pfs-progress-fill { background: var(--pfs-red); }
#pfsComponente .pfs-level[data-state="parcial"] .pfs-progress-fill,
#pfsComponente .pfs-level[data-state="cancelado"] .pfs-progress-fill { background: var(--pfs-amber); }
#pfsComponente #pfsDiagnostics { margin-top: 18px; }
#pfsComponente #pfsDiagnostics [data-pfs="technical-detail"] { white-space: pre-line; font-size: 13px; color: var(--muted); }
#pfsComponente .pfs-legacy-history[hidden] { display: none; }

#pfsComponente #pfsConfirmBox { width: min(560px, 100%); height: auto; max-height: calc(100dvh - 32px); }
#pfsComponente #pfsConfirmBox .pfs-confirm-body { padding: 32px 28px; text-align: center; justify-content: flex-start; flex: 0 1 auto; min-height: 0; overflow-y: auto; gap: 20px; }
#pfsComponente #pfsConfirmBox .pfs-header,
#pfsComponente #pfsConfirmBox .pfs-footer { flex-shrink: 0; }
#pfsComponente #pfsConfirmBox .pfs-confirm-body > * { flex-shrink: 0; margin: 0; }
#pfsComponente #pfsConfirmBox #pfsConfirmIcon { display: flex; justify-content: center; align-items: center; width: auto; height: auto; margin: 0 0 12px; padding: 0; background: none; color: var(--pfs-blue); font-size: 36px; }
#pfsComponente #pfsConfirmBox:has(.pfs-header--error) #pfsConfirmIcon { color: var(--pfs-red); }
#pfsComponente #pfsConfirmTitle { margin: 0; color: var(--titulo); font-size: clamp(20px, 3vw, 28px); line-height: 1.3; }
#pfsComponente #pfsConfirmBox .pfs-confirm-message { font-size: 14px; line-height: 1.7; }
#pfsComponente #pfsConfirmBox .pfs-footer { justify-content: center; gap: 12px; flex-wrap: wrap; padding: 18px 24px; }
#pfsComponente #pfsConfirmBox .pfs-confirm-input-wrap:not(.pfs-active),
#pfsComponente #pfsConfirmBox .pfs-confirm-body > p:empty { display: none; }
#pfsComponente #pfsSuccessBox .pfs-result-title,
#pfsComponente #pfsSuccessBox .pfs-result-message,
#pfsComponente #pfsPartialBox .pfs-result-title,
#pfsComponente #pfsPartialBox .pfs-result-message,
#pfsComponente #pfsErrorBox .pfs-error-title,
#pfsComponente #pfsErrorBox .pfs-error-message { text-align: center; }
#pfsComponente .pfs-result-line { display: block; line-height: 1.3; }
#pfsComponente .pfs-result-paragraph { display: block; }
#pfsComponente .pfs-result-paragraph + .pfs-result-paragraph { margin-top: 14px; }
@media (max-width: 600px) {
  #pfsComponente #pfsProgressBox .pfs-body { padding: 24px 16px; }
  .pfs-level-line { gap: 7px; }
  .pfs-level-message { font-size: 12px; }
  .pfs-level-percent { flex-basis: 33px; font-size: 12px; }
  #pfsComponente #pfsConfirmBox .pfs-confirm-body { padding: 24px 16px; }
}

/* ── Avisos (Notify): centro da tela; avisos e erros só fecham por ação do usuário ── */
.notification-container { position: fixed; z-index: 99999; display: flex; flex-direction: column; gap: 12px; max-width: 400px; width: min(400px, calc(100vw - 32px)); font-size: 16px; line-height: 1.5; text-rendering: auto; pointer-events: none; }
.notification-container > * { pointer-events: all; }
.notification-top-right { top: 20px; right: 20px; }
.notification-top-left { top: 20px; left: 20px; }
.notification-bottom-right { bottom: 20px; right: 20px; }
.notification-bottom-left { bottom: 20px; left: 20px; }
.notification-top-center { top: 20px; left: 50%; align-items: center; transform: translateX(-50%); }
.notification-bottom-center { bottom: 20px; left: 50%; align-items: center; transform: translateX(-50%); }
.notification-center { top: 50%; left: 50%; align-items: center; justify-content: center; transform: translate(-50%, -50%); }

.notification-toast { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; background: var(--pfs-surface); border-radius: 8px; box-shadow: 0 4px 12px rgb(0 0 0 / 15%), 0 0 0 1px rgb(0 0 0 / 5%); min-width: 320px; max-width: 100%; position: relative; overflow: hidden; font-family: var(--fonte-corpo); }
.notification-toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.notification-toast.success::before { background: var(--pfs-green); }
.notification-toast.error::before { background: var(--pfs-red); }
.notification-toast.warning::before { background: var(--pfs-amber); }
.notification-toast.info::before { background: var(--pfs-blue); }
.notification-toast.loading::before { background: var(--pfs-navy); }
.notification-icon { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: bold; }
.notification-toast.success .notification-icon { background: var(--pfs-green-light); color: var(--pfs-green-dark); }
.notification-toast.error .notification-icon { background: var(--pfs-red-light); color: var(--pfs-red-dark); }
.notification-toast.warning .notification-icon { background: var(--pfs-amber-light); color: var(--pfs-amber-dark); }
.notification-toast.info .notification-icon { background: var(--pfs-info-light); color: var(--pfs-deep); }
.notification-toast.loading .notification-icon { background: var(--pfs-loading-light); color: var(--pfs-navy); }
.notification-spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: notification-spin .6s linear infinite; }
@keyframes notification-spin { to { transform: rotate(360deg); } }
.notification-content { flex: 1; min-width: 0; }
.notification-title { font-weight: 600; font-size: 14px; line-height: 1.4; color: var(--ink); margin: 0 0 4px; }
.notification-message { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0; word-wrap: break-word; }
.notification-close { flex-shrink: 0; width: 20px; height: 20px; border: none; background: transparent; color: var(--silver); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: all .2s; font-family: var(--fonte-corpo); }
.notification-close:hover { background: var(--paper); color: var(--ink); }
.notification-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: currentcolor; opacity: .3; transition: width linear; }
.notification-toast.success .notification-progress { color: var(--pfs-green); }
.notification-toast.error .notification-progress { color: var(--pfs-red); }
.notification-toast.warning .notification-progress { color: var(--pfs-amber); }
.notification-toast.info .notification-progress { color: var(--pfs-blue); }
.notification-toast.loading .notification-progress { color: var(--pfs-navy); }
@keyframes pliNotifySlideIn { from { transform: translateY(8px) scale(.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes pliNotifyFadeIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes pliNotifyBounceIn { 0% { transform: scale(.88); opacity: 0; } 50% { transform: scale(1.02); } 100% { transform: scale(1); opacity: 1; } }
@keyframes pliNotifySlideOut { to { transform: translateY(8px) scale(.96); opacity: 0; } }
@keyframes pliNotifyFadeOut { to { opacity: 0; transform: scale(.96); } }
.notification-toast.animation-slide { animation: pliNotifySlideIn .3s ease-out; }
.notification-toast.animation-fade { animation: pliNotifyFadeIn .3s ease-out; }
.notification-toast.animation-bounce { animation: pliNotifyBounceIn .4s cubic-bezier(.68, -.55, .265, 1.55); }
.notification-toast.removing { animation: pliNotifySlideOut .3s ease-in forwards; }
@media (max-width: 640px) {
  .notification-container { left: 10px !important; right: 10px !important; transform: none !important; }
  .notification-toast { min-width: 0; }
}
