/* Verdex — «Referto del modulo» (Screenshot, Documenti, Audio, Video) in cima alla scheda «Esito» (shield-report.js) */
.rx-report-host.hidden { display: none; }
.rx-why-host.rr-covered { display: none; }

.rr { display: grid; gap: .6rem; min-width: 0; padding: .75rem .8rem .8rem; border: 1px solid #E2E8F0; border-left: 5px solid #94A3B8; border-radius: .9rem; background: #FFFFFF; color: #0F172A; text-align: left; }
.rr[data-level="high"] { border-left-color: #DC2626; }
.rr[data-level="medium"] { border-left-color: #D97706; }
.rr[data-level="low"] { border-left-color: #059669; }
.rr-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .6rem; }
.rr-title { margin: 0; font-size: .8rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: #1E1B4B; }
.rr-prof { font-size: .74rem; font-weight: 800; padding: .1rem .55rem; border-radius: 999px; background: #EEF2FF; color: #3730A3; border: 1px solid #C7D2FE; }
.rr[data-profile="family"] .rr-prof { background: #FFF7ED; color: #9A3412; border-color: #FED7AA; }
.rr[data-profile="forensic"] .rr-prof { background: #F1F5F9; color: #0F172A; border-color: #94A3B8; }
.rr-mode { margin: -.2rem 0 0; font-size: .8rem; line-height: 1.35; color: #64748B; }

.rr-sec { display: grid; gap: .4rem; min-width: 0; padding-top: .55rem; border-top: 1px solid #F1F5F9; }
.rr-sec-h { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: .92rem; font-weight: 900; color: #0F172A; }
.rr-sec-n { display: inline-grid; place-items: center; flex-shrink: 0; width: 1.35rem; height: 1.35rem; border-radius: 999px; background: #1E1B4B; color: #FFFFFF; font-size: .74rem; font-weight: 900; }
.rr-sub { margin: .2rem 0 0; font-size: .74rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: #475569; }

/* 1) Rischio e stato */
.rr-meter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.rr-score { display: flex; align-items: baseline; gap: .1rem; line-height: 1; }
.rr-score-n { font-size: 2.1rem; font-weight: 900; color: #0F172A; font-variant-numeric: tabular-nums; }
.rr[data-level="high"] .rr-score-n { color: #B91C1C; }
.rr[data-level="medium"] .rr-score-n { color: #B45309; }
.rr[data-level="low"] .rr-score-n { color: #047857; }
.rr-score-max { font-size: .9rem; font-weight: 800; color: #64748B; }
.rr-facts { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; min-width: 0; }
.rr-fact { display: flex; align-items: baseline; gap: .3rem; padding: .2rem .55rem; border-radius: .55rem; background: #F8FAFC; border: 1px solid #E2E8F0; font-size: .82rem; min-width: 0; }
.rr-fact dt { font-weight: 700; color: #64748B; }
.rr-fact dd { margin: 0; font-weight: 900; color: #0F172A; overflow-wrap: anywhere; }
.rr[data-level="high"] .rr-f-level, .rr[data-level="high"] .rr-f-state { background: #FEF2F2; border-color: #FECACA; }
.rr[data-level="medium"] .rr-f-level, .rr[data-level="medium"] .rr-f-state { background: #FFFBEB; border-color: #FDE68A; }
.rr[data-level="low"] .rr-f-level, .rr[data-level="low"] .rr-f-state { background: #ECFDF5; border-color: #A7F3D0; }
.rr-bar { position: relative; height: .45rem; border-radius: 999px; background: linear-gradient(90deg, #A7F3D0 0 35%, #FDE68A 35% 65%, #FECACA 65% 100%); overflow: hidden; }
.rr-bar-fill { position: absolute; inset: 0 auto 0 0; border-right: 3px solid #0F172A; background: transparent; }
.rr-axes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .3rem; }
.rr-axis { display: flex; justify-content: space-between; gap: .4rem; padding: .25rem .5rem; border-radius: .5rem; background: #F8FAFC; font-size: .8rem; }
.rr-axis[data-tone="risk"] { background: #FEF2F2; }
.rr-axis[data-tone="warn"] { background: #FFFBEB; }
.rr-axis[data-tone="ok"] { background: #ECFDF5; }

/* 2) Segnali e prove */
.rr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; min-width: 0; }
.rr-li { display: flex; align-items: flex-start; gap: .5rem; min-width: 0; padding: .35rem .55rem; border-radius: .6rem; background: #F8FAFC; }
.rr-li[data-tone="risk"] { background: #FEF2F2; }
.rr-li[data-tone="warn"] { background: #FFFBEB; }
.rr-li[data-tone="ok"] { background: #ECFDF5; }
.rr-dot { flex-shrink: 0; width: .55rem; height: .55rem; margin-top: .42rem; border-radius: 999px; background: #94A3B8; }
.rr-li[data-tone="risk"] .rr-dot { background: #DC2626; }
.rr-li[data-tone="warn"] .rr-dot { background: #D97706; }
.rr-li[data-tone="ok"] .rr-dot { background: #059669; }
.rr-li-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem; min-width: 0; font-size: .9rem; line-height: 1.4; }
.rr-li-text { color: #1E293B; overflow-wrap: anywhere; }
.rr-kind { font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; color: #334155; }
.rr-kind + .rr-li-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; font-weight: 700; }
.rr-at { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; font-weight: 900; padding: 0 .4rem; border-radius: .35rem; background: #1E1B4B; color: #FFFFFF; }
.rr-li-notes { flex-basis: 100%; font-size: .78rem; color: #475569; overflow-wrap: anywhere; }
.rr-tag { font-size: .7rem; font-weight: 800; padding: 0 .45rem; border-radius: 999px; background: #FFFFFF; border: 1px solid currentColor; }
.rr-li[data-tone="risk"] .rr-tag { color: #B91C1C; }
.rr-li[data-tone="warn"] .rr-tag { color: #92400E; }
.rr-li[data-tone="ok"] .rr-tag { color: #047857; }
.rr-empty { margin: 0; font-size: .86rem; color: #475569; }
.rr-foot { margin: 0; font-size: .78rem; color: #64748B; }
.rr-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.rr-chips li { font-size: .76rem; padding: .12rem .5rem; border-radius: 999px; background: #F1F5F9; border: 1px solid #E2E8F0; color: #334155; }
.rr-chips li[data-tone="risk"] { background: #FEF2F2; border-color: #FECACA; }
.rr-chips li[data-tone="warn"] { background: #FFFBEB; border-color: #FDE68A; }
.rr-chips li[data-tone="ok"] { background: #ECFDF5; border-color: #A7F3D0; }
.rr-fp { margin: 0; font-size: .76rem; color: #475569; overflow-wrap: anywhere; }
.rr-fp-v { font-size: .72rem; }

/* 3) Azioni rapide */
.rr-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .25rem; font-size: .92rem; line-height: 1.4; font-weight: 700; color: #0F172A; }
.rr-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.rr-btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .4rem .8rem; border-radius: .7rem; border: 2px solid #CBD5E1; background: #FFFFFF; color: #0F172A; font-size: .86rem; font-weight: 800; cursor: pointer; transition: background .15s, border-color .15s; }
.rr-btn:hover { background: #F8FAFC; border-color: #94A3B8; }
.rr-btn:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }
.rr-btn.rr-b-redact { background: #1E1B4B; border-color: #1E1B4B; color: #FFFFFF; }
.rr-btn.rr-b-redact:hover { background: #312E81; }
.rr-btn-ico { display: inline-block; width: .9rem; height: .9rem; border-radius: .2rem; background: currentColor; opacity: .85; -webkit-mask: var(--rr-ico) center / contain no-repeat; mask: var(--rr-ico) center / contain no-repeat; }
.rr-b-redact { --rr-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='9' width='18' height='6' rx='1'/%3E%3C/svg%3E"); }
.rr-b-copy { --rr-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 3h11v14H8zM5 7h2v12h10v2H5z'/%3E%3C/svg%3E"); }
.rr-b-compare, .rr-b-arc-cmp { --rr-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h8v16H3zM13 4h8v16h-8zM5 6v12h4V6zM15 6v12h4V6z'/%3E%3C/svg%3E"); }
.rr-b-arc { --rr-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18v4H3zM5 9h14v11H5zM9 12v2h6v-2z'/%3E%3C/svg%3E"); }
.rr-b-report { --rr-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l5 5v15H6zM9 12h8v2H9zm0 4h8v2H9z'/%3E%3C/svg%3E"); }
.rr-b-sha { --rr-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3l-1 5H4v2h3.6l-.8 4H3v2h3.4l-1 5h2l1-5h4l-1 5h2l1-5H18v-2h-3.2l.8-4H20V8h-3.6l1-5h-2l-1 5h-4l1-5zm.6 7h4l-.8 4h-4z'/%3E%3C/svg%3E"); }

/* Editor di oscuramento */
html.rr-rd-open { overflow: hidden; }
.rr-rd { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 1rem; background: rgba(15, 23, 42, .72); }
.rr-rd-panel { display: grid; gap: .55rem; width: min(52rem, 100%); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow: auto; padding: 1rem; border-radius: 1rem; background: #FFFFFF; color: #0F172A; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.rr-rd-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rr-rd-title { margin: 0; font-size: 1.15rem; font-weight: 900; }
.rr-rd-x { min-width: 44px; min-height: 44px; border-radius: .7rem; border: 2px solid #CBD5E1; background: #FFFFFF; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.rr-rd-hint, .rr-rd-note, .rr-rd-count { margin: 0; font-size: .88rem; color: #475569; }
.rr-rd-note:empty, .rr-rd-count:empty { display: none; }
.rr-rd-stage { display: grid; place-items: center; min-height: 10rem; border-radius: .8rem; background: #F1F5F9; border: 2px dashed #CBD5E1; overflow: hidden; }
.rr-rd-canvas { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; touch-action: none; cursor: crosshair; }
.rr-rd-canvas[hidden], .rr-rd-empty[hidden] { display: none; }
.rr-rd-empty { margin: 0; padding: 1rem; font-weight: 700; color: #475569; text-align: center; }
.rr-rd-bar { display: flex; flex-wrap: wrap; gap: .4rem; }
.rr-rd-btn { min-height: 44px; padding: .4rem .85rem; border-radius: .7rem; border: 2px solid #CBD5E1; background: #FFFFFF; color: #0F172A; font-weight: 800; cursor: pointer; }
.rr-rd-btn[hidden] { display: none; }
.rr-rd-btn:disabled { opacity: .45; cursor: not-allowed; }
.rr-rd-btn.rr-rd-primary { background: #1E1B4B; border-color: #1E1B4B; color: #FFFFFF; }
.rr-rd-btn:focus-visible, .rr-rd-x:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }

@media (max-width: 640px) {
  .rr { padding: .6rem .6rem .65rem; gap: .5rem; border-left-width: 4px; border-radius: .8rem; }
  .rr-title { font-size: .7rem; }
  .rr-mode { font-size: .74rem; }
  .rr-score-n { font-size: 1.75rem; }
  .rr-li { padding: .3rem .45rem; }
  .rr-li-body { font-size: .86rem; }
  .rr-btn { flex: 1 1 calc(50% - .4rem); justify-content: center; font-size: .82rem; padding: .35rem .5rem; }
  .rr-rd { padding: .5rem; }
  .rr-rd-panel { padding: .75rem; }
}
html.large-text .rr-li-body, html.large-text .rr-steps { font-size: 1.05rem; }
html.large-text .rr-title, html.large-text .rr-sub { font-size: .9rem; }
html.large-text .rr-btn { font-size: 1rem; }
html.high-contrast .rr, html.high-contrast .rr-li, html.high-contrast .rr-fact, html.high-contrast .rr-axis { background: #FFFFFF !important; border-color: #000000 !important; }
html.high-contrast .rr-li { border: 1px solid #000000; }
html.high-contrast :is(.rr-title, .rr-mode, .rr-sub, .rr-li-text, .rr-li-notes, .rr-empty, .rr-foot, .rr-fact dt, .rr-fact dd, .rr-score-n, .rr-tag, .rr-kind) { color: #000000 !important; }
/* Prove con verifica incrociata con un clic (IBAN → Messaggi, link → Link / Siti, numero → Numeri) */
.rr-li-act { flex-wrap: wrap; }
.rr-li-act .rr-li-body { flex: 1 1 12rem; }
.rr-x-btn { display: inline-flex; align-items: center; gap: .3rem; flex-shrink: 0; min-height: 40px; margin-left: auto; padding: .25rem .65rem; border-radius: .6rem; border: 2px solid #1E3A8A; background: #FFFFFF; color: #1E3A8A; font-size: .8rem; font-weight: 900; cursor: pointer; white-space: nowrap; }
.rr-x-btn:hover { background: #EEF2FF; }
.rr-x-btn:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }
.rr-x-ico { display: inline-block; width: .85rem; height: .85rem; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3a7 7 0 015.6 11.2l5.1 5.1-1.4 1.4-5.1-5.1A7 7 0 1110 3zm0 2a5 5 0 100 10 5 5 0 000-10z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3a7 7 0 015.6 11.2l5.1 5.1-1.4 1.4-5.1-5.1A7 7 0 1110 3zm0 2a5 5 0 100 10 5 5 0 000-10z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Testo letto / trascrizione (già mascherato) */
.rr-quote { margin: 0; padding: .45rem .65rem; border-left: 4px solid #6366F1; border-radius: .5rem; background: #F8FAFC; font-size: .88rem; line-height: 1.45; color: #1E293B; white-space: pre-line; overflow-wrap: anywhere; max-height: 14rem; overflow-y: auto; }

/* Oscuramento automatico dei dati sensibili */
.rr-auto { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem .6rem; border-radius: .7rem; background: #F8FAFC; border: 1px solid #E2E8F0; cursor: pointer; }
.rr-auto-in { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rr-auto-sw { position: relative; flex-shrink: 0; width: 2.6rem; height: 1.5rem; margin-top: .1rem; border-radius: 999px; background: #CBD5E1; transition: background .15s; }
.rr-auto-sw::after { content: ''; position: absolute; top: .15rem; left: .15rem; width: 1.2rem; height: 1.2rem; border-radius: 999px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.rr-auto-in:checked + .rr-auto-sw { background: #1E1B4B; }
.rr-auto-in:checked + .rr-auto-sw::after { transform: translateX(1.1rem); }
.rr-auto-in:focus-visible + .rr-auto-sw { outline: 3px solid #2563EB; outline-offset: 2px; }
.rr-auto-txt { display: grid; gap: .1rem; min-width: 0; }
.rr-auto-l { font-size: .88rem; font-weight: 900; color: #0F172A; }
.rr-auto-h { font-size: .78rem; line-height: 1.35; color: #475569; }

/* Analisi completa non terminata (timeout, rete, server) */
.rr-to { display: grid; gap: .35rem; padding: .55rem .65rem; border-radius: .7rem; background: #FFFBEB; border: 1px solid #FDE68A; }
.rr-to-t { margin: 0; font-size: .86rem; font-weight: 900; color: #92400E; }
.rr-to-p { margin: 0; font-size: .84rem; line-height: 1.4; color: #78350F; }
.rr-to .rr-btn { justify-self: start; }
.rr-b-export { --rr-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 3h2v9l3-3 1.4 1.4L12 15.8 6.6 10.4 8 9l3 3zM4 17h2v2h12v-2h2v4H4z'/%3E%3C/svg%3E"); }
.rr-b-retry { --rr-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4a8 8 0 017.7 6h-2.1A6 6 0 1012 18a6 6 0 005.2-3h2.2A8 8 0 1112 4zm5 1h3v5h-5l2-2z'/%3E%3C/svg%3E"); }
.rr-rd-btn.rr-rd-auto { border-color: #1E1B4B; color: #1E1B4B; }

/* Fasi dell'elaborazione dei file (riquadro «Analisi in corso») */
.rr-stages { display: grid; gap: .45rem; width: min(30rem, 100%); margin: .3rem auto 0; padding: .6rem .7rem; border-radius: .9rem; background: #FFFFFF; border: 1px solid #E2E8F0; text-align: left; }
.rr-stages.hidden { display: none; }
.rr-st-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .6rem; font-size: .82rem; }
.rr-st-title { font-weight: 900; color: #1E1B4B; }
.rr-st-time { font-weight: 800; color: #64748B; font-variant-numeric: tabular-nums; }
.rr-st-bar { height: .35rem; border-radius: 999px; background: #E2E8F0; overflow: hidden; }
.rr-st-bar span { display: block; height: 100%; border-radius: inherit; background: #1E3A8A; transition: width .4s ease; }
.rr-st-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.rr-st-li { display: flex; align-items: baseline; gap: .45rem; font-size: .84rem; line-height: 1.35; color: #94A3B8; }
.rr-st-dot { flex-shrink: 0; width: .6rem; height: .6rem; border-radius: 999px; border: 2px solid currentColor; transform: translateY(.05rem); }
.rr-st-lbl { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.rr-st-state { flex-shrink: 0; font-size: .74rem; font-weight: 800; }
.rr-st-li[data-state="active"] { color: #1E3A8A; font-weight: 800; }
.rr-st-li[data-state="active"] .rr-st-dot { background: #1E3A8A; animation: rr-st-pulse 1.1s ease-in-out infinite; }
.rr-st-li[data-state="done"] { color: #047857; }
.rr-st-li[data-state="done"] .rr-st-dot { background: #059669; border-color: #059669; }
.rr-st-li[data-state="fail"] { color: #B45309; }
.rr-st-li[data-state="fail"] .rr-st-dot { background: #D97706; border-color: #D97706; }
.rr-st-li[data-state="skip"] { color: #94A3B8; text-decoration: line-through; }
.rr-st-note { margin: 0; padding: .35rem .5rem; border-radius: .55rem; background: #FFFBEB; border: 1px solid #FDE68A; font-size: .8rem; line-height: 1.4; color: #78350F; }
.rr-st-note[hidden] { display: none; }
@keyframes rr-st-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .rr-st-li[data-state="active"] .rr-st-dot { animation: none; } .rr-st-bar span { transition: none; } }

/* Smartphone: scorrimento completo di referto, editor e finestra «Salva in Archivio», senza pulsanti tagliati */
.rr-rd-bar { position: sticky; bottom: 0; z-index: 1; margin: 0 -1rem; padding: .55rem 1rem calc(.6rem + env(safe-area-inset-bottom, 0px)); background: #FFFFFF; border-top: 1px solid #E2E8F0; }
.rr-rd-panel { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
dialog.arc-dialog { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; max-height: calc(100dvh - 1rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
dialog.arc-dialog .arc-dlg-actions { position: sticky; bottom: 0; z-index: 1; margin: 0 -1.1rem; padding: .6rem 1.1rem calc(.7rem + env(safe-area-inset-bottom, 0px)); background: #FFFFFF; border-top: 1px solid #E2E8F0; }
@media (max-width: 640px) {
  .rr-x-btn { margin-left: 1.05rem; }
  .rr-li-act .rr-li-body { flex-basis: 100%; }
  .rr-stages { padding: .5rem .55rem; }
  .rr-st-li { font-size: .8rem; }
  .rr-rd-bar { margin: 0 -.75rem; padding-left: .75rem; padding-right: .75rem; }
  .rr-rd-btn { flex: 1 1 calc(50% - .4rem); }
  .rr-rd-canvas { max-height: 52vh; }
  .arc-export .arc-btn { flex: 1 1 calc(50% - .45rem); min-width: 0; white-space: normal; text-align: center; }
  .arc-selbar { max-height: 62dvh; overflow-y: auto; overscroll-behavior: contain; }
}
html.large-text .rr-x-btn, html.large-text .rr-auto-l { font-size: .98rem; }
html.large-text .rr-quote, html.large-text .rr-st-li { font-size: 1rem; }
html.high-contrast :is(.rr-quote, .rr-auto, .rr-to, .rr-stages, .rr-st-note) { background: #FFFFFF !important; border-color: #000000 !important; color: #000000 !important; }
html.high-contrast .rr-x-btn { border-color: #000000; color: #000000; }

@media print {
  .rr-btns, .rr-x-btn, .rr-auto, .rr-b-retry { display: none; }
  .rr-rd { display: none; }
}
