/* Verdex — «Cosa abbiamo controllato», coerenza dei badge e nota di rallentamento del server AI (shield-coherence.js) */
.coh-host.hidden { display: none; }
.coh { display: grid; gap: .45rem; min-width: 0; margin-top: .6rem; padding: .65rem .75rem .7rem; border: 1px solid #E2E8F0; border-left: 5px solid #94A3B8; border-radius: .9rem; background: #FFFFFF; }
.coh[data-level="high"] { border-left-color: #DC2626; }
.coh[data-level="medium"] { border-left-color: #D97706; }
.coh[data-level="low"] { border-left-color: #059669; }
.coh-h { margin: 0; font-size: .78rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: #1E1B4B; }
.coh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; min-width: 0; }
.coh-row { display: grid; gap: .15rem; min-width: 0; padding: .45rem .6rem; border-radius: .65rem; background: #F8FAFC; }
.coh-row[data-tone="risk"] { background: #FEF2F2; }
.coh-row[data-tone="warn"] { background: #FFFBEB; }
.coh-row[data-tone="ok"] { background: #ECFDF5; }
.coh-row[data-tone="muted"] { background: #F1F5F9; }
.coh-top { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; margin: 0; min-width: 0; font-size: .8rem; line-height: 1.3; }
.coh-dot { flex-shrink: 0; width: .6rem; height: .6rem; border-radius: 999px; background: #94A3B8; }
.coh-row[data-tone="risk"] .coh-dot { background: #DC2626; }
.coh-row[data-tone="warn"] .coh-dot { background: #D97706; }
.coh-row[data-tone="ok"] .coh-dot { background: #059669; }
.coh-row[data-tone="info"] .coh-dot { background: #1E3A8A; }
.coh-label { font-weight: 900; color: #0F172A; overflow-wrap: anywhere; }
.coh-tone { font-weight: 800; padding: 0 .45rem; border-radius: 999px; font-size: .72rem; background: #FFFFFF; border: 1px solid currentColor; color: #475569; }
.coh-row[data-tone="risk"] .coh-tone { color: #B91C1C; }
.coh-row[data-tone="warn"] .coh-tone { color: #92400E; }
.coh-row[data-tone="ok"] .coh-tone { color: #047857; }
.coh-row[data-tone="info"] .coh-tone { color: #1E3A8A; }
.coh-text { margin: 0; font-size: .92rem; line-height: 1.42; color: #1E293B; overflow-wrap: anywhere; word-break: break-word; }
.coh-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }
.coh-btn { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .35rem .85rem; border: 2px solid #1E3A8A; border-radius: 999px; background: #FFFFFF; color: #1E3A8A; font-weight: 800; font-size: .88rem; cursor: pointer; }
.coh-btn:hover { background: #EEF2FF; }
.coh-btn:focus-visible { outline: 3px solid #93C5FD; outline-offset: 2px; }
.coh-link { margin-top: .75rem; }
.rx-esito .coh { margin-top: 0; }

/* Controlli parziali «verdi» dentro un esito ad alto rischio: neutri, non smentiscono l'allerta */
#result-box [data-coh="muted"], #pro-result [data-coh="muted"] { background-color: #F1F5F9 !important; color: #334155 !important; border-color: #CBD5E1 !important; }
#pro-result .pro-link[data-coh="muted"] { border-left: 6px solid #94A3B8 !important; background-color: #FFFFFF !important; }
#pro-result .pro-pill[data-coh="muted"] { background-color: #64748B !important; color: #FFFFFF !important; }
#result-box .sig-sv[data-coh="muted"] { background-color: transparent !important; }
#result-box .vp-x-item[data-coh="muted"] .vp-x-pill, #result-box .si-row[data-coh="muted"] .si-row-score { background: #E2E8F0 !important; color: #334155 !important; }

/* Nota sull'analisi AI: con un semplice rallentamento il tono è informativo, i codici restano nei dettagli chiusi */
#result-ai-note[data-kind="slow"] { border-color: #1E3A8A; background: #EFF6FF; color: #1E293B; }
#result-ai-note[data-kind="slow"] .ai-note-title { color: #1E3A8A; }
#result-ai-note details.ai-note-diag { margin-top: .4rem; }
#result-ai-note details.ai-note-diag.hidden { display: none; }
#result-ai-note details.ai-note-diag > summary { cursor: pointer; font-weight: 700; min-height: 2rem; display: inline-flex; align-items: center; }
#result-ai-note details.ai-note-diag > p { margin-top: .25rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82em; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .coh { padding: .5rem .6rem .55rem; gap: .35rem; border-left-width: 4px; border-radius: .8rem; }
  .coh-h { font-size: .68rem; }
  .coh-list { gap: .3rem; }
  .coh-row { padding: .38rem .5rem; }
  .coh-top { font-size: .74rem; }
  .coh-tone { font-size: .66rem; }
  .coh-text { font-size: .88rem; line-height: 1.38; }
  .coh-btn { width: 100%; justify-content: center; }
}
@media (min-width: 1024px) {
  .coh-list { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
}
html.large-text .coh-h { font-size: .9rem; }
html.large-text .coh-top { font-size: .92rem; }
html.large-text .coh-text { font-size: 1.08rem; }
html.large-text .coh-btn { font-size: 1rem; }
html.high-contrast .coh, html.high-contrast .coh-row { background: #FFFFFF !important; border-color: #000000; }
html.high-contrast .coh-row { border: 1px solid #000000; }
html.high-contrast :is(.coh-h, .coh-label, .coh-text, .coh-tone) { color: #000000 !important; }
html.high-contrast #result-ai-note[data-kind="slow"] { background: #FFFFFF; color: #000000; border-color: #000000; }
@media print {
  .coh-actions { display: none; }
}
