/* Cartão de tela enxuto + Diagnóstico da tela.
   Mesmos componentes do cartão de mídia (#206/#207: .mini, .mc-more, .mc-menu, .mc-dot, raio 10/16, sombra
   rgba(21,45,56,.18)) e o verde oficial da Invista TV (logo/ícone 0.55: #7dc153 → #2e9a55 → #145c31). */
/* tokens (--tv-green*, --ok/--warn/--bad, --ink*, --line, --r-*, --shadow-pop) ficam no :root de app.css */

/* ---------- cartão ---------- */
#screenList .screen-card{overflow:visible}
#screenList .screen-card-top{gap:8px}
#screenList .sc-right{display:flex;align-items:center;gap:6px;flex:none}
#screenList .screen-card-summary{gap:5px}
#screenList .screen-card-client{color:var(--tv-green-deep)}
#screenList .sc-alert-slot:empty{display:none}
.sc-alert{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:7px;max-width:100%;padding:5px 10px;border-radius:999px;font-size:12.5px;font-weight:700;cursor:pointer;line-height:1.25;width:max-content}
.sc-alert i{width:8px;height:8px;border-radius:50%;flex:none;background:currentColor}
.sc-alert span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sc-alert em{font-style:normal;font-weight:800;opacity:.75}
.sc-alert.tone-bad{background:var(--bad-soft);color:var(--bad)}
.sc-alert.tone-warn{background:var(--warn-soft);color:var(--warn)}
.sc-alert.tone-info{background:#eef0f3;color:var(--ink2)}
.sc-alert:hover{filter:brightness(.97)}.sc-alert:focus-visible{outline:3px solid var(--tv-green);outline-offset:2px}
#screenList .screen-quick-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;align-self:stretch;width:100%}
#screenList .screen-quick-actions .mini.sc-fix{flex:1 1 100%;background:var(--warn-soft);border-color:#f6d3ad;color:var(--warn)}
#screenList .screen-quick-actions .mini.sc-fix:hover:not(:disabled){background:var(--warn);border-color:var(--warn);color:#fff}
#screenList .screen-quick-actions .mini.sc-diag,#screenList .screen-quick-actions .mini.screen-quick-program{flex:1 1 0}
#screenList .screen-quick-actions .mini{flex:1 1 auto;white-space:nowrap;padding:8px 8px;border-color:var(--tv-green-line);background:var(--tv-green-soft);color:var(--tv-green-deep)}
#screenList .screen-quick-actions .mini:hover:not(:disabled){background:var(--tv-green-deep);border-color:var(--tv-green-deep);color:#fff}
#screenList .screen-quick-actions .screen-quick-activate{background:var(--tv-green-deep);border-color:var(--tv-green-deep);color:#fff}
#screenList .screen-orientation{border-color:var(--tv-green-line);background:var(--tv-green-soft);color:var(--tv-green-deep)}
#screenList .screen-quick-actions .mini.sc-diag{background:linear-gradient(135deg,var(--tv-green-light),var(--tv-green) 55%,var(--tv-green-deep));color:#fff;border-color:transparent;box-shadow:0 2px 10px #2e9a5533}
#screenList .screen-quick-actions .mini.sc-diag:hover{filter:brightness(1.05)}
#screenList .sc-more{flex:none}
#screenList .sc-more summary{font-size:18px;line-height:1;padding:6px 10px}
#screenList .sc-more .mc-menu{top:calc(100% + 4px);bottom:auto;right:0;min-width:250px;z-index:30}
#screenList .sc-more .mc-menu button[disabled]{opacity:.45;cursor:not-allowed}
#screenList .sc-more .mc-menu button:hover:not([disabled]),#screenList .sc-more .mc-menu button:focus-visible{background:var(--tv-green-soft)}
#screenList .screen-card-more{color:var(--ink3)}
#screenList .screen-card-summary:hover .screen-card-more{color:var(--tv-green-deep)}
/* informações que agora ficam no Diagnóstico; controles agora no menu ⋯ */
#screenList .screen-card-details .screen-health,#screenList .screen-card-details .screen-command-controls,
#screenList .screen-extra>.screen-metrics,#screenList .screen-extra>.screen-progress,#screenList .screen-extra>small,
#screenList .screen-extra>.screen-controls-title,#screenList .screen-extra>.screen-actions{display:none!important}

/* indicador de sinal (barras) */
.sig-mini{all:unset;box-sizing:border-box;display:inline-grid;place-items:center;width:30px;height:26px;border-radius:8px;cursor:pointer;color:var(--ink3)}
.sig-mini:hover{background:#f1f4f4}.sig-mini:focus-visible{outline:3px solid var(--tv-green);outline-offset:1px}
.sig-bars{width:20px;height:16px;display:block}.sig-bars rect.off{fill:#d5dcdf}.sig-bars rect.on{fill:currentColor}
.sig-plug{width:18px;height:18px;display:block}
.sig-mini.tone-good,.diag-meter.tone-good{color:var(--ok)}
.sig-mini.tone-warn,.diag-meter.tone-warn{color:var(--warn)}
.sig-mini.tone-bad,.diag-meter.tone-bad{color:var(--bad)}
.sig-mini.is-old .sig-bars rect.off{fill:none;stroke:#c3ccd0;stroke-width:1}
.sig-mini.is-stale{opacity:.45}

/* ---------- diálogo Diagnóstico ---------- */
.diag-dialog{width:min(820px,calc(100% - 24px));max-height:calc(100vh - 32px);padding:0;border:0;border-radius:20px;color:var(--ink);background:#f6faf7;box-shadow:0 24px 70px rgba(21,45,56,.28);overflow:auto}
.diag-dialog::backdrop{background:rgba(14,40,26,.45);backdrop-filter:blur(3px)}
.diag-dialog[open]{animation:diagIn .2s ease-out}
@keyframes diagIn{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.diag-dialog[open]{animation:none}}
.diag-head{position:sticky;top:0;z-index:2;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 22px 44px;color:#fff;
  background:radial-gradient(120% 140% at 0% 0%,#9ad86c55 0,transparent 55%),radial-gradient(90% 120% at 100% 0%,#0f4a2766 0,transparent 60%),linear-gradient(120deg,var(--tv-green-light),var(--tv-green) 48%,var(--tv-green-deep))}
.diag-head h2{margin:0;font-size:21px;line-height:1.2;overflow-wrap:anywhere}
.diag-sub{margin:4px 0 0;font-size:13px;opacity:.88}
.diag-head .diag-close{flex:none;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.35);color:#fff;backdrop-filter:blur(6px)}
.diag-head .diag-close:hover{background:rgba(255,255,255,.28)}
.diag-body{position:relative;z-index:3;margin-top:-28px;padding:0 18px 20px;display:grid;gap:14px}
.diag-body section{background:rgba(255,255,255,.97);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.9);border-radius:var(--r-card);padding:14px 16px;box-shadow:0 4px 18px rgba(21,45,56,.07)}
.diag-body h3{margin:0 0 10px;font-size:13px;font-weight:700;color:var(--ink2)}
.diag-verdict{border-left:5px solid var(--ok)!important}
.diag-verdict.tone-warn{border-left-color:var(--warn)!important}.diag-verdict.tone-bad{border-left-color:var(--bad)!important}
.diag-verdict>strong{display:block;font-size:17px;margin-bottom:4px}
.diag-verdict.tone-good>strong{color:var(--ok)}.diag-verdict.tone-warn>strong{color:var(--warn)}.diag-verdict.tone-bad>strong{color:var(--bad)}
.diag-verdict p{margin:0;color:var(--ink2);font-size:14px}
.diag-verdict ul{margin:6px 0 0;padding:0;list-style:none;display:grid;gap:6px}
.diag-verdict li{position:relative;padding-left:18px;font-size:14px;line-height:1.45}
.diag-verdict li::before{content:"";position:absolute;left:2px;top:.5em;width:8px;height:8px;border-radius:50%;background:#c3ccd0}
.diag-verdict li.tone-bad::before{background:var(--bad)}.diag-verdict li.tone-warn::before{background:var(--warn)}.diag-verdict li.tone-info::before{background:var(--tv-green)}
.diag-body section.diag-tiles{display:grid;grid-template-columns:1.25fr 1fr 1fr;gap:0;padding:0;overflow:hidden}
.diag-tile{padding:14px 16px;min-width:0}.diag-tile+.diag-tile{border-left:1px solid var(--line)}
.diag-tile>strong{display:block;font-size:24px;font-weight:750;line-height:1.1;font-variant-numeric:tabular-nums}
.diag-tile>strong em{font-style:normal;font-size:14px;font-weight:600;color:var(--ink2)}
.diag-tile small{display:block;margin-top:4px;font-size:12.5px;color:var(--ink2);line-height:1.35}
.diag-tile .diag-link{margin-top:8px}
.muted-val{color:var(--ink3)}
.diag-meter{display:flex;align-items:center;gap:12px}
.diag-meter .sig-bars.big{width:52px;height:42px;flex:none}.diag-meter .sig-plug.big{width:40px;height:40px;flex:none}
.diag-meter strong{display:block;font-size:22px;line-height:1.1}
.diag-meter.is-old{color:var(--ink3)}.diag-meter.is-old strong{color:var(--ink2);font-size:18px}
.diag-meter.is-old .sig-bars rect.off{fill:none;stroke:#c3ccd0;stroke-width:.8}
.diag-charts{display:grid;gap:14px}
.diag-chart-host{position:relative;min-height:60px}
.diag-chart{display:block;max-width:100%;overflow:visible;font-size:11px}
.diag-chart text{fill:var(--ink3)}
.diag-chart .grid{stroke:#e6ecec;stroke-width:1}
.diag-chart .band-good{fill:#13834f0f}.diag-chart .band-ok{fill:#13834f07}.diag-chart .band-warn{fill:#b453090f}.diag-chart .band-bad{fill:#b8293a12}
.diag-chart .band-label{fill:var(--ink3);font-size:10.5px}
.diag-chart .line{fill:none;stroke:var(--tv-green-deep);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.diag-chart .dot{fill:var(--tv-green-deep)}
.diag-chart .cross{stroke:var(--ink2);stroke-width:1;stroke-dasharray:3 3}
.diag-chart .hover-dot{fill:var(--tv-green-deep);stroke:#fff;stroke-width:2}
.diag-chart .hit{fill:transparent;cursor:crosshair}
.diag-tip{position:absolute;top:-6px;padding:5px 9px;border-radius:8px;background:var(--ink);color:#fff;font-size:12px;white-space:nowrap;pointer-events:none;box-shadow:var(--shadow-pop)}
.diag-empty{margin:0;padding:14px;border-radius:var(--r-inner);background:#f3f6f6;color:var(--ink2);font-size:13.5px}
.diag-list{margin:0;display:grid;grid-template-columns:1fr 1fr;gap:0 24px}
.diag-row{display:grid;grid-template-columns:112px 1fr;gap:10px;padding:9px 0;border-bottom:1px solid #eef2f2;font-size:14px;align-items:start}
.diag-row dt{color:var(--ink2)}.diag-row dd{margin:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;min-width:0;overflow-wrap:anywhere}.diag-row dd>span{flex:1 1 0;min-width:0}.diag-row dd .diag-dot{transform:translateY(-1px)}
.diag-dot{width:9px;height:9px;border-radius:50%;flex:none;background:#c3ccd0}
.diag-dot.tone-good{background:var(--ok)}.diag-dot.tone-warn{background:var(--warn)}.diag-dot.tone-bad{background:var(--bad)}
.diag-progress{flex:0 0 100%;width:100%;height:5px;border-radius:99px;background:#e6ecec;overflow:hidden}
.diag-progress i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,var(--tv-green-light),var(--tv-green))}
.diag-error{margin:0;padding:10px 12px;border-radius:var(--r-inner);background:var(--bad-soft);color:var(--bad);font-size:13px}
@media (max-width:700px){
  .diag-dialog{width:100%;max-width:100%;max-height:100%;height:100%;border-radius:0;margin:0}
  .diag-head{padding:16px 16px 40px}
  .diag-body{padding:0 12px 16px}
  .diag-body section.diag-tiles{grid-template-columns:1fr}
  .diag-tile+.diag-tile{border-left:0;border-top:1px solid var(--line)}
  .diag-list{grid-template-columns:1fr}
  .diag-row{grid-template-columns:118px 1fr}
}
/* configurações da tela (aberta pelo "Configurar"): mesmos tons verdes */
#screenList .screen-card.expanded{border-color:var(--tv-green-line);box-shadow:0 10px 30px #145c311a}
#screenList .screen-card-details{background:#fafdfb;border-top-color:#e6f1ea}
#screenList .screen-pairing-code{border-color:var(--tv-green-line);background:#fff}
#screenList .screen-pairing-code strong{color:var(--tv-green-deep)}
#screenList .screen-card-details .mini:not(.danger){background:var(--tv-green-soft);color:var(--tv-green-deep);border-color:var(--tv-green-line)}
#screenList .screen-card-details .mini:not(.danger):hover:not(:disabled){background:var(--tv-green-deep);color:#fff}
#screenList .screen-canal input,#screenList .screen-hours input[type=checkbox]{accent-color:var(--tv-green)}
/* 19/10/2026: GESTÃO à vista no cartão (Reiniciar, Abrir app, Puxar TV, Atualizar, Limpar); cadastro só em ⋯ → Editar tela */
#screenList .screen-card-summary{cursor:default}
#screenList.screen-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr))}
#screenList .screen-quick-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
#screenList .sc-main{display:flex;align-items:center;gap:6px;width:100%;min-width:0}
#screenList .sc-main .mini{flex:1 1 0;min-width:0}
#screenList .sc-tools{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.sc-tool{all:unset;box-sizing:border-box;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:50px;padding:7px 2px 6px;border:1px solid var(--tv-green-line);border-radius:10px;background:#fff;color:var(--tv-green-deep);font-size:11.5px;font-weight:800;line-height:1.1;text-align:center;cursor:pointer;transition:background .15s,color .15s,border-color .15s}
.sc-tool svg{width:19px;height:19px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.sc-tool[data-screen-command="open"] svg{fill:currentColor;stroke:none}
.sc-tool span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sc-tool:hover{background:var(--tv-green-deep);border-color:var(--tv-green-deep);color:#fff}
.sc-tool:focus-visible{outline:3px solid var(--tv-green);outline-offset:2px}
.sc-tool.is-hot{background:var(--warn-soft);border-color:#f6d3ad;color:var(--warn)}
.sc-tool.is-hot:hover{background:var(--warn);border-color:var(--warn);color:#fff}
.sc-tool.has-new::after{content:"";position:absolute;top:6px;right:7px;width:8px;height:8px;border-radius:50%;background:#e8590c;box-shadow:0 0 0 2px #fff}
.sc-tool[data-screen-command="clear_cache"]:hover{background:var(--bad);border-color:var(--bad);color:#fff}
.sc-tool:disabled{cursor:progress;opacity:.7}
#screenList .sc-more .mc-menu .sc-menu-edit{margin-top:4px;border-top:1px solid var(--line);border-radius:0 0 6px 6px;font-weight:700;color:var(--tv-green-deep)}
#screenList button.screen-card-more{all:unset;align-self:center;margin-top:2px;padding:4px 10px;border-radius:8px;color:var(--ink2);font-size:12px;font-weight:800;cursor:pointer}
#screenList button.screen-card-more:hover,#screenList button.screen-card-more:focus-visible{background:var(--tv-green-soft);color:var(--tv-green-deep)}
#screenList button.screen-card-more[hidden]{display:none}
#screenList .screen-card.expanded .screen-quick-actions{flex:0 1 470px}
#screenList #screenEditPanel{grid-column:1/-1;margin:14px 0 4px;padding:16px;border:1px solid var(--tv-green-line);border-radius:14px;background:#fff;box-shadow:none}
#screenList #screenEditPanel h2{margin:0 0 10px;font-size:16px}
#screenList .screen-card.expanded .screen-card-footer{order:9;grid-column:1/-1;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
@media(max-width:420px){.sc-tool{font-size:10.5px;min-height:48px}.sc-tool svg{width:18px;height:18px}#screenList .sc-tools{gap:5px}}
/* nomes de telas, clientes e pastas sempre em MAIÚSCULAS */
input[data-caps]{text-transform:uppercase}
input[data-caps]::placeholder{text-transform:none}
/* Cartão da tela com TODAS as ações à vista (19/10/2026): 10 botões em 2 linhas de 5; cartão um pouco maior (2–3 por linha no computador). */
#screenList.screen-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,400px),1fr))}
#screenList .screen-card-summary{padding:16px 18px 16px}
#screenList .sc-tools{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}
.sc-tool{min-height:60px;padding:8px 3px 7px;gap:5px;font-size:12px}
.sc-tool svg{width:20px;height:20px}
.sc-tool span{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:normal;hyphens:manual;line-height:1.1}
.sc-tool:nth-child(n+6){background:var(--tv-green-wash)}
.sc-tool:nth-child(n+6):hover{background:var(--tv-green-deep)}
.sc-tool.is-ok{background:var(--ok-soft)!important;border-color:#b5e6cb;color:var(--ok)}
.sc-tool.is-ok:hover{background:var(--ok)!important;border-color:var(--ok);color:#fff}
.sc-tool.is-hot:nth-child(n+6){background:var(--warn-soft)}
.sc-tool.is-hot:nth-child(n+6):hover{background:var(--warn)}
.sc-tool[data-cancel-command]:not(.is-hot){color:var(--ink2)}
@media(max-width:420px){#screenList .screen-card-summary{padding:14px 12px}#screenList .sc-tools{gap:5px}.sc-tool{font-size:10.5px;min-height:56px;padding:7px 1px 6px}.sc-tool svg{width:18px;height:18px}}
/* 19/10/2026: versão do app à vista no cartão + faixa de andamento do comando (Reiniciar, Abrir app, Sincronizar…) */
#screenList .sc-version-slot:empty,#screenList .sc-command-slot:empty{display:none}
.sc-version{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;max-width:100%;width:max-content;padding:3px 9px 3px 8px;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.7);color:var(--ink2);font-size:11.5px;line-height:1.3;white-space:nowrap}
.sc-version i{width:7px;height:7px;border-radius:50%;flex:none;background:currentColor}
.sc-version b{font-weight:900;color:var(--ink)}
.sc-version span{overflow:hidden;text-overflow:ellipsis;font-weight:700}
.sc-version.tone-ok{border-color:#b5e6cb;background:var(--ok-soft);color:var(--ok)}
.sc-version.tone-old{border-color:#f6d3ad;background:var(--warn-soft);color:var(--warn)}
.sc-version.tone-unknown{color:var(--ink3)}
button.sc-version{cursor:pointer;transition:background .15s,color .15s}
button.sc-version:hover{background:var(--warn);border-color:var(--warn);color:#fff}
button.sc-version:hover b{color:#fff}
.sc-version:focus-visible{outline:3px solid var(--tv-green);outline-offset:2px}
#screenList .sc-command-slot .screen-command-status{padding:9px 11px;border-radius:12px;background:rgba(255,255,255,.62);border-color:var(--tv-green-line);box-shadow:0 4px 14px rgba(21,45,56,.06);animation:sc-cmd-in .2s ease-out}
#screenList .sc-command-slot .screen-command-heading{font-size:12px;gap:2px}
#screenList .sc-command-slot .screen-command-heading strong{font-size:13px;color:var(--tv-green-deep)}
#screenList .sc-command-slot .is-done{background:#eefbf1}
#screenList .sc-command-slot .is-done .screen-command-heading strong{color:#176a37}
#screenList .sc-command-slot .is-failed{background:#fff2f2}
#screenList .sc-command-slot .is-failed .screen-command-heading strong{color:#a42b2b}
#screenList .sc-command-slot .is-cancelled .screen-command-heading strong{color:var(--ink2)}
#screenList .sc-command-slot .screen-command-track{height:6px;margin-top:7px}
.screen-command-feedback:empty{display:none}
@keyframes sc-cmd-in{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#screenList .sc-command-slot .screen-command-status{animation:none}}
#screenList.screen-list-view .sc-version-slot{flex:0 0 auto}
#screenList.screen-list-view .sc-command-slot{flex:1 1 100%}
.screen-version-summary{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:-6px 0 14px;padding:8px 12px;border:1px solid var(--tv-green-line);border-radius:12px;background:rgba(255,255,255,.6);font-size:12px}
.screen-version-summary[hidden]{display:none}
.screen-version-summary>strong{font-size:12px;color:var(--tv-green-deep);margin-right:2px}
.screen-version-summary>em{margin-left:auto;font-style:normal;font-weight:800;color:var(--ink2)}
@media(max-width:700px){.screen-version-summary>em{margin-left:0;width:100%}}
