/* Automação: inclusão simples, fila compartilhada e janela noturna com adaptação ao miolo. */
#auto-root{max-width:92rem;margin-inline:auto;min-width:0;container-type:inline-size}
#auto-root [hidden]{display:none!important}
#auto-root input,#auto-root select,#auto-root textarea{width:100%;min-width:0;max-width:100%}
.auto-heading{align-items:flex-start;gap:1rem}.auto-heading>.btn{flex:0 0 auto}
.auto-tabs{display:flex;flex-wrap:wrap;gap:.65rem;margin-bottom:1.25rem}.auto-tabs [aria-pressed=true]{background:var(--primary-soft);border-color:var(--primary);color:var(--primary)}
.auto-window{display:grid;grid-template-columns:minmax(13rem,.85fr) minmax(0,1.65fr);gap:1.4rem;padding:1.4rem 1.5rem;margin-bottom:1rem;background:var(--surface);border:1px solid var(--line);border-top:3px solid var(--primary);border-radius:1rem}.auto-window-period{border-right:1px solid var(--line);padding-right:1.3rem}.auto-window-period>strong{display:block;font-size:2rem;letter-spacing:-.05em;line-height:1.25;margin:.2rem 0 .7rem;font-variant-numeric:tabular-nums}.auto-window p{line-height:1.6;margin:.7rem 0 0}.auto-queue-state{min-width:0;align-self:center}.auto-queue-state>strong{display:block;font-size:1.05rem;line-height:1.5;overflow-wrap:anywhere}.auto-queue-state p{overflow-wrap:anywhere}.auto-card-advanced{border-top:1px solid var(--line);margin-top:1rem;padding-top:.8rem}.auto-card-advanced>summary{cursor:pointer;font-weight:650;color:var(--muted);font-size:.8rem}.auto-card-advanced .auto-timing{border-top:0;margin-top:.4rem;padding-top:.5rem}.auto-card-advanced .auto-integration-actions{margin-top:.9rem}.auto-advanced{margin-bottom:1.5rem}.auto-advanced>.btn{margin-top:.4rem}.auto-integration-top>div:first-child{min-width:0;flex:1}.auto-integration-top .auto-badges{max-width:45%}
.auto-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.9rem;margin-bottom:1.5rem}.auto-summary>div{display:flex;flex-direction:column;gap:.4rem;padding:1.1rem 1.25rem;background:var(--surface);border:1px solid var(--line);border-radius:1rem;min-width:0}.auto-summary span{color:var(--muted);font-size:.85rem}.auto-summary strong{font-size:1.8rem;font-variant-numeric:tabular-nums;letter-spacing:-.04em;line-height:1.2}.auto-summary>div:nth-child(3) strong{color:var(--orange)}
.auto-filter-panel{padding:1rem 1.25rem;margin-bottom:1.5rem}.auto-filter-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(10rem,.35fr) auto auto;gap:.9rem;align-items:end}.auto-filter-fields .btn,.auto-filter-fields>.text-btn{min-height:3rem}.auto-filter-panel p{margin:.6rem 0 0}.auto-filter-panel p:empty{display:none}
.auto-section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.75rem}.auto-section-heading h2{margin-bottom:.25rem}.auto-section-heading p{margin:.3rem 0 0;max-width:52rem}.auto-section-heading>.btn{flex:0 0 auto}
.auto-callout{background:var(--surface-alt);border:1px solid var(--line);border-left:3px solid var(--primary);border-radius:.75rem;padding:.85rem 1rem;font-size:.875rem;margin:.85rem 0}.auto-callout p{margin:.4rem 0 0}.auto-callout ul{padding-left:1.1rem;margin:.5rem 0 0}.auto-callout[data-kind=warning]{border-left-color:var(--orange);background:var(--orange-soft)}
.auto-integration{background:var(--surface);border:1px solid var(--line);border-radius:1.1rem;padding:1.25rem;margin-bottom:1rem;min-width:0}.auto-integration-top{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.auto-integration-title{font-size:1.1rem;display:block;line-height:1.4;overflow-wrap:anywhere}.auto-kicker{font-size:.7rem;text-transform:uppercase;letter-spacing:.07em;font-weight:750;color:var(--muted);display:block;margin-bottom:.4rem}.auto-integration-top p{margin:.3rem 0 0;font-size:.85rem;color:var(--muted);overflow-wrap:anywhere}.auto-badges{display:flex;gap:.4rem;flex-wrap:wrap;justify-content:flex-end}.auto-badge{display:inline-flex;align-items:center;white-space:normal;width:fit-content;border-radius:1rem;padding:.25rem .65rem;font-size:.75rem;font-weight:750;background:var(--surface-alt);color:var(--muted)}.auto-badge[data-kind=success]{background:#e6f5ed;color:#18633e}.auto-badge[data-kind=warning]{background:var(--orange-soft);color:var(--orange)}.auto-badge[data-kind=active]{background:var(--primary-soft);color:var(--primary)}:root[data-theme=dark] .auto-badge[data-kind=success]{background:#1b3b32;color:#b2e9cb}
.auto-timing{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;border-top:1px solid var(--line);padding-top:1rem;margin-top:1rem}.auto-timing span,.auto-timing strong{display:block}.auto-timing span{font-size:.75rem;color:var(--muted);margin-bottom:.3rem}.auto-timing strong{font-size:.85rem;font-weight:650;overflow-wrap:anywhere}
.auto-pipeline{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin:1rem 0 0;border:1px solid var(--line);border-radius:.7rem;overflow:hidden}.auto-stage{padding:.8rem .75rem;background:var(--surface-alt);min-width:0}.auto-stage+.auto-stage{border-left:1px solid var(--line)}.auto-stage span,.auto-stage strong{display:block}.auto-stage span{font-size:.7rem;line-height:1.4;color:var(--muted)}.auto-stage strong{margin-top:.25rem;font-size:1.15rem;line-height:1.2;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.auto-stage[data-kind=success] strong{color:#18633e}.auto-stage[data-kind=warning] strong{color:var(--orange)}:root[data-theme=dark] .auto-stage[data-kind=success] strong{color:#b2e9cb}
.auto-integration-bottom{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-top:1rem}.auto-integration-bottom p{margin:0;font-size:.85rem;overflow-wrap:anywhere}.auto-integration-actions{display:flex;gap:.5rem;flex-wrap:wrap;flex:0 0 auto}.auto-integration-actions .btn{font-size:.8rem;min-height:2.7rem;padding:.6rem .8rem}.auto-related{display:flex;gap:.85rem;flex-wrap:wrap;font-size:.8rem;margin-top:.8rem}.auto-related a{font-weight:650}.auto-reasons{margin-top:1rem}.auto-reasons summary{cursor:pointer;font-size:.85rem;font-weight:700;color:var(--orange)}.auto-reasons ul{font-size:.85rem;padding-left:1.2rem;margin:.65rem 0}.auto-reasons a{font-size:.8rem;font-weight:650}
.auto-empty{text-align:center;padding:2rem 1.25rem}.auto-empty p{max-width:36rem;margin:.6rem auto 1rem}.auto-pagination{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin:1rem 0}.auto-pagination>div{display:flex;gap:.5rem}.auto-pagination p{margin:0}.auto-footnote{border-top:1px solid var(--line);padding-top:1rem;line-height:1.6}
.auto-pulses{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem;margin:1.25rem 0}.auto-pulse{border:1px solid var(--line);border-radius:.75rem;padding:1rem;min-width:0}.auto-pulse h3{font-size:1rem;margin-bottom:.45rem}.auto-pulse p{margin:.4rem 0;font-size:.85rem;overflow-wrap:anywhere}.auto-pulse[data-late=true]{border-color:var(--orange)}.auto-php-field{max-width:36rem;margin:1.25rem 0}.auto-php-field p{margin:.45rem 0}.auto-cron-command{background:var(--surface-alt);border:1px solid var(--line);border-radius:.85rem;padding:1rem;margin:1rem 0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.75rem;align-items:start}.auto-cron-command>div{grid-column:1/-1}.auto-cron-command h3{font-size:1rem;margin:0 0 .3rem}.auto-cron-command p{margin:0}.auto-cron-command textarea{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.8rem;line-height:1.6;resize:vertical;background:var(--surface);word-break:break-all}.auto-cron-command>.btn{font-size:.8rem;min-height:2.8rem}.auto-explanation{border-top:1px solid var(--line);padding-top:1rem;margin-top:1rem;font-size:.875rem}.auto-explanation summary{cursor:pointer;font-weight:700}.auto-explanation p{line-height:1.65}
.auto-editor{width:min(49rem,calc(100% - 2rem));max-width:49rem}.auto-editor-heading{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.auto-editor-heading h2{margin:.4rem 0 1rem}.auto-editor-section{padding:1.1rem 0;border-top:1px solid var(--line)}.auto-editor-section h3{font-size:1rem;margin:0 0 .7rem}.auto-editor-section p{line-height:1.55;margin:.55rem 0 0}.auto-schedule-fields{display:grid;grid-template-columns:1.2fr 1fr 1.2fr;gap:.85rem}#auto-days-wrap{margin-top:1rem}.auto-destinations{display:grid;gap:.6rem;margin-top:.8rem}.auto-destination-search{margin-top:1rem}.auto-destination-choice{display:flex;align-items:flex-start;gap:.7rem;border:1px solid var(--line);border-radius:.65rem;padding:.75rem;cursor:pointer;margin:0;font-weight:500}.auto-destination-choice input{width:1.1rem!important;height:1.1rem;flex:0 0 auto;margin-top:.15rem}.auto-destination-choice span{overflow-wrap:anywhere;font-size:.875rem;line-height:1.5}.auto-destination-choice:has(input:checked){border-color:var(--primary);background:var(--primary-soft)}.auto-destination-choice:has(input:disabled){cursor:default;color:var(--muted)}.auto-editor-footer{border-top:1px solid var(--line);padding-top:1rem}.auto-editor-footer>.form-actions{justify-content:flex-end;margin-bottom:0}.auto-editor-footer>p{margin:0;min-height:1.4em}
@media(max-width:65rem){.auto-integration-bottom{align-items:flex-start;flex-direction:column}.auto-integration-actions{width:100%}.auto-integration-actions>.btn{flex:1 1 auto}.auto-cron-command{grid-template-columns:minmax(0,1fr)}.auto-cron-command>.btn{justify-self:start}.auto-timing{grid-template-columns:repeat(2,minmax(0,1fr))}.auto-timing>div:last-child{grid-column:1/-1}}
@media(max-width:45rem){.auto-heading,.auto-section-heading{flex-direction:column;align-items:stretch}.auto-heading>.btn{width:100%}.auto-tabs>.btn{flex:1 1 100%}.auto-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}.auto-summary>div{padding:.9rem}.auto-summary strong{font-size:1.5rem}.auto-filter-fields,.auto-schedule-fields,.auto-pulses{grid-template-columns:minmax(0,1fr)}.auto-filter-fields>.btn{width:100%}.auto-filter-fields>.text-btn{text-align:left;min-height:2rem}.auto-integration{padding:1rem}.auto-integration-top{flex-direction:column}.auto-badges{justify-content:flex-start}.auto-pipeline{grid-template-columns:repeat(2,minmax(0,1fr))}.auto-stage+.auto-stage{border-left:0}.auto-stage:nth-child(even){border-left:1px solid var(--line)}.auto-stage:nth-child(n+3){border-top:1px solid var(--line)}.auto-stage:last-child{grid-column:1/-1}.auto-pagination{align-items:stretch;flex-direction:column}.auto-pagination>div>.btn{flex:1 1 0}.auto-editor{padding:1.1rem;width:calc(100% - 1rem);max-height:calc(100dvh - 1rem)}.auto-editor-heading{gap:.5rem}.auto-editor-heading>.text-btn{padding:.3rem}.auto-editor-footer>.form-actions>.btn{flex:1 1 auto}.auto-timing{grid-template-columns:minmax(0,1fr)}.auto-timing>div:last-child{grid-column:auto}.auto-cron-command>.btn{width:100%}.auto-php-field{max-width:100%}}
@container(max-width:60rem){.auto-integration-top{flex-direction:column}.auto-integration-top .auto-badges{max-width:100%;justify-content:flex-start}.auto-filter-fields{grid-template-columns:minmax(0,1fr) minmax(11rem,.7fr)}.auto-integration-bottom{align-items:flex-start;flex-direction:column}.auto-integration-actions{width:100%}.auto-integration-actions>.btn{flex:1 1 auto}}
@container(max-width:37rem){.auto-window{grid-template-columns:minmax(0,1fr);padding:1rem;gap:1rem}.auto-window-period{border-right:0;border-bottom:1px solid var(--line);padding-right:0;padding-bottom:1rem}.auto-filter-fields,.auto-pulses{grid-template-columns:minmax(0,1fr)}.auto-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.auto-pipeline{grid-template-columns:repeat(2,minmax(0,1fr))}.auto-stage+.auto-stage{border-left:0}.auto-stage:nth-child(even){border-left:1px solid var(--line)}.auto-stage:nth-child(n+3){border-top:1px solid var(--line)}.auto-stage:last-child{grid-column:1/-1}.auto-timing{grid-template-columns:minmax(0,1fr)}.auto-timing>div:last-child{grid-column:auto}.auto-cron-command{grid-template-columns:minmax(0,1fr)}.auto-cron-command>.btn{width:100%}.auto-integration-top .auto-badges{max-width:100%}}

/* Ação emergencial explícita, separada da programação e sempre na mesma fila. */
.auto-heading>a.btn{flex:0 0 auto;white-space:normal;text-align:center}.auto-emergency-button{border-color:var(--orange);color:var(--orange)}.auto-urgency-state{margin-top:.9rem;padding:.85rem 1rem;border-radius:.75rem;border:1px solid var(--line);border-left:3px solid var(--orange);background:var(--surface-alt)}.auto-urgency-state strong{display:block;font-size:.875rem}.auto-urgency-state p{margin:.35rem 0 0;font-size:.8rem;line-height:1.55;overflow-wrap:anywhere}.auto-urgency-state[data-kind=success]{border-left-color:#278552}.auto-urgency-dialog{width:min(43rem,calc(100% - 2rem));max-width:43rem}.auto-urgency-dialog>form>p{line-height:1.6}.auto-urgency-scope{display:grid;grid-template-columns:minmax(6rem,.3fr) minmax(0,1fr);gap:.55rem .85rem;padding:1rem;background:var(--surface-alt);border:1px solid var(--line);border-radius:.75rem;font-size:.875rem}.auto-urgency-scope dt{color:var(--muted)}.auto-urgency-scope dd{margin:0;font-weight:650;overflow-wrap:anywhere}.auto-urgency-confirm{display:flex;align-items:flex-start;gap:.65rem;margin-top:1rem;font-size:.875rem;line-height:1.6;font-weight:500}.auto-urgency-confirm>input{width:1.1rem!important;height:1.1rem;flex:0 0 auto;margin-top:.2rem}.auto-urgency-dialog .form-actions{flex-wrap:wrap;justify-content:flex-end}.auto-urgency-dialog #auto-urgency-status{min-height:1.4em;margin-bottom:0}
@media(max-width:45rem){.auto-heading>a.btn{width:100%}.auto-urgency-dialog{width:calc(100% - 1rem);padding:1.1rem;max-height:calc(100dvh - 1rem)}.auto-urgency-scope{grid-template-columns:minmax(0,1fr);gap:.25rem;padding:.85rem}.auto-urgency-scope dd{margin-bottom:.5rem}.auto-urgency-dialog .form-actions>.btn{flex:1 1 100%}.auto-urgency-dialog .form-actions>.text-btn{width:100%}}
.auto-destination-results{min-width:0;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--line)}.auto-destination-results>h3{margin:0 0 .4rem;font-size:.95rem}.auto-destination-results>p{margin:.35rem 0 .7rem;line-height:1.6;overflow-wrap:anywhere}.auto-destination-results .auto-urgency-state[data-kind=neutral]{border-left-color:var(--line)}.auto-destination-results .auto-urgency-state>.auto-badge{margin-top:.4rem}.auto-destination-results .auto-integration-actions{margin-top:.8rem}.auto-destination-results .auto-integration-actions>.text-btn{white-space:normal;text-align:left;overflow-wrap:anywhere}
