/* Verdex — «Riepilogo e prossimi passi» nella scheda «Esito» (shield-act.js).
 * Stessa famiglia visiva dei «Motivi principali» (bordo sinistro colorato per livello, fondo bianco, testi scuri ad alta
 * leggibilità). Comparsa morbida e breve, disattivata con «riduci movimento». Tema Notte e Alto contrasto inclusi. */
.act-card {
  --act-c: #D97706; --act-bg: #FFFBEB; --act-ink: #92400E;
  display: grid; gap: .7rem; min-width: 0; padding: .8rem .85rem .85rem;
  border: 1px solid #E2E8F0; border-left: 5px solid var(--act-c); border-radius: .9rem; background: #FFFFFF; color: #0F172A;
  animation: act-in .32s cubic-bezier(.22, 1, .36, 1) both;
}
.act-card[data-level="low"] { --act-c: #059669; --act-bg: #ECFDF5; --act-ink: #065F46; }
.act-card[data-level="high"] { --act-c: #DC2626; --act-bg: #FEF2F2; --act-ink: #991B1B; }
@keyframes act-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .act-card { animation: none; } }

.act-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .6rem; }
.act-title { margin: 0; font-size: .78rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: #1E1B4B; }
.act-prof { font-size: .75rem; font-weight: 800; color: #1E3A8A; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 999px; padding: .1rem .55rem; white-space: nowrap; }
.act-card[data-profile="family"] .act-prof { color: #92400E; background: #FFFBEB; border-color: #FDE68A; }
.act-card[data-profile="forensic"] .act-prof { color: #7C2D12; background: #FFF7ED; border-color: #FED7AA; }

/* Livello di rischio */
.act-level { display: grid; gap: .35rem; }
.act-level-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .55rem; margin: 0; }
.act-level-lbl { font-size: .85rem; font-weight: 700; color: #334155; }
.act-level-val { font-size: 1.15rem; font-weight: 900; color: var(--act-ink); }
.act-score { font-size: .85rem; font-weight: 800; color: var(--act-ink); background: var(--act-bg); border-radius: 999px; padding: .05rem .55rem; font-variant-numeric: tabular-nums; }
.act-scale { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; }
.act-seg { display: flex; align-items: center; justify-content: center; min-height: 1.6rem; border-radius: .45rem; background: #F1F5F9; color: #64748B; font-size: .72rem; font-weight: 800; transition: background-color .25s ease, color .25s ease; }
.act-seg[data-on="1"][data-s="low"] { background: #059669; color: #FFFFFF; }
.act-seg[data-on="1"][data-s="medium"] { background: #D97706; color: #FFFFFF; }
.act-seg[data-on="1"][data-s="high"] { background: #DC2626; color: #FFFFFF; }
.act-state { margin: 0; font-size: .95rem; font-weight: 700; color: #0F172A; line-height: 1.35; }
.act-conf { margin: 0; font-size: .82rem; font-weight: 700; color: #475569; }

/* Segnali d'allarme */
.act-sub { margin: 0 0 .3rem; font-size: .8rem; font-weight: 800; color: #334155; }
.act-flag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.act-flag { display: inline-flex; align-items: center; min-height: 1.9rem; padding: .2rem .6rem; border-radius: 999px; background: var(--act-bg); color: var(--act-ink); border: 1px solid color-mix(in srgb, var(--act-c) 30%, transparent); font-size: .85rem; font-weight: 800; line-height: 1.25; }
.act-flag-list.is-rich { display: grid; gap: .35rem; }
.act-flag-list.is-rich .act-flag { display: grid; gap: .1rem; border-radius: .65rem; padding: .4rem .6rem; }
.act-flag-why { font-size: .84rem; font-weight: 500; color: #1E293B; }
.act-flag-proof { font-size: .8rem; font-weight: 500; color: #475569; overflow-wrap: anywhere; }
.act-flag-proof b { font-weight: 800; color: #334155; }
.act-none, .act-more { margin: 0; font-size: .85rem; color: #475569; }
.act-more { margin-top: .3rem; }

/* Prossimi passi */
.act-steps-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .6rem; }
.act-step-list { margin: 0; padding-left: 1.4rem; list-style: decimal outside; display: block; font-size: .95rem; font-weight: 600; line-height: 1.4; color: #0F172A; }
.act-step-list li { display: list-item; padding-left: .1rem; margin: 0 0 .3rem; }
.act-step-list li:last-child { margin-bottom: 0; }
.act-step-list li::marker { font-weight: 900; color: var(--act-ink); }
.act-link { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 .2rem; border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 800; color: #1E3A8A; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.act-link:hover { color: #172554; }
.act-link:focus-visible { outline: 3px solid #F59E0B; outline-offset: 2px; border-radius: .35rem; }

/* Canali ufficiali */
.act-official { display: grid; gap: .2rem; padding: .55rem .7rem; border-radius: .7rem; background: #EFF6FF; border: 1px solid #BFDBFE; }
.act-official-h { margin: 0; font-size: .82rem; font-weight: 900; color: #1E3A8A; }
.act-official-t { margin: 0; font-size: .88rem; line-height: 1.45; color: #1E293B; }

/* Profilo */
.act-depth { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .7rem; }
.act-depth-t { margin: 0; flex: 1 1 14rem; font-size: .8rem; color: #475569; line-height: 1.4; }
.act-fp { margin: 0; flex: 1 1 100%; font-size: .78rem; color: #475569; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.act-sample { margin: 0; font-size: .8rem; font-style: italic; color: #64748B; }
.act-card[data-compact="1"] { gap: .55rem; }

@media (max-width: 639px) {
  .act-card { padding: .65rem .65rem .7rem; border-left-width: 4px; gap: .6rem; }
  .act-title { font-size: .7rem; }
  .act-step-list { font-size: .9rem; }
  .act-flag { font-size: .8rem; }
}
@media (min-width: 1024px) {
  .act-card:not([data-compact="1"]) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 1.4rem; align-items: start;
    grid-template-areas: "head head" "level steps" "flags steps" "off off" "depth depth" "sample sample";
  }
  .act-card:not([data-compact="1"]) > .act-head { grid-area: head; }
  .act-card:not([data-compact="1"]) > .act-level { grid-area: level; }
  .act-card:not([data-compact="1"]) > .act-flags { grid-area: flags; }
  .act-card:not([data-compact="1"]) > .act-steps { grid-area: steps; }
  .act-card:not([data-compact="1"]) > .act-official { grid-area: off; }
  .act-card:not([data-compact="1"]) > .act-depth { grid-area: depth; }
  .act-card:not([data-compact="1"]) > .act-sample { grid-area: sample; }
}

html.large-text .act-step-list, html.large-text .act-official-t, html.large-text .act-flag-why { font-size: 1.05rem; }
html.large-text .act-flag { font-size: .95rem; }

/* Alto contrasto */
html.high-contrast .act-card, html.high-contrast .act-official, html.high-contrast .act-flag, html.high-contrast .act-seg { background: #FFFFFF !important; border-color: #000000 !important; color: #000000 !important; }
html.high-contrast .act-card { border-width: 2px; border-left-width: 6px; }
html.high-contrast .act-seg[data-on="1"] { background: #000000 !important; color: #FFFFFF !important; }
html.high-contrast :is(.act-title, .act-prof, .act-level-lbl, .act-level-val, .act-score, .act-state, .act-conf, .act-sub, .act-flag-why, .act-flag-proof, .act-none, .act-more, .act-step-list, .act-official-h, .act-official-t, .act-depth-t, .act-fp, .act-link, .act-sample) { color: #000000 !important; }

/* Tema Notte */
html[data-ws-theme="night"]:not(.high-contrast) .act-card { background: #111C33; border-color: #26355E; border-left-color: var(--act-c); color: #E2E8F0; }
html[data-ws-theme="night"]:not(.high-contrast) .act-card[data-level="low"] { --act-c: #39EFB6; --act-bg: #0F2A2A; --act-ink: #8EF5D2; }
html[data-ws-theme="night"]:not(.high-contrast) .act-card[data-level="medium"] { --act-c: #F59E0B; --act-bg: #2A2110; --act-ink: #FCD34D; }
html[data-ws-theme="night"]:not(.high-contrast) .act-card[data-level="high"] { --act-c: #EF4444; --act-bg: #2A1418; --act-ink: #FCA5A5; }
html[data-ws-theme="night"]:not(.high-contrast) .act-title { color: #B1ADEB; }
html[data-ws-theme="night"]:not(.high-contrast) .act-prof { color: #BFDBFE; background: #1A2748; border-color: #2B3F73; }
html[data-ws-theme="night"]:not(.high-contrast) :is(.act-level-lbl, .act-sub) { color: #ADC0EB; }
html[data-ws-theme="night"]:not(.high-contrast) :is(.act-state, .act-step-list, .act-flag-why) { color: #E2E8F0; }
html[data-ws-theme="night"]:not(.high-contrast) :is(.act-conf, .act-none, .act-more, .act-flag-proof, .act-depth-t, .act-fp, .act-sample) { color: #A5B4D4; }
html[data-ws-theme="night"]:not(.high-contrast) .act-seg { background: #1A2748; color: #8DA2CF; }
html[data-ws-theme="night"]:not(.high-contrast) .act-seg[data-on="1"] { background: var(--act-c); color: #0B132B; }
html[data-ws-theme="night"]:not(.high-contrast) .act-official { background: #13224A; border-color: #2B3F73; }
html[data-ws-theme="night"]:not(.high-contrast) .act-official-h { color: #BFDBFE; }
html[data-ws-theme="night"]:not(.high-contrast) .act-official-t { color: #DCE6F8; }
html[data-ws-theme="night"]:not(.high-contrast) .act-link { color: #93C5FD; }

@media print { .act-card { animation: none; break-inside: avoid; } .act-link { display: none; } }
