/* Layout: barra com empresa, processo e usuário; à esquerda o editor de etapas (formulários), à direita a planta do fluxo desenhada automaticamente. Administração em painel sobreposto. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fontes/manrope-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fontes/manrope-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fontes/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fontes/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fontes/manrope-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fontes/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fontes/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --sunken: #e4e8ef;
  --ink: #17202e;
  --ink-2: #4a5568;
  --ink-3: #7a8494;
  --line: #d3d9e3;
  --line-strong: #8f9aab;
  --accent: #1f5fd1;
  --accent-ink: #ffffff;
  --accent-soft: #e2ebfb;
  --start: #1d8a5b;
  --start-soft: #e1f3ea;
  --gate: #b86e00;
  --gate-soft: #fdf0db;
  --end: #2b3445;
  --end-soft: #e6e9ef;
  --bad: #c5302c;
  --bad-soft: #fbe5e4;
  --warn: #9a6400;
  --warn-soft: #fbf0d8;
  --d1: #2f6fdb; --d2: #0f8a7e; --d3: #8a4fd0; --d4: #c2410c; --d5: #0e7490; --d6: #a3308a; --d7: #4d7c0f; --d8: #b45309;
  --f-display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 8px;
  --side-bg: #0f3877; --side-ink: #ffffff; --side-ink-2: rgba(255,255,255,.72); --side-hover: rgba(255,255,255,.08); --side-active: rgba(255,255,255,.17); --side-line: rgba(255,255,255,.14);
  --c-pub: #1d8a5b; --c-rev: #1f5fd1; --c-draft: #b86e00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151c; --surface: #1a2029; --sunken: #141922; --ink: #e7ebf2; --ink-2: #aab3c2; --ink-3: #7d8797;
    --line: #2c3441; --line-strong: #5d6878; --accent: #6d9cf0; --accent-ink: #0d1422; --accent-soft: #1d2b44;
    --start: #4cc491; --start-soft: #16302a; --gate: #f0a53a; --gate-soft: #3a2a12; --end: #c9d1de; --end-soft: #252c38;
    --bad: #f07a74; --bad-soft: #3a1c1c; --warn: #e9b44c; --warn-soft: #362a12;
    --d1: #7aa5f2; --d2: #3cc2b3; --d3: #b48cf0; --d4: #f08c5a; --d5: #4cc0dc; --d6: #e07ac8; --d7: #9ccf52; --d8: #eaa64a;
    --side-bg: #0e1a30; --side-ink: #e7ebf2; --side-ink-2: rgba(231,235,242,.68); --side-hover: rgba(255,255,255,.06); --side-active: rgba(109,156,240,.2); --side-line: rgba(255,255,255,.09);
    --c-pub: #34a878; --c-rev: #5b8ae6; --c-draft: #c47c16;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .logo:not(.neg) { --mk-ink: #e7ebf2; --mk-start: #6d9cf0; }
}
:root[data-theme="dark"] {
  --bg: #11151c; --surface: #1a2029; --sunken: #141922; --ink: #e7ebf2; --ink-2: #aab3c2; --ink-3: #7d8797;
  --line: #2c3441; --line-strong: #5d6878; --accent: #6d9cf0; --accent-ink: #0d1422; --accent-soft: #1d2b44;
  --start: #4cc491; --start-soft: #16302a; --gate: #f0a53a; --gate-soft: #3a2a12; --end: #c9d1de; --end-soft: #252c38;
  --bad: #f07a74; --bad-soft: #3a1c1c; --warn: #e9b44c; --warn-soft: #362a12;
  --d1: #7aa5f2; --d2: #3cc2b3; --d3: #b48cf0; --d4: #f08c5a; --d5: #4cc0dc; --d6: #e07ac8; --d7: #9ccf52; --d8: #eaa64a;
  --side-bg: #0e1a30; --side-ink: #e7ebf2; --side-ink-2: rgba(231,235,242,.68); --side-hover: rgba(255,255,255,.06); --side-active: rgba(109,156,240,.2); --side-line: rgba(255,255,255,.09);
  --c-pub: #34a878; --c-rev: #5b8ae6; --c-draft: #c47c16;
  color-scheme: dark;
}
:root[data-theme="dark"] .logo:not(.neg) { --mk-ink: #e7ebf2; --mk-start: #6d9cf0; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.45; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* Barra superior */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 600; font-size: 17px; letter-spacing: .01em; }
.brand svg { width: 22px; height: 22px; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 420px; min-width: 0; }
.picker select { min-width: 0; }
#companySelect { flex: 0 1 200px; }
#procSelect { flex: 1 1 200px; max-width: 340px; }
.co-fixed { font-weight: 600; padding: 0 4px; white-space: nowrap; }
.lbl { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.save { font-size: 12px; color: var(--ink-3); font-family: var(--f-mono); white-space: nowrap; }
.save.err { color: var(--bad); }
.who { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.who img { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.who .nm { font-size: 13px; font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .role { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); display: block; }

/* Controles */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 6px 11px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--line-strong); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.icon-btn { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--ink-3); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
input[type=text], input[type=search], input[type=email], input[type=number], input[type=url], select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; width: 100%; min-width: 0; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--ink-2); opacity: 1; }
textarea { resize: vertical; min-height: 58px; line-height: 1.45; }
input[type=text]:hover:not(:disabled), input[type=email]:hover:not(:disabled), input[type=number]:hover:not(:disabled), input[type=url]:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--line-strong); }
label.f { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Área de trabalho */
.work { flex: 1; display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); min-height: 0; }
.editor { border-right: 1px solid var(--line); background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-width: 0; }
.canvas-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
@media (min-width: 901px) {
  .app { height: 100%; }
  .main { height: 100%; overflow: hidden; }
  .side { height: 100%; overflow-y: auto; }
  .work { overflow: hidden; }
}
@media (max-width: 900px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .editor { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .canvas { min-height: 520px; }
  .who { margin-left: 0; }
}

.meta { display: grid; gap: 10px; }
.meta .name { font-family: var(--f-display); font-size: 21px; font-weight: 600; padding: 6px 9px; }
.meta-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ro-note { font-size: 12px; color: var(--ink-2); background: var(--sunken); border-radius: 6px; padding: 6px 10px; }

/* Painel de IA */
.ai { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; }
.ai h2, .steps-head h2 { margin: 0; font-family: var(--f-display); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-badge { font-family: var(--f-mono); font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 4px; }
.ai textarea { min-height: 76px; }
/* pedido por voz: microfone dentro do campo da IA */
.ai-input { position: relative; }
.ai-input textarea { width: 100%; padding-right: 48px; }
.ai-mic { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); display: grid; place-items: center; cursor: pointer; padding: 0; }
.ai-mic:hover { background: var(--accent-soft); }
.ai-mic:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-mic.live { background: var(--bad); border-color: var(--bad); color: #fff; animation: micPulse 1.4s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, .45); } 50% { box-shadow: 0 0 0 7px rgba(180, 35, 24, 0); } }
@media (prefers-reduced-motion: reduce) { .ai-mic.live { animation: none; } }
.ai-voice { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.ai-voice.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.ai-voice.err { color: var(--bad); }
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-out { font-size: 13px; color: var(--ink-2); display: grid; gap: 8px; }
.ai-out:empty { display: none; }
.ai-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spin { width: 12px; height: 12px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.review { display: grid; gap: 8px; }
.review .sum { color: var(--ink); }
.pt { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: grid; gap: 4px; background: var(--bg); }
.pt-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sev { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; border-radius: 3px; }
.sev.alta { background: var(--bad-soft); color: var(--bad); }
.sev.media { background: var(--warn-soft); color: var(--warn); }
.sev.baixa { background: var(--sunken); color: var(--ink-2); }
.pt b { color: var(--ink); font-weight: 600; }
.code-link { font-family: var(--f-mono); font-size: 11.5px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }

/* Lista de etapas */
.steps-head { display: flex; align-items: baseline; justify-content: space-between; }
.steps-head span { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.step.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.step-sum { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 9px 10px; cursor: pointer; width: 100%; text-align: left; background: none; border: 0; }
.code { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); padding-top: 2px; }
.sum-main { min-width: 0; display: grid; gap: 2px; }
.sum-name { font-weight: 600; overflow-wrap: anywhere; }
.sum-sub { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.tbadge { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.tb-start { background: var(--start-soft); color: var(--start); }
.tb-task { background: var(--accent-soft); color: var(--accent); }
.tb-decision { background: var(--gate-soft); color: var(--gate); }
.tb-end { background: var(--end-soft); color: var(--end); }
.flag { color: var(--bad); font-family: var(--f-mono); font-size: 11px; }
.step-body { padding: 4px 12px 12px; display: grid; gap: 10px; border-top: 1px dashed var(--line); }
.step-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; }
.step-tools .grp { display: flex; gap: 2px; }
.opts { display: grid; gap: 6px; }
.opt { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
.inst-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 16px; color: var(--ink-2); display: grid; gap: 8px; }
.empty b { color: var(--ink); }

/* Planta do fluxo */
.canvas-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 10px; vertical-align: -1px; margin-right: 5px; border: 1.5px solid; }
.lg-start { border-color: var(--start) !important; background: var(--start-soft); border-radius: 6px; }
.lg-task { border-color: var(--line-strong) !important; background: var(--surface); border-radius: 2px; }
.lg-decision { border-color: var(--gate) !important; background: var(--gate-soft); transform: rotate(45deg) scale(.75); }
.lg-end { border-color: var(--end) !important; border-width: 3px !important; background: var(--end-soft); border-radius: 6px; }
.zoom { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.zoom span { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); min-width: 42px; text-align: center; }
.canvas { flex: 1; overflow: auto; position: relative; min-height: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 18px 18px; }
.canvas svg { display: block; margin: 24px auto; }
.canvas .hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); text-align: center; padding: 24px; }
.node { cursor: pointer; }
.node:hover .shape { stroke-width: 2.2; }
.issues { border-top: 1px solid var(--line); background: var(--surface); padding: 10px 16px; display: grid; gap: 6px; max-height: 30%; overflow-y: auto; font-size: 13px; }
.issues:empty { display: none; }
.issues .ok { color: var(--start); font-weight: 500; }
.iss { display: flex; gap: 8px; align-items: baseline; }
.start-hint { color: var(--ink-2, inherit); font-size: 13px; }
.start-hint b { color: var(--accent, inherit); }
.iss .k { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; flex: none; }
.iss.err .k { background: var(--bad-soft); color: var(--bad); }
.iss.warn .k { background: var(--warn-soft); color: var(--warn); }

/* Tela de acesso */
.gate { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.gate-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(460px, 100%); display: grid; gap: 14px; text-align: left; }
.gate-card h1 { margin: 0; font-family: var(--f-display); font-size: 22px; text-wrap: balance; }
.gate-card p { margin: 0; color: var(--ink-2); }
.gate-id { display: flex; gap: 10px; align-items: center; padding: 10px; background: var(--bg); border-radius: 8px; }
.gate-id img { width: 36px; height: 36px; border-radius: 50%; }

/* Administração */
.overlay { position: fixed; inset: 0; background: rgba(10, 14, 22, .45); display: grid; place-items: center; padding: 16px; z-index: 20; }
.sheet { background: var(--surface); border-radius: 12px; border: 1px solid var(--line); width: min(920px, 100%); max-height: 92%; overflow-y: auto; display: grid; grid-template-rows: auto 1fr; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-head h2 { margin: 0; font-family: var(--f-display); font-size: 19px; }
.tabs { display: flex; gap: 4px; background: var(--sunken); padding: 3px; border-radius: 8px; }
.tabs button { border: 0; background: transparent; padding: 5px 14px; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.sheet-body { padding: 16px 18px 20px; display: grid; gap: 18px; align-content: start; }
.sheet-body h3 { margin: 0; font-family: var(--f-display); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.note { font-size: 12px; color: var(--ink-3); }
.sect { display: grid; gap: 10px; }
.search-wrap { position: relative; }
.hits { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; gap: 2px; }
.hits:empty { display: none; }
.hits button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; }
.hits button:hover { background: var(--sunken); }
.hits img, .urow img { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .pn { font-weight: 600; overflow-wrap: anywhere; }
.person .pe { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.utable { display: grid; gap: 6px; }
.urow { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(250px, 1.6fr) auto; gap: 10px 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.urow.off { opacity: .6; }
.perms { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.perms label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.perms input { accent-color: var(--accent); width: 15px; height: 15px; }
.uactions { display: flex; gap: 4px; justify-content: flex-end; }
.req { border-color: var(--warn); background: var(--warn-soft); }
@media (max-width: 760px) { .urow { grid-template-columns: minmax(0, 1fr); } .uactions { justify-content: flex-start; } }
.cos { display: grid; gap: 10px; }
.co { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 10px; background: var(--bg); }
.co.cur { border-color: var(--accent); }
.co-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.co-top input { flex: 1 1 220px; font-weight: 600; }
.co-stats { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--ink-3); width: 20px; height: 20px; border-radius: 50%; }
.chip button:hover { background: var(--sunken); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; }

/* ---------- Telas de acesso ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; background-color: var(--bg);
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: min(400px, 100%); display: grid; gap: 16px; box-shadow: 0 10px 30px rgba(15, 25, 45, .08); }
.auth-card h1 { margin: 0; font-family: var(--f-display); font-size: 22px; text-wrap: balance; }
.auth-card p { margin: 0; color: var(--ink-2); }
.auth-card form { display: grid; gap: 12px; }
.auth-card input { padding: 9px 11px; font-size: 15px; }
.auth-card .btn.primary { justify-content: center; padding: 9px 12px; font-size: 14px; }
.form-err { color: var(--bad); font-size: 13px; min-height: 1em; }
.form-err:empty { display: none; }
input[type=password] { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; width: 100%; min-width: 0; }

/* ---------- Menu do usuário ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px; min-width: 180px; display: grid; box-shadow: 0 8px 24px rgba(15, 25, 45, .14); z-index: 30; }
.menu button { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.menu button:hover { background: var(--sunken); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: #fff; flex: none; }
.who-btn { display: flex; align-items: center; gap: 8px; border: 1px solid transparent; background: transparent; padding: 3px 8px 3px 3px; border-radius: 999px; cursor: pointer; }
.who-btn:hover { background: var(--sunken); }
.conflict { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; font-size: 13px; }

/* ---------- Administração: formulário e tabelas ---------- */
.uform { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.uform .full { grid-column: 1 / -1; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--accent); width: 15px; height: 15px; }
.urow .uname input { font-weight: 600; }
.urow .uname input[type=email] { font-weight: 400; font-size: 13px; }
.urow .ulogin { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.pwd-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; grid-column: 1 / -1; padding-top: 6px; border-top: 1px dashed var(--line); }
.pwd-inline input[type=password] { width: 200px; }
.tag { font-family: var(--f-mono); font-size: 10.5px; padding: 1px 6px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.tag.off { background: var(--sunken); color: var(--ink-3); }
.audit-wrap { overflow-x: auto; }
table.audit { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.audit th, table.audit td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.audit th { font-family: var(--f-display); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
table.audit td.t { font-family: var(--f-mono); white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.small-sheet { width: min(420px, 100%); }

/* ---------- Modos Visualizar / Editar ---------- */
.modes { display: flex; gap: 3px; background: var(--sunken); padding: 3px; border-radius: 8px; }
.modes button { border: 0; background: transparent; padding: 5px 14px; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.modes button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.edit-pick { display: contents; }
.edit-pick[hidden] { display: none !important; }

/* ---------- Visualização ---------- */
.viewer { flex: 1; overflow-y: auto; min-height: 0; background: var(--bg); }
.viewer-in { max-width: 1440px; margin: 0 auto; padding: 24px 16px 56px; display: grid; gap: 20px; }
.v-h1 { margin: 2px 0 0; font-family: var(--f-display); font-size: 28px; font-weight: 600; line-height: 1.15; text-wrap: balance; }
.v-h2 { margin: 0 0 10px; font-family: var(--f-display); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.v-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; }
.v-tools { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 1 760px; min-width: 0; justify-content: flex-end; }
.v-tools input { flex: 1 1 280px; min-width: 200px; padding: 8px 11px; }
.v-count { margin: 0 0 8px; }
.v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.v-card { display: grid; gap: 8px; align-content: start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; cursor: pointer; min-width: 0; }
.v-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(20, 40, 80, .08); }
.v-card-name { font-family: var(--f-display); font-size: 18px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.v-card-desc { color: var(--ink-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.v-card-meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); }
.v-card-upd { font-size: 12px; color: var(--ink-3); }
.v-deps { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.v-dep { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.v-dep.more { color: var(--ink-3); }
.v-top { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.v-back { border: 0; background: none; color: var(--accent); cursor: pointer; font-weight: 500; padding: 4px 0; }
.v-back:hover { text-decoration: underline; }
.v-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.v-hero { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.v-desc { margin: 0; color: var(--ink-2); max-width: 75ch; white-space: pre-line; }
.v-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--ink-2); }
.v-facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.v-warn { font-size: 13px; background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); border-radius: 8px; padding: 8px 12px; }
.v-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .v-body { grid-template-columns: minmax(0, 1fr); } }
.v-chart { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: sticky; top: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 110px); }
@media (max-width: 1100px) { .v-chart { position: static; max-height: 75vh; } }
.v-chart-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.v-canvas { overflow: auto; min-height: 280px; background-color: var(--bg); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.v-canvas svg { display: block; margin: 16px auto; }
.v-tip { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); }
.v-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.v-step { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 8px; scroll-margin: 16px; transition: border-color .2s, box-shadow .2s; }
.v-step.hl { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.v-step.t-decision { border-left: 3px solid var(--gate); }
.v-step h3 { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.v-step-h { display: flex; align-items: center; gap: 8px; }
.v-resp { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.v-inst { margin: 0; font-size: 13.5px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.v-flow { display: grid; gap: 4px; padding-top: 8px; border-top: 1px dashed var(--line); }
.v-branches { display: grid; gap: 4px; }
.v-branch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v-blabel { font-size: 12px; font-weight: 600; background: var(--gate-soft); color: var(--ink); border: 1px solid var(--gate); border-radius: 4px; padding: 0 7px; }
.v-arrow { color: var(--ink-3); }
.v-link { border: 0; background: none; padding: 0; cursor: pointer; color: var(--accent); font-size: 13px; text-align: left; }
.v-link:hover { text-decoration: underline; }
.v-link .code { padding: 0; }

/* ---------- Impressão do processo ---------- */
@media print {
  body, .viewer { background: #fff !important; }
  .app { display: block !important; }
  .main { height: auto !important; overflow: visible !important; }
  .side, .home,
  .bar, .v-top, .v-chart-bar, .v-tip, .issues { display: none !important; }
  .app { height: auto !important; }
  .viewer { overflow: visible !important; }
  .viewer-in { padding: 0; max-width: none; }
  .v-body { grid-template-columns: 1fr !important; }
  .v-chart { position: static !important; max-height: none !important; border: 0; }
  .v-canvas { overflow: visible !important; background: none !important; }
  .v-canvas svg { width: 100% !important; height: auto !important; margin: 0; }
  .v-step { break-inside: avoid; }
  .v-hero { border: 0; padding: 0; }
}

.sheet-body code { font-family: var(--f-mono); font-size: 11.5px; background: var(--sunken); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

/* ---------- Botões liga/desliga ---------- */
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- Busca e filtros do catálogo ---------- */
.v-tools select { flex: 0 1 210px; width: auto; min-width: 150px; padding: 8px 10px; }
.v-found { font-size: 12.5px; color: var(--ink-2); background: var(--accent-soft); border-radius: 6px; padding: 4px 8px; }
.v-found b { color: var(--accent); font-weight: 600; }

/* ---------- Histórico de versões ---------- */
.hist { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .hist { grid-template-columns: minmax(0, 1fr); } }
.hist-list { display: grid; gap: 4px; max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.hist-item { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; cursor: pointer; display: grid; gap: 2px; }
.hist-item:hover { border-color: var(--line-strong); }
.hist-item[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.hist-item .when { font-family: var(--f-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.hist-item .who { font-size: 12.5px; color: var(--ink-2); }
.hist-item .nt { font-size: 12px; color: var(--ink-3); }
.hist-detail { display: grid; gap: 12px; min-width: 0; }
.hist-canvas { border: 1px solid var(--line); border-radius: 8px; max-height: 42vh; overflow: auto; background-color: var(--bg); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.hist-canvas svg { display: block; margin: 12px auto; }
.diff { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.diff li { display: flex; gap: 8px; align-items: baseline; }
.diff .k { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; flex: none; }
.diff .add .k { background: var(--start-soft); color: var(--start); }
.diff .del .k { background: var(--bad-soft); color: var(--bad); }
.diff .chg .k { background: var(--warn-soft); color: var(--warn); }

/* Situação do processo (rascunho, em revisão, publicado) e dono */
.gov { display: grid; gap: 8px; border: 1px solid var(--line); border-left: 4px solid var(--ink-3); border-radius: 8px; padding: 10px 12px; background: var(--surface); margin: 0 0 12px; }
.gov.st-publicado { border-left-color: var(--start); }
.gov.st-em_revisao { border-left-color: var(--accent); }
.gov.st-rascunho { border-left-color: var(--gate); }
.gov-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.gov-txt { font-size: 13px; color: var(--ink-2); flex: 1 1 260px; min-width: 0; }
.gov-note { font-size: 13px; background: var(--sunken); border-radius: 6px; padding: 6px 10px; overflow-wrap: anywhere; }
.gov-foot { justify-content: space-between; }
.gov-owner { font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gov-owner select { width: auto; max-width: 100%; }
.gov-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.gov-form { display: grid; gap: 6px; }
.gov-form:empty { display: none; }
.st-badge { display: inline-block; font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 3px; white-space: nowrap; }
.st-badge.st-publicado { background: var(--start-soft); color: var(--start); }
.st-badge.st-em_revisao { background: var(--accent-soft); color: var(--accent); }
.st-badge.st-rascunho { background: var(--gate-soft); color: var(--warn); }
.st-badge.st-me { background: var(--accent); color: var(--accent-ink); }
.st-sub { font-size: 11.5px; color: var(--ink-3); }
.tag.pub { background: var(--start-soft); color: var(--start); }
.v-card-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 0; }
.v-card-top:empty { display: none; }
.v-cc { font-size: 11.5px; color: var(--ink-2); background: var(--sunken); border-radius: 999px; padding: 1px 8px; }
.v-pend { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-size: 13.5px; }
#govView .gov { margin: 4px 0 0; }

/* Comentários e sugestões */
.lnk { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
.btn.ghost.danger-txt, .danger-txt { color: var(--bad); }
.v-step-c { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px dashed var(--line); padding-top: 8px; }
.vc-count { border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; padding: 1px 8px; cursor: pointer; }
.v-comments { display: grid; gap: 14px; margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; scroll-margin: 16px; }
.vc-head { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: flex-end; }
.vc-head .v-h2 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 12px; cursor: pointer; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.vc-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; background: var(--sunken); border-radius: 8px; padding: 12px; }
.vc-kinds { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; }
.vc-kinds label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.vc-text { grid-column: 1 / -1; }
.vc-send { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 700px) { .vc-form { grid-template-columns: minmax(0, 1fr); } }
.vc-list { display: grid; gap: 10px; }
.vc-item { border: 1px solid var(--line); border-left: 3px solid var(--ink-3); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; }
.vc-item.k-suggestion { border-left-color: var(--accent); }
.vc-item.s-accepted { border-left-color: var(--start); }
.vc-item.s-rejected, .vc-item.s-resolved { opacity: .85; }
.vc-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.vc-kind { font-weight: 600; }
.vc-st { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 3px; background: var(--sunken); color: var(--ink-2); }
.vc-st.s-open { background: var(--gate-soft); color: var(--warn); }
.vc-st.s-accepted { background: var(--start-soft); color: var(--start); }
.vc-st.s-rejected { background: var(--bad-soft); color: var(--bad); }
.vc-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.vc-meta { font-size: 12px; color: var(--ink-3); }
.vc-res { font-size: 13px; background: var(--sunken); border-radius: 6px; padding: 6px 10px; overflow-wrap: anywhere; }
.vc-replies { display: grid; gap: 6px; border-left: 2px solid var(--line); padding-left: 10px; margin-left: 2px; }
.vc-reply { display: grid; gap: 2px; }
.vc-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.vc-inline { display: grid; gap: 6px; }
.vc-inline:empty { display: none; }
@media print { .v-comments, .v-step-c, .gov-acts, .gov-form, .gov select { display: none !important; } }

/* Administração: Personalização de IA e E-mail */
.ai-state { display: grid; gap: 2px; border-radius: 8px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--ink-3); font-size: 13.5px; }
.ai-state.on { border-left-color: var(--start); background: var(--start-soft); }
.ai-state.off { border-left-color: var(--gate); background: var(--gate-soft); }
.ai-state span { color: var(--ink-2); overflow-wrap: anywhere; }
.model-list { display: grid; gap: 8px; }
.model-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); cursor: pointer; }
.model-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.model-opt > input { margin-top: 3px; }
.model-opt > span { display: grid; gap: 2px; min-width: 0; flex: 1; }
.model-opt code { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.model-opt input[type=text] { margin-top: 4px; }
#aiKeyForm input { font-family: var(--f-mono); }
#adminBody textarea { width: 100%; }
.model-opt .tag { justify-self: start; }

/* ---------- Menu lateral ---------- */
.side { background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; gap: 18px; padding: 18px 12px 12px; min-width: 0; }
.side-brand { display: flex; align-items: center; padding: 2px 8px; }
.side-co { display: grid; gap: 5px; padding: 12px; border-radius: 10px; background: var(--side-hover); border: 1px solid var(--side-line); }
.side-lbl { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-ink-2); }
.side-co .co-fixed { padding: 0; font-size: 14.5px; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.side-co select { background: transparent; color: var(--side-ink); border: 1px solid var(--side-line); font-weight: 600; padding: 6px 8px; }
.side-co select:hover:not(:disabled) { border-color: var(--side-ink-2); }
.side-co select option { color: #17202e; background: #fff; }
.side-nav { display: grid; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: transparent; color: var(--side-ink-2); padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap; }
.side-link svg { width: 19px; height: 19px; flex: none; }
.side-link:hover { background: var(--side-hover); color: var(--side-ink); }
.side-link[aria-current="page"] { background: var(--side-active); color: var(--side-ink); font-weight: 600; }
.side-link:focus-visible, .side .who-btn:focus-visible { outline-color: var(--side-ink); }
.side-foot { margin-top: auto; margin-left: 0; border-top: 1px solid var(--side-line); padding-top: 10px; display: block; }
.side-foot .menu-wrap { width: 100%; }
.side .who-btn { width: 100%; border-radius: 10px; padding: 7px 8px; color: var(--side-ink); gap: 10px; }
.side .who-btn:hover { background: var(--side-hover); }
.who-txt { text-align: left; min-width: 0; flex: 1; display: grid; }
.side .who .nm { max-width: none; font-size: 13.5px; font-weight: 600; }
.side .who .role { color: var(--side-ink-2); font-family: var(--f-body); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-caret { width: 16px; height: 16px; flex: none; color: var(--side-ink-2); }
.side .avatar { width: 34px; height: 34px; font-size: 13px; box-shadow: 0 0 0 2px var(--side-line); }
.side .menu { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; min-width: 0; color: var(--ink); }
.bar-title { margin: 0; font-family: var(--f-display); font-size: 18px; font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 16px; }
  .side-brand { padding: 0; }
  .side-brand .logo { font-size: 21px; }
  .side-co { order: 3; flex: 1 1 100%; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; }
  .side-nav { order: 4; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px; }
  .side-link { width: auto; padding: 7px 10px; }
  .side-foot { order: 2; margin: 0 0 0 auto; border: 0; padding: 0; width: auto; }
  .side-foot .menu-wrap { width: auto; }
  .side .who-txt, .who-caret { display: none; }
  .side .menu { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; min-width: 190px; }
}

/* ---------- Painel inicial ---------- */
.home { flex: 1; overflow-y: auto; min-height: 0; background: var(--bg); }
.home-in { max-width: 1320px; margin: 0 auto; padding: 24px 16px 56px; display: grid; gap: 16px; }
.dash-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.dash-head h2 { margin: 2px 0 0; font-family: var(--f-display); font-size: 27px; font-weight: 600; line-height: 1.15; text-wrap: balance; }
.dash-head p { margin: 4px 0 0; color: var(--ink-2); }
.dash-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-acts .btn { padding: 8px 14px; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { display: grid; gap: 4px; align-content: start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
button.kpi { cursor: pointer; }
button.kpi:hover { border-color: var(--line-strong); box-shadow: 0 4px 16px rgba(20, 40, 80, .07); }
.kpi-lbl { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.kpi-val { font-family: var(--f-display); font-size: 32px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi-sub { font-size: 12.5px; color: var(--ink-3); }
.kpi-sub b { color: var(--ink-2); font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.sw.pub { background: var(--c-pub); } .sw.rev { background: var(--c-rev); } .sw.draft { background: var(--c-draft); } .sw.all { background: var(--ink-3); }
.dash-row { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1050px) { .dash-row { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.panel-h { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: space-between; }
.panel-h h3 { margin: 0; font-family: var(--f-display); font-size: 16px; font-weight: 600; }
.panel-h .note { margin: 0; }
.leg { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.leg span { display: inline-flex; align-items: center; gap: 6px; }
.dbars { display: grid; gap: 2px; }
.dbar { display: grid; grid-template-columns: minmax(96px, 190px) minmax(0, 1fr) 34px; gap: 12px; align-items: center; width: 100%; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.dbar:hover { background: var(--sunken); }
.dbar-name { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.dbar-name.none { color: var(--ink-3); font-style: italic; }
.dbar-track { display: flex; gap: 2px; height: 14px; align-items: stretch; border-left: 1px solid var(--line-strong); }
.dbar-track > i { display: block; min-width: 3px; }
.dbar-track > i:last-child { border-radius: 0 4px 4px 0; }
.dbar-track .pub { background: var(--c-pub); } .dbar-track .rev { background: var(--c-rev); } .dbar-track .draft { background: var(--c-draft); }
.dbar-val { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.dbar-val.zero { color: var(--ink-3); font-weight: 400; }
.donut-wrap { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: center; justify-content: center; }
.donut-wrap .donut { flex: none; }
.donut { width: 150px; height: 150px; display: block; }
.donut circle { cursor: default; }
.donut-c1 { font-family: var(--f-display); font-size: 30px; font-weight: 600; fill: var(--ink); }
.donut-c2 { font-size: 11.5px; fill: var(--ink-3); }
.dleg { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; flex: 1 1 190px; min-width: 0; }
.dleg button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13.5px; }
.dleg button:hover { background: var(--sunken); }
.dleg .n { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.dleg button > span:first-of-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dleg .pc { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.dlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dlist button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; width: 100%; border: 0; background: transparent; padding: 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.dlist button:hover { background: var(--sunken); }
.dl-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-sub { grid-column: 1 / 2; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-right { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.dash-empty { color: var(--ink-3); font-size: 13px; padding: 4px 8px; }
.dash-tbl summary { cursor: pointer; font-size: 12.5px; color: var(--accent); width: fit-content; }
.dash-tbl table { margin-top: 8px; }
.dash-tbl td.n, .dash-tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.dash-tip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12.5px; line-height: 1.4; padding: 7px 10px; border-radius: 7px; box-shadow: 0 6px 18px rgba(10, 15, 25, .25); max-width: 260px; }
.dash-tip b { font-weight: 600; }
.dash-row.eq { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1050px) { .dash-row.eq { grid-template-columns: minmax(0, 1fr); } }
.dbar.static { cursor: default; }
.dbar.static:hover { background: transparent; }
@media (max-width: 560px) { .dbar { grid-template-columns: minmax(0, 44%) minmax(0, 1fr) 26px; gap: 8px; padding: 7px 4px; } }

/* ---------- painel da plataforma ---------- */
.plat { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.plat-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 10px 16px; background: var(--side-bg); color: var(--side-ink); position: sticky; top: 0; z-index: 5; }
.plat-bar .tabs { background: var(--side-hover); }
.plat-bar .tabs button { color: var(--side-ink-2); }
.plat-bar .tabs button[aria-selected="true"] { background: var(--side-active); color: var(--side-ink); box-shadow: none; }
.plat-bar .btn { background: transparent; color: var(--side-ink); border-color: var(--side-line); }
.plat-bar .btn:hover { background: var(--side-hover); }
.plat-tag { font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: var(--gate); color: #fff; }
.plat-who { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--side-ink-2); }
.plat-main { flex: 1; }
.plat-in { max-width: 1320px; margin: 0 auto; padding: 24px 16px 56px; display: grid; gap: 16px; }
.plat-sheet { max-width: 560px; }
.plat-sheet h3 { margin: 6px 0 0; font-family: var(--f-display); font-size: 16px; font-weight: 600; }
.acc-table td { vertical-align: top; }
.acc-table .note { font-size: 12px; margin: 2px 0 0; }
.acc-st { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-active { background: var(--start-soft); color: var(--start); }
.st-trial { background: var(--accent-soft); color: var(--accent); }
.st-suspended { background: var(--bad-soft); color: var(--bad); }
.cred { margin: 0; padding: 12px 14px; background: var(--sunken); border-radius: var(--r); font-family: var(--f-mono); font-size: 13px; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 720px) { .plat-who { margin-left: 0; width: 100%; } .plat-who span { flex: 1; } }

/* ---------- aviso de acesso de suporte (sistema principal) ---------- */
.support-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 16px; background: var(--gate); color: #fff; font-size: 14px; }
.support-banner b { font-weight: 600; }
.support-banner .btn { margin-left: auto; background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.5); }
.plat a.btn { text-decoration: none; }

/* ---------- marca da conta e avisos do plano ---------- */
.side-brand .brand-logo { display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 8px; padding: 6px 10px; max-width: 100%; }
.side-brand .brand-logo img { display: block; max-height: 40px; max-width: 100%; object-fit: contain; }
.side-brand.has-logo { flex-direction: column; align-items: flex-start; gap: 6px; }
.side-brand .brand-sub { display: flex; padding: 0 2px; opacity: .85; }
.plan-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 16px; font-size: 14px; background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid var(--warn); }
.plan-banner.full { background: var(--bad-soft); border-bottom-color: var(--bad); }
.plan-banner .btn { margin-left: auto; }
.usage { display: grid; gap: 10px; }
.usage-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.usage-bar { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.usage-bar i { display: block; height: 100%; border-radius: 999px; background: var(--c-pub); }
.usage-bar i.warn { background: var(--gate); }
.usage-bar i.full { background: var(--bad); }
.usage-row .n { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.brand-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.brand-prev { display: grid; gap: 8px; padding: 14px; border-radius: 10px; color: #fff; min-height: 90px; align-content: start; }
.brand-prev .brand-logo { display: inline-flex; background: #fff; border-radius: 8px; padding: 6px 10px; justify-self: start; }
.brand-prev .brand-logo img { max-height: 40px; max-width: 200px; display: block; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button { width: 26px; height: 26px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.swatches button[aria-pressed="true"] { border-color: var(--ink); }
@media (max-width: 600px) { .usage-row { grid-template-columns: 1fr auto; } .usage-row .usage-bar { grid-column: 1 / -1; grid-row: 2; } }
#adminSheet .sheet-head #adminClose { margin-left: auto; }

/* ---------- Marca Trilha ---------- */
.logo { --mk-ink: #0f3877; --mk-start: #1f5fd1; --mk-hole: var(--surface); display: inline-flex; align-items: center; gap: .27em; line-height: 1; color: var(--mk-ink); }
.logo.neg { --mk-ink: #ffffff; --mk-start: #8fb4ff; --mk-hole: var(--side-bg); }
.logo .mk { width: 1.17em; height: 1.17em; flex: none; display: block; }
.mk .l { fill: none; stroke: var(--mk-ink); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.mk .k { fill: var(--mk-ink); }
.mk .s { fill: var(--mk-start); }
.mk .d { fill: #d68a1a; }
.mk .h { fill: var(--mk-hole); }
.wm { font-family: "Manrope", var(--f-display); font-weight: 800; letter-spacing: -.035em; line-height: 1; white-space: nowrap; }
.wm-o { position: relative; display: inline-block; }
.wm-o::after { content: ""; position: absolute; left: 50%; margin-left: -.11em; top: .093em; width: .26em; height: .173em; background: #d68a1a;
  clip-path: polygon(13.3% 100%, 53.3% 0, 93.3% 0, 53.3% 100%); }
.auth-brand { display: grid; gap: 8px; justify-items: start; }
.auth-brand .logo { font-size: 32px; }
.auth-brand .slogan { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.side-brand .logo { font-size: 25px; }
.side-brand .brand-sub .logo { font-size: 14px; }
.brand-prev .logo { font-size: 22px; }
.plat-bar .brand .logo { font-size: 22px; }

/* assinatura */
.auth-card.wide { width: min(760px, 100%); }
.bill-box { display: grid; gap: 12px; }
.bill-status { padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.bill-status.ok { background: var(--start-soft, #e6f4ec); border-color: var(--start, #1e8e5a); }
.bill-status.bad { background: var(--bad-soft); border-color: var(--bad); }
.bill-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bill-ok { color: var(--start, #1e8e5a) !important; margin: 0; }
.bill-cycle { display: flex; gap: 6px; flex-wrap: wrap; }
.bill-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.bill-plan { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); position: relative; }
.bill-plan input { position: absolute; top: 12px; right: 12px; }
.bill-plan.on { border-color: var(--accent, #1f5fd1); box-shadow: 0 0 0 1px var(--accent, #1f5fd1) inset; }
.bill-plan.off { opacity: .55; cursor: not-allowed; }
.bill-price { font-size: 20px; font-weight: 800; color: var(--ink); }
.bill-price small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
@media (max-width: 640px) { .bill-box .row2 { grid-template-columns: 1fr; } }

/* idioma (03/10/2026): troca no menu do usuário e nas telas de acesso */
#mLang .lang-es { display: none; }
html[lang="es"] #mLang .lang-pt { display: none; }
html[lang="es"] #mLang .lang-es { display: inline; }
.auth { align-content: center; gap: 14px; }
.auth-lang { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: var(--ink-2); }
.auth-lang button { background: none; border: 0; padding: 4px 6px; font: inherit; color: var(--ink-2); cursor: pointer; border-radius: 6px; }
.auth-lang button:hover { color: var(--accent, #1f5fd1); }
.auth-lang button[aria-current="true"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* painel da plataforma: dois tokens da IA (principal e reserva) */
.tok-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tok { display: grid; gap: 8px; align-content: start; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface); min-width: 0; }
.tok.on { border-color: var(--start); box-shadow: inset 4px 0 0 var(--start); }
.tok-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tok-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--line); color: var(--ink-2); white-space: nowrap; }
.tok-pill.on { background: var(--start-soft); color: var(--start); }
.tok-pill.paused { background: var(--gate-soft); color: var(--ink); }
.tok-use { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13.5px; }
.tok-use .lbl { width: 100%; }
.tok-sec { margin: 6px 0 0; font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tok-sec .note { font-weight: 400; }
.tok-hint { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; line-height: 1.5; align-self: start; }
.tok-warn { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: #fbe6e3; color: #8a2a20; border: 1px solid #f0c4bd; }
.tok .inline-add input { min-width: 0; flex: 1; }
@media (max-width: 860px) { .tok-grid { grid-template-columns: 1fr; } }
.tok-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
.tok-form .f { min-width: 0; }
.tok-form .f input, .tok-form .f select { width: 100%; min-width: 0; }
.tok-form .gov-acts { grid-column: 1 / -1; }
.tok-form [hidden] { display: none; }
@media (max-width: 560px) { .tok-form { grid-template-columns: 1fr; } }
.tok-form .tok-key { grid-column: 1 / -1; }

/* Novo processo: escolha de como começar */
.new-choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; font: inherit; color: var(--ink); position: relative; }
.choice:hover, .choice:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.choice-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.choice-tx { display: grid; gap: 3px; }
.choice-tx b { font-size: 15px; }
.choice-tx span { font-size: 13px; color: var(--ink-2); }
.choice .tag { position: absolute; top: 10px; right: 10px; }
/* menu "Mais" dos downloads */
.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); padding: 6px; display: grid; gap: 2px; width: 280px; }
.more-menu .lnk { text-align: left; padding: 8px 10px; border-radius: 6px; font-size: 13px; text-decoration: none; color: var(--ink); }
.more-menu .lnk:hover { background: var(--sunken); }
/* saldo de IA no assistente */
.ai-bal { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.ai-bal.low { color: var(--warn); }
.ai-bal.zero { color: var(--bad); }
/* primeiros passos */
.ex-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; align-items: center; background: var(--gate-soft); border: 1px solid var(--line); border-left: 4px solid var(--gate); border-radius: var(--r); padding: 14px 18px; margin-bottom: 16px; }
.ex-box h3 { margin: 0 0 4px; font-size: 15.5px; }
.ex-box p { margin: 0 0 4px; font-size: 14px; line-height: 1.5; }
.ex-acts { display: flex; flex-direction: column; gap: 8px; }
.ex-box .form-err { grid-column: 1 / -1; }
.ex-box .form-err:empty { display: none; }
@media (max-width: 760px) { .ex-box { grid-template-columns: 1fr; } .ex-acts { flex-direction: row; flex-wrap: wrap; } }
.onb { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 12px; margin-bottom: 16px; }
.onb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.onb-head h3 { margin: 0; font-size: 16px; }
.onb-bar { height: 6px; background: var(--sunken); border-radius: 99px; overflow: hidden; }
.onb-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.onb-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.onb-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.onb-item.done { background: var(--sunken); }
.onb-ck { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; color: #fff; margin-top: 1px; }
.onb-item.done .onb-ck { background: var(--start); border-color: var(--start); }
.onb-tx { display: grid; gap: 2px; flex: 1; }
.onb-tx b { font-size: 14px; }
.onb-item.done .onb-tx b { text-decoration: line-through; color: var(--ink-2); }
.onb-tx span { font-size: 12.5px; color: var(--ink-2); }
.onb-item .btn { align-self: center; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* biblioteca de modelos */
.sheet.tpl-wide { width: min(860px, calc(100vw - 32px)); }
.tpl-body { display: grid; gap: 14px; }
.tpl-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tpl-area { margin: 6px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.tpl-card { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; align-content: start; background: var(--surface); }
.tpl-card h4 { margin: 0; font-size: 15px; }
.tpl-card p { margin: 0; font-size: 13px; color: var(--ink-2); }
.tpl-meta { font-size: 12px; color: var(--ink-3); }
.tpl-card details summary { cursor: pointer; font-size: 12.5px; color: var(--accent); }
.tpl-card ol { margin: 6px 0 0; padding-left: 20px; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 2px; }
.tpl-card .btn { justify-self: start; margin-top: 4px; }

/* ---------- Detalhes da etapa e dados do POP ---------- */
.step-more, .pop-meta { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.step-more > summary, .pop-meta > summary { cursor: pointer; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--ink); list-style-position: inside; }
.step-more > summary .note, .pop-meta > summary .note { font-weight: 400; }
.step-more-in, .pop-meta-in { display: grid; gap: 10px; padding: 4px 10px 12px; }
.pop-meta > p.note { margin: 0; padding: 0 10px 6px; }
.more-n { font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.v-extra { margin: 0; display: grid; gap: 6px; background: var(--sunken); border-radius: 8px; padding: 10px 12px; }
.v-extra > div { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); gap: 10px; }
.v-extra dt { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.v-extra dd { margin: 0; font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere; }
.v-extra a { color: var(--accent); }
@media (max-width: 560px) { .v-extra > div { grid-template-columns: minmax(0, 1fr); gap: 1px; } }

/* ---------- Ciência dos funcionários ---------- */
.ack { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.ack-todo { background: var(--warn-soft); border: 1px solid var(--warn); }
.ack-ok { background: var(--sunken); color: var(--ink-2); }
.ack .err-txt { color: var(--danger, #c0392b); font-size: 12.5px; flex-basis: 100%; }
.ack-panel { border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.ack-panel > summary { cursor: pointer; padding: 9px 12px; font-size: 13.5px; }
.ack-panel > p.note { margin: 0; padding: 0 12px 10px; }
.ack-list { list-style: none; margin: 0; padding: 0 12px 8px; display: grid; gap: 2px; }
.ack-list li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ack-list .nm { font-weight: 600; overflow-wrap: anywhere; }
.ack-y { color: var(--c-pub); font-size: 12.5px; }
.ack-n { color: var(--c-draft); font-size: 12.5px; font-weight: 600; }
@media (max-width: 560px) { .ack-list li { grid-template-columns: minmax(0, 1fr) auto; } .ack-list li .note { grid-column: 1; grid-row: 2; } }
.st-badge.st-read { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); }
.read-panel { border-color: var(--warn); }
@media print { #ackBox, .v-more { display: none !important; } }

/* ---------- Celular: barra de cima enxuta, navegação fixa embaixo e leitura confortável ---------- */
.v-more, .sl-short { display: none; }
@media (max-width: 640px) {
  .side { position: sticky; top: 0; z-index: 20; padding: 8px 12px; gap: 8px; flex-wrap: nowrap; }
  .side-brand .logo { font-size: 18px; }
  .side-co { order: 2; flex: 1 1 auto; min-width: 0; grid-template-columns: minmax(0, 1fr); background: transparent; border: 0; padding: 0; }
  .side-co .side-lbl { display: none; }
  .side-co select { padding: 5px 6px; font-size: 13px; }
  .side-co .co-fixed { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-foot { order: 3; margin: 0; }
  .side .avatar { width: 30px; height: 30px; font-size: 12px; }
  .side-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; order: 9; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
    background: var(--side-bg); border-top: 1px solid var(--side-line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .side-link { flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 11px; line-height: 1.15; text-align: center; white-space: nowrap; }
  .side-link[hidden] { display: none; }
  .side-link svg { width: 22px; height: 22px; }
  #navHelp { display: none; } .menu #mHelp { display: block; }
  .sl-long { display: none; } .sl-short { display: inline; }
  .main { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .bar { position: static; padding: 8px 12px; gap: 8px; }
  .bar-title { font-size: 16px; }
  .home-in, .viewer-in { padding: 14px 12px 28px; gap: 14px; }
  .dash-head h2 { font-size: 22px; }
  .kpi { padding: 12px 14px; } .kpi-val { font-size: 26px; }
  .v-top { gap: 8px; }
  .v-actions { gap: 6px; width: 100%; }
  .v-actions .btn { flex: 1 1 auto; }
  .v-actions:not(.all) .v-sec { display: none; }
  .v-more { display: inline-flex; justify-content: center; }
  .v-hero { padding: 14px; gap: 8px; }
  .v-h1 { font-size: 22px; }
  .v-facts { gap: 4px 14px; font-size: 12.5px; }
  .v-chart { max-height: 55vh; }
  .v-canvas { min-height: 220px; }
  .v-step { padding: 12px; }
  .v-step h3 { font-size: 16px; }
  .v-inst { font-size: 15px; line-height: 1.55; }
  .v-tools input { min-width: 0; flex-basis: 100%; }
  .v-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .v-card { padding: 12px 14px; }
}

/* ---------- Plataforma → Gestão (fluxo de caixa) ---------- */
:root { --fin-in: #2a78d6; --fin-out: #eb6834; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fin-in: #3987e5; --fin-out: #d95926; } }
:root[data-theme="dark"] { --fin-in: #3987e5; --fin-out: #d95926; }
.sw.fin-in, .fin-chart .fin-in { background: var(--fin-in); fill: var(--fin-in); }
.sw.fin-out, .fin-chart .fin-out { background: var(--fin-out); fill: var(--fin-out); }
.fin-period { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.fin-period .f { min-width: 160px; }
.fin-chart { width: 100%; max-width: 900px; height: auto; display: block; margin: 4px 0 8px; }
.dash-acts a.btn { color: inherit; text-decoration: none; }
.fin-chart .fin-grid { stroke: var(--line); stroke-width: 1; }
.fin-chart .fin-ax { fill: var(--ink-3); font-size: 11px; font-family: var(--f-body); }
.fin-chart .fin-hit { fill: transparent; cursor: pointer; }
.fin-chart .fin-g:hover .fin-hit { fill: var(--sunken); }
.fin-tbl tr[data-m] { cursor: pointer; }
.fin-tbl tr.sel td { background: var(--accent-soft); }
.fin-tbl tr.tot td { border-top: 2px solid var(--line-strong); }
.kpi-val.neg, td.neg { color: #c0392b; }
.fin-k { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.fin-k { color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; padding-left: 0; }
.fin-k::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--fin-in); }
.fin-k.out::before { background: var(--fin-out); }
.fin-st { font-size: 12.5px; white-space: nowrap; color: var(--ink-2); }
.fin-st.ok { color: var(--c-pub); font-weight: 600; }
.fin-st.late { color: #c0392b; font-weight: 600; }

/* ---------- Controle de documentos: código, anexos, lista mestra ---------- */
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row input { flex: 1; min-width: 0; }
.files-box { display: grid; gap: 8px; padding: 4px 10px 12px; }
.files-list, .v-files ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.files-list li, .v-files li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13.5px; }
.files-list a, .v-files a { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.files-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.files-add input[type=text], .files-add input[type=url] { flex: 1 1 160px; min-width: 0; }
.files-add input[type=file] { flex: 1 1 200px; font-size: 13px; }
.danger-lnk { color: var(--danger, #c0392b) !important; }
.v-files { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.ml-cfg { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: end; }
.ml-cfg .f { min-width: 230px; }
.ml-due { color: #c0392b; font-weight: 600; }
.ml-tbl td { vertical-align: top; }
div.f { display: grid; gap: 4px; }
div.f > label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.v-actions a.btn, .dash-acts a.btn { text-decoration: none; color: inherit; }
.v-actions a.btn.primary { color: var(--accent-ink, #fff); }

/* ===== Gestão por processos: riscos, vínculos, mapa e indicadores (ISO 9001 4.4, 6.1, 6.2, 9.1) ===== */
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .row3 { grid-template-columns: 1fr; } }
.risks-box { display: grid; gap: 10px; padding: 4px 10px 12px; }
.risk { display: grid; gap: 8px; border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.risk.opp { border-left-color: var(--start); }
.risk .row3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.risk-top { display: flex; align-items: center; gap: 10px; }
.risk-top select { width: auto; }
.risk-top .icon-btn { margin-left: auto; }
.risk-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.risk-lvl { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.lvl-baixo { background: var(--start-soft); color: var(--start); border-color: var(--start); }
.lvl-medio { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.lvl-alto { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.v-macro { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.v-macro:hover { text-decoration: underline; }
.v-rel { display: grid; gap: 14px; margin-top: 20px; }
.v-rel:empty, .v-rel > div:empty { display: none; }
.v-rel > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
a.btn { text-decoration: none; }
.v-h2-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.risk-tbl td { vertical-align: top; }
.rel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
@media (max-width: 640px) { .rel-grid { grid-template-columns: 1fr; } }
.rel-col ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.rel-col .lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* farol: verde / amarelo / vermelho / sem lançamento (sempre com texto ao lado, nunca só a cor) */
.l-verde { --farol: var(--start); --farol-soft: var(--start-soft); }
.l-amarelo { --farol: var(--warn); --farol-soft: var(--warn-soft); }
.l-vermelho { --farol: var(--bad); --farol-soft: var(--bad-soft); }
.l-sem { --farol: var(--ink-3); --farol-soft: var(--sunken); }
.ind-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--farol, var(--ink-3)); flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--farol, var(--ink-3)); }
.ind-light { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ind-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ind-chip { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--farol); background: var(--surface); border-radius: 8px; padding: 9px 12px; cursor: pointer; color: var(--ink); font: inherit; }
.ind-chip:hover { border-color: var(--accent); border-left-color: var(--farol); }
.ind-chip .ind-dot { margin-top: 4px; }
.ind-chip-t { display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-2); }
.ind-chip-t b { color: var(--ink); font-size: 13.5px; }
.ind-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.ind-sum-i { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); background: var(--farol-soft); border-radius: 999px; padding: 4px 12px 4px 10px; }
.ind-sum-i b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ind-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.ind-tools select { width: auto; max-width: 100%; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ind-card { display: grid; gap: 8px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--farol); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.ind-card.off { opacity: .7; }
.ind-h { display: flex; align-items: center; gap: 9px; }
.ind-h h3 { margin: 0; font-family: var(--f-display); font-size: 16px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.ind-proc { font-size: 12.5px; color: var(--ink-2); }
.ind-val { display: flex; align-items: baseline; gap: 8px; }
.ind-val b { font-family: var(--f-display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.1; }
.ind-val span { font-size: 12.5px; color: var(--ink-3); }
.ind-goal { font-size: 12.5px; color: var(--ink-2); }
.ind-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ind-svg text { font-family: var(--f-body); }
.ind-svg.sm { height: 54px; }
.ind-act { display: flex; flex-wrap: wrap; gap: 6px; }
.ind-pend { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--warn); }
.ind-wide { width: min(860px, 100%); }
.ind-sheet { display: grid; gap: 14px; }
.ind-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); align-items: center; }
.ind-chart-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px 6px; background: var(--surface); }
.ind-launch { border: 1px solid var(--accent); border-radius: 10px; padding: 12px 14px; background: var(--accent-soft); }
.ind-launch h3, .ind-sheet .sect h3 { margin: 0; font-size: 14px; }
.ind-manage { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* mapa de processos: faixas de gestão, principais (cadeia de valor) e apoio */
.pmap { display: grid; gap: 10px; }
.pm-band { --band: var(--accent); display: grid; grid-template-columns: 190px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--band); border-radius: 12px; overflow: hidden; }
.pm-gestao { --band: var(--d3); }
.pm-principal { --band: var(--accent); }
.pm-apoio { --band: var(--start); }
.pm-none { --band: var(--ink-3); border-style: dashed; border-left-style: solid; }
.pm-lbl { display: grid; align-content: center; gap: 4px; padding: 14px 16px; background: color-mix(in srgb, var(--band) 9%, var(--surface)); }
.pm-lbl b { font-family: var(--f-display); font-size: 15px; color: var(--ink); }
.pm-lbl span { font-size: 12px; color: var(--ink-2); }
.pm-cards { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; padding: 14px; }
.pm-card { position: relative; display: grid; gap: 3px; align-content: start; text-align: left; width: 210px; min-height: 76px; border: 1px solid var(--line); border-top: 3px solid var(--band); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 9px 12px; cursor: pointer; font: inherit; transition: opacity .15s, box-shadow .15s; }
.pm-card:hover { box-shadow: 0 4px 14px rgba(20, 40, 80, .1); border-color: var(--band); }
.pm-card b { font-size: 13.5px; line-height: 1.25; overflow-wrap: anywhere; }
.pm-code { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.pm-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pm-tag { font-size: 11px; color: var(--ink-2); background: var(--sunken); border-radius: 999px; padding: 1px 7px; }
.pm-tag.draft { background: var(--gate-soft); color: var(--gate); }
.pm-tag.risk { background: var(--bad-soft); color: var(--bad); }
/* cadeia de valor: setas entre os processos principais */
.pm-principal .pm-cards { gap: 10px 26px; align-items: center; }
.pm-principal .pm-card { width: 180px; }
.pm-principal .pm-card::after { content: ""; position: absolute; right: -20px; top: 50%; width: 12px; height: 12px; border-top: 2.5px solid var(--band); border-right: 2.5px solid var(--band); transform: translateY(-50%) rotate(45deg); }
.pm-cap { font-size: 12px; font-weight: 600; color: var(--band); background: color-mix(in srgb, var(--band) 10%, var(--surface)); border: 1px dashed var(--band); border-radius: 14px; padding: 6px 10px; position: relative; max-width: 96px; text-align: center; line-height: 1.25; }
.pm-cap:not(.end) { margin-right: 0; }
.pm-cap:not(.end)::after { content: ""; position: absolute; right: -20px; top: 50%; width: 12px; height: 12px; border-top: 2.5px solid var(--band); border-right: 2.5px solid var(--band); transform: translateY(-50%) rotate(45deg); }
.pm-empty { align-self: center; }
.pmap.pm-focus .pm-card:not(.pm-on):not(.pm-rel) { opacity: .35; }
.pm-card.pm-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.pm-card.pm-rel { border-color: var(--band); box-shadow: 0 0 0 2px color-mix(in srgb, var(--band) 45%, transparent); }
.pm-sel { border-color: var(--accent); }
@media (max-width: 760px) {
  .pm-band { grid-template-columns: 1fr; }
  .pm-lbl { padding: 10px 14px; }
  .pm-card, .pm-principal .pm-card { width: 100%; }
  .pm-principal .pm-cards { flex-direction: column; align-items: stretch; gap: 22px; }
  .pm-principal .pm-card::after, .pm-cap:not(.end)::after { right: auto; left: 50%; top: auto; bottom: -17px; transform: translateX(-50%) rotate(135deg); }
  .pm-cap { max-width: none; }
}
@media print { .pm-card { break-inside: avoid; } .pmap.pm-focus .pm-card { opacity: 1 !important; } }
.ind-form { width: min(580px, 100%); }
.row3 { align-items: end; }

/* ===== Qualidade: documentos do sistema, não conformidades e auditoria interna ===== */
.dlist a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px; border-radius: 8px; color: inherit; text-decoration: none; }
.dlist a:hover { background: var(--sunken); }
.st-badge.st-late { background: var(--bad-soft); color: var(--bad); }
.q-head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: end; justify-content: space-between; }
.q-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.q-tab { padding: 9px 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.q-tab:hover { color: var(--ink); }
.q-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
/* documentos */
.work.doc-mode { grid-template-columns: minmax(0, 1fr); }
.work.doc-mode .canvas-wrap, .work.doc-mode #aiPanel, .work.doc-mode .steps-head, .work.doc-mode #stepList, .work.doc-mode #addRow { display: none; }
.work.doc-mode .editor { border-right: 0; max-width: 980px; width: 100%; margin: 0 auto; }
.doc-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; align-items: end; }
.doc-fields .doc-ack { grid-column: 1 / -1; }
@media (max-width: 640px) { .doc-fields { grid-template-columns: 1fr; } }
.doc-edit { display: grid; gap: 6px; }
.doc-edit-h { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.doc-edit-h .btn { margin-left: auto; }
.doc-edit textarea { font-family: var(--f-mono); font-size: 13px; line-height: 1.55; min-height: 360px; resize: vertical; }
.doc-body { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 26px; max-width: 900px; width: 100%; line-height: 1.6; }
.doc-body h2 { font-family: var(--f-display); font-size: 19px; margin: 22px 0 8px; color: var(--ink); }
.doc-body h2:first-child, .doc-body h3:first-child { margin-top: 0; }
.doc-body h3, .doc-body h4 { font-size: 16px; margin: 18px 0 6px; }
.doc-body p { margin: 0 0 10px; }
.doc-body ul { margin: 0 0 12px; padding-left: 22px; }
.doc-body .audit-wrap { margin: 6px 0 14px; }
.doc-view { margin: 0 auto; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.doc-card { display: grid; gap: 4px; align-content: start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--d3); border-radius: 10px; padding: 12px 14px; color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; }
.doc-card:hover { border-color: var(--accent); }
.doc-card b { font-size: 14.5px; }
.doc-type { font-size: 12.5px; color: var(--ink-2); }
.doc-st { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.doc-miss { border-style: dashed; border-top-style: dashed; background: transparent; }
.doc-add { font-size: 12.5px; font-weight: 600; color: var(--accent); }
/* não conformidades */
.nc-st { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.nc-aberta { background: var(--bad-soft); color: var(--bad); }
.nc-tratamento, .au-andamento { background: var(--gate-soft); color: var(--warn); }
.nc-verificacao, .au-planejada { background: var(--accent-soft); color: var(--accent); }
.nc-encerrada, .au-concluida { background: var(--start-soft); color: var(--start); }
.nc-cancelada, .au-cancelada { background: var(--sunken); color: var(--ink-3); }
.ind-sum-i.nc-sum { background: var(--sunken); }
.ind-sum-i.nc-sum.nc-aberta { background: var(--bad-soft); }
.ind-sum-i.nc-sum.nc-tratamento { background: var(--gate-soft); }
.ind-sum-i.nc-sum.nc-verificacao { background: var(--accent-soft); }
.ind-sum-i.nc-sum.nc-encerrada { background: var(--start-soft); }
.nc-tbl tbody tr, .audit tr[data-au] { cursor: pointer; }
.nc-tbl tbody tr:hover, .audit tr[data-au]:hover { background: var(--sunken); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; cursor: pointer; font-weight: 600; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.seg input { position: absolute; opacity: 0; }
.seg .note { font-weight: 400; }
@media (max-width: 560px) { .seg { grid-template-columns: 1fr; } }
.nc-flow { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; counter-reset: f; }
.nc-flow li { counter-increment: f; font-size: 12.5px; font-weight: 600; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--sunken); color: var(--ink-3); }
.nc-flow li::before { content: counter(f) " "; font-family: var(--f-mono); opacity: .8; }
.nc-flow li.past { background: var(--start-soft); color: var(--start); }
.nc-flow li.now { background: var(--accent); color: var(--accent-ink); }
.nc-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; margin: 4px 0 0; }
.nc-facts dt { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.nc-facts dd { margin: 2px 0 0; font-size: 13.5px; }
.whys { display: grid; gap: 6px; }
.whys > .lbl { font-weight: 600; font-size: 13px; }
.why { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.why:nth-child(3) { margin-left: 14px; } .why:nth-child(4) { margin-left: 28px; } .why:nth-child(5) { margin-left: 42px; } .why:nth-child(6) { margin-left: 56px; }
@media (max-width: 640px) { .why { grid-template-columns: 1fr; gap: 2px; margin-left: 0 !important; } }
.act-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 200px) 150px auto; gap: 8px; align-items: center; }
@media (max-width: 760px) { .act-add { grid-template-columns: 1fr; } }
.audit tr.done td:first-child { color: var(--ink-2); }
.audit tr.late td { background: color-mix(in srgb, var(--bad-soft) 55%, transparent); }
.uactions input { min-width: 160px; }
.nc-next { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; padding: 14px 16px; }
.nc-next > div { flex: 1 1 260px; }
.nc-ev { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.nc-ev li { display: grid; gap: 1px; position: relative; font-size: 13.5px; }
.nc-ev li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
/* auditoria */
.au-prog { display: inline-block; vertical-align: middle; width: 64px; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.au-prog i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.au-prog.big { width: 160px; height: 8px; }
.au-sum { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--ink-2); }
.au-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.au-item { display: grid; gap: 7px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.au-item.r-conforme { border-left-color: var(--start); }
.au-item.r-nc { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-soft) 40%, var(--surface)); }
.au-item.r-observacao { border-left-color: var(--warn); }
.au-item.r-nao_aplica { border-left-color: var(--ink-3); }
.au-q { margin: 0; font-weight: 500; }
.au-res { display: flex; flex-wrap: wrap; gap: 4px; }
.au-b { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.au-b[aria-pressed="true"].b-conforme { background: var(--start); border-color: var(--start); color: #fff; }
.au-b[aria-pressed="true"].b-nc { background: var(--bad); border-color: var(--bad); color: #fff; }
.au-b[aria-pressed="true"].b-observacao { background: var(--warn); border-color: var(--warn); color: #fff; }
.au-b[aria-pressed="true"].b-nao_aplica { background: var(--ink-3); border-color: var(--ink-3); color: #fff; }
.au-b:disabled { opacity: .45; cursor: not-allowed; }
.au-ev { resize: vertical; min-height: 34px; font-size: 13px; }
.au-ro { font-size: 13px; color: var(--ink-2); }
.au-nc { font-size: 13px; font-weight: 600; color: var(--bad); }
.nc-st.au-r-conforme { background: var(--start-soft); color: var(--start); }
.nc-st.au-r-nc { background: var(--bad-soft); color: var(--bad); }
.nc-st.au-r-observacao { background: var(--warn-soft); color: var(--warn); }
.au-procs { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.au-procs legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.cov { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cov li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 7px 8px; border-radius: 8px; }
.cov li:nth-child(odd) { background: var(--bg); }
.cov li > span:first-child, .cov li > a:first-child { flex: 1 1 240px; }
.cov li.due > span:nth-child(2) { color: var(--bad); font-weight: 600; }
@media print { .au-res, .act-add, .nc-next, .q-tabs { display: none !important; } }
.au-item > .btn, .au-item > .lnk, .au-item > .au-nc { justify-self: start; }
#auAdd { grid-template-columns: minmax(0, 1fr) auto; }

/* ===== Ajuda: manual e Pergunte à Trilha ===== */
.menu-ver { font-size: 11.5px; color: var(--ink-3); padding: 6px 10px 7px; border-bottom: 1px solid var(--line); margin-bottom: 3px; }
.menu-ver b { color: var(--ink-2); font-family: var(--f-mono); font-weight: 500; }
.menu #mHelp { display: none; }
.help-grid { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .help-grid { grid-template-columns: 1fr; } }
.ver-chip { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }
.help-toc { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-toc li { display: grid; gap: 1px; } .help-toc b { font-size: 13.5px; }
.help-ai { min-height: 420px; }
.help-spark { color: var(--accent); }
/* símbolo da ajuda com IA (o mesmo na tela Ajuda e no botão flutuante) */
.help-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 15px; line-height: 1; flex: none; box-shadow: 0 2px 6px rgba(20, 60, 140, .25); }
.help-mark.sm { width: 20px; height: 20px; font-size: 11px; box-shadow: none; vertical-align: -4px; }
.help-title { display: flex; align-items: center; gap: 9px; }
.help-fab { position: fixed; right: 20px; bottom: 20px; z-index: 25; display: inline-flex; align-items: center; gap: 9px; padding: 6px 16px 6px 6px; border-radius: 999px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgba(10, 20, 40, .18); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.help-fab:hover { border-color: var(--accent); box-shadow: 0 8px 26px rgba(20, 60, 140, .25); }
.help-fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.help-fab .help-mark { width: 34px; height: 34px; font-size: 17px; }
.help-fab[hidden] { display: none; }
.help-overlay { z-index: 45; }
.help-sheet { width: min(640px, 100%); max-height: min(760px, 92vh); }
.help-dlg-body { gap: 12px; }
.help-dlg-body .help-chat { max-height: 46vh; min-height: 160px; }
.help-where { font-size: 13px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; }
.help-where b { color: var(--ink); }
@media (max-width: 640px) {
  .help-fab { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); padding: 5px; }
  .help-fab .help-fab-tx { display: none; }
  .help-fab .help-mark { width: 40px; height: 40px; font-size: 19px; }
  .help-overlay { place-items: end center; padding: 0; }
  .help-sheet { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
}
@media print { .help-fab { display: none !important; } }
.help-quota { display: grid; gap: 2px; background: var(--start-soft); border: 1px solid var(--start); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.help-quota b { font-size: 14px; color: var(--ink); }
.help-quota span { color: var(--ink-2); }
.help-quota.out { background: var(--bad-soft); border-color: var(--bad); }
.help-chat { display: grid; gap: 10px; align-content: start; min-height: 240px; max-height: 56vh; overflow-y: auto; padding: 4px 2px; }
.help-hello p { margin: 0 0 10px; color: var(--ink-2); }
.help-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.hmsg { max-width: 88%; padding: 10px 14px; border-radius: 14px; line-height: 1.55; font-size: 14px; }
.hmsg p { margin: 0 0 6px; } .hmsg p:last-child { margin: 0; }
.hmsg ol, .hmsg ul { margin: 4px 0 6px; padding-left: 20px; }
.hmsg.q { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.hmsg.a { justify-self: start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.hmsg.err { justify-self: start; background: var(--bad-soft); color: var(--ink); border: 1px solid var(--bad); }
.dots { display: inline-flex; gap: 4px; } .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: hdot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hdot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .6; } }
.help-ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.help-ask textarea { resize: vertical; min-height: 44px; }
