/* Scheda persona unica (inaff-scheda.js) — finestra fuori da #app-main, sempre scura. */
.isc-modal { position: fixed; inset: 0; z-index: 10001; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 14, 22, 0.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    --isc-text: #f8fafc; --isc-text-2: #e2e8f0; --isc-muted: #a3afc2; --isc-faint: #8592a8; --isc-line: rgba(248, 250, 252, 0.12); --isc-line-soft: rgba(248, 250, 252, 0.07);
    --isc-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; font-family: var(--isc-font); color: var(--isc-text-2); }
.isc-modal.is-on { display: flex; }
body.isc-open { overflow: hidden; }
.isc-modal *, .isc-modal *::before, .isc-modal *::after { box-sizing: border-box; }
.isc-box { width: min(860px, 100%); max-height: 92vh; overflow: auto; background: #2c3648; border: 1px solid var(--isc-line); border-radius: 24px; padding: 18px 20px 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); overscroll-behavior: contain; }
.isc-modal b, .isc-modal strong { color: var(--isc-text); }

.isc-head { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; }
.isc-av { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: #bfdbfe; color: #0f172a; font-weight: 800; font-size: 16px; }
.isc-who b { display: block; font-size: 20px; letter-spacing: -.02em; }
.isc-who small { color: var(--isc-muted); font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.isc-pct { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 96px; padding: 9px 14px; border-radius: 18px; font-weight: 800; font-size: 28px; line-height: 1; border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.isc-pct small { font-size: 10.5px; font-weight: 700; margin-top: 4px; opacity: .9; }
.isc-pct--green { color: #bbf7d0; background: rgba(34, 197, 94, .16); border-color: rgba(74, 222, 154, .35); }
.isc-pct--gold { color: #fde68a; background: rgba(245, 158, 11, .17); border-color: rgba(251, 191, 36, .45); }
.isc-pct--red { color: #fecdd3; background: rgba(225, 29, 72, .22); border-color: rgba(251, 113, 133, .5); }
.isc-pct--purple { color: #ddd6fe; background: rgba(124, 58, 237, .18); border-color: rgba(196, 181, 253, .4); }
.isc-pct--grey { color: #a3afc2; background: rgba(148, 163, 184, .12); border-color: rgba(148, 163, 184, .3); }

.isc-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(15, 23, 42, .4); border: 1px solid var(--isc-line); margin: 16px 0 6px; overflow-x: auto; }
.isc-tabs button { flex: 1 0 auto; border: 0; background: transparent; color: var(--isc-muted); font: 700 13px/1 var(--isc-font); padding: 10px 14px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; }
.isc-tabs button em { font-style: normal; font-size: 11px; padding: 2px 7px; border-radius: 99px; background: rgba(248, 250, 252, .1); color: var(--isc-text-2); }
.isc-tabs button em.is-warn { background: rgba(245, 158, 11, .25); color: #fde68a; }
.isc-tabs button[aria-selected="true"] { background: rgba(248, 250, 252, .14); color: var(--isc-text); }

.isc-sec { margin-top: 16px; }
.isc-h { margin: 0 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--isc-muted); display: flex; gap: 7px; align-items: center; font-family: var(--isc-font); }
.isc-n { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: rgba(248, 250, 252, .08); letter-spacing: 0; }
.isc-link { all: unset; margin-left: auto; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 700; color: #7dd3fc; display: inline-flex; gap: 4px; align-items: center; }
.isc-link:hover { text-decoration: underline; }
.isc-muted { margin: 0; color: var(--isc-muted); font-size: 13px; }
.isc-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--isc-faint); line-height: 1.5; }
.isc-hint b { color: #ddd6fe; }
.isc-warn { color: #fde68a; }
.isc-line { margin: 0; font-size: 13.5px; color: var(--isc-text-2); line-height: 1.5; padding: 10px 12px; border-radius: 12px; background: rgba(248, 250, 252, .04); }
.isc-lbl { display: block; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--isc-muted); margin: 0 0 6px; }
.isc-lbl--plain { text-transform: none; letter-spacing: 0; font-size: 12.5px; display: grid; gap: 6px; }
.isc-opt { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--isc-faint); }

.isc-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: rgba(248, 250, 252, .06); }
.isc-bar span { display: block; height: 100%; }
.isc-why { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.isc-why li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 96px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(248, 250, 252, .04); font-size: 13px; }
.isc-why em { font-style: normal; font-weight: 800; color: var(--isc-text); font-variant-numeric: tabular-nums; }
.isc-why small { color: var(--isc-faint); font-size: 11.5px; text-align: right; }

.isc-trend { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; padding: 10px 12px; border-radius: 14px; background: rgba(248, 250, 252, .035); }
.isc-spark { width: min(340px, 60%); height: 60px; display: block; }
.isc-trend__t { display: grid; gap: 2px; text-align: right; font-size: 13px; }
.isc-trend__t small { color: var(--isc-faint); }
.isc-up { color: #fecdd3 !important; } .isc-down { color: #bbf7d0 !important; }
.isc-ks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.isc-ks > div { padding: 10px 12px; border-radius: 14px; background: rgba(248, 250, 252, .045); }
.isc-ks b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.isc-ks b small { font-size: 11px; color: var(--isc-faint); font-weight: 600; }
.isc-ks span { display: block; font-size: 11.5px; color: var(--isc-muted); font-weight: 700; }
.isc-ks > div > small { font-size: 11px; color: var(--isc-faint); }

.isc-ch { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid var(--isc-line); background: rgba(15, 23, 42, .35); color: var(--isc-text-2); white-space: nowrap; }
.isc-ch button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; padding: 0 0 0 2px; }
.isc-ch--red { border-color: rgba(251, 113, 133, .5); background: rgba(190, 18, 60, .2); color: #fda4af; }
.isc-ch--orange { border-color: rgba(251, 146, 60, .5); background: rgba(234, 88, 12, .16); color: #fdba74; }
.isc-ch--gold { border-color: rgba(251, 191, 36, .5); background: rgba(245, 158, 11, .17); color: #fde68a; }
.isc-ch--purple { border-color: rgba(196, 181, 253, .45); background: rgba(124, 58, 237, .2); color: #ddd6fe; }
.isc-ch--green { border-color: rgba(74, 222, 154, .45); background: rgba(34, 197, 94, .15); color: #bbf7d0; }
.isc-ch--grey { border-color: rgba(148, 163, 184, .4); background: rgba(148, 163, 184, .12); color: #cbd5e1; }

.isc-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.isc-note { padding: 10px 12px; border-radius: 14px; background: rgba(248, 250, 252, .045); border-left: 3px solid var(--nc, #94a3b8); }
.isc-note--red { --nc: #fb7185; } .isc-note--orange { --nc: #fdba74; } .isc-note--gold { --nc: #fbbf24; } .isc-note--purple { --nc: #c4b5fd; } .isc-note--green { --nc: #4ade80; }
.isc-note__h { display: flex; gap: 6px; align-items: center; }
.isc-note__w { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--isc-text-2); }
.isc-note p { margin: 6px 0 4px; color: var(--isc-text-2); font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
.isc-note small { color: var(--isc-faint); font-size: 11.5px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

.isc-tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.isc-tl li { display: grid; grid-template-columns: 64px 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 12px; background: rgba(248, 250, 252, .035); font-size: 13px; }
.isc-tl time { color: var(--isc-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.isc-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.isc-tl__ev { all: unset; cursor: pointer; min-width: 0; }
.isc-tl__ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isc-tl__ev:hover b { text-decoration: underline; }
.isc-tl__ev small { display: block; color: var(--isc-faint); font-size: 11.5px; }
.isc-tl em { font-style: normal; font-size: 11.5px; font-weight: 700; white-space: nowrap; }

/* Pulsanti */
.isc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--isc-line); background: rgba(248, 250, 252, .07); color: var(--isc-text-2); font: 700 13px/1 var(--isc-font); cursor: pointer; white-space: nowrap; transition: background-color .2s, transform .15s; box-shadow: none; margin: 0; }
.isc-btn:hover:not(:disabled) { background: rgba(248, 250, 252, .14); }
.isc-btn:active { transform: scale(.97); }
.isc-btn:disabled { opacity: .45; cursor: not-allowed; }
.isc-btn--sm { min-height: 30px; padding: 0 11px; font-size: 12px; }
.isc-btn--icon { width: 34px; padding: 0; }
.isc-btn--sm.isc-btn--icon { width: 30px; }
.isc-btn--ghost { background: transparent; border-color: transparent; }
.isc-btn--del { color: #fda4af; }
.isc-btn--green { color: #bbf7d0; background: rgba(34, 197, 94, .28); border-color: rgba(74, 222, 154, .5); }
.isc-btn--green:hover:not(:disabled) { background: rgba(34, 197, 94, .42); }
.isc-btn--blue { color: #e0f2fe; background: rgba(14, 165, 233, .34); border-color: rgba(125, 211, 252, .45); }
.isc-btn--blue:hover:not(:disabled) { background: rgba(14, 165, 233, .5); }
.isc-modal :focus-visible { outline: 2px solid #f1c40f; outline-offset: 2px; }

/* Form */
.isc-comp { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: rgba(248, 250, 252, .035); border: 1px solid var(--isc-line-soft); }
.isc-comp .isc-h { margin-bottom: 0; }
.isc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.isc-tag { display: inline-flex; gap: 6px; align-items: center; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--isc-line); background: rgba(15, 23, 42, .35); color: var(--isc-text-2); font: 700 12px/1 var(--isc-font); cursor: pointer; }
.isc-tag[aria-pressed="true"] { color: var(--isc-text); }
.isc-tag--red i { color: #fb7185; } .isc-tag--orange i { color: #fdba74; } .isc-tag--gold i { color: #fbbf24; } .isc-tag--purple i { color: #c4b5fd; } .isc-tag--green i { color: #4ade80; } .isc-tag--grey i { color: #a3afc2; }
.isc-tag--red[aria-pressed="true"] { background: rgba(225, 29, 72, .24); border-color: rgba(251, 113, 133, .6); }
.isc-tag--orange[aria-pressed="true"] { background: rgba(234, 88, 12, .22); border-color: rgba(251, 146, 60, .6); }
.isc-tag--gold[aria-pressed="true"] { background: rgba(245, 158, 11, .22); border-color: rgba(251, 191, 36, .6); }
.isc-tag--purple[aria-pressed="true"] { background: rgba(124, 58, 237, .26); border-color: rgba(196, 181, 253, .6); }
.isc-tag--green[aria-pressed="true"] { background: rgba(34, 197, 94, .22); border-color: rgba(74, 222, 154, .6); }
.isc-tag--grey[aria-pressed="true"] { background: rgba(148, 163, 184, .2); border-color: rgba(148, 163, 184, .5); }
.isc-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.isc-grid label { display: grid; gap: 5px; font-size: 12px; font-weight: 700; color: var(--isc-muted); margin: 0; }
.isc-in { width: 100%; min-height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--isc-line); background: rgba(15, 23, 42, .45); color: #f8fafc; font: 500 13.5px/1.3 var(--isc-font); margin: 0; color-scheme: dark; }
.isc-in:focus { outline: none; border-color: rgba(125, 211, 252, .6); }
.isc-in--sm { width: auto; flex: 1 1 160px; min-height: 30px; border-radius: 999px; font-size: 12.5px; }
.isc-ta { min-height: 72px; padding: 10px 12px; resize: vertical; }
.isc-range { display: grid; gap: 6px; font-size: 13px; color: var(--isc-text-2); margin: 0; }
.isc-range small { color: var(--isc-faint); }
.isc-modal input[type=range] { width: 100%; accent-color: #6ec1f5; margin: 0; }
.isc-anche { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.isc-anche .isc-lbl { margin: 0 4px 0 0; }
.isc-cand { display: flex; gap: 6px; flex-wrap: wrap; }
.isc-cand small { color: var(--isc-faint); font-weight: 500; }
.isc-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.isc-foot__b { display: flex; gap: 8px; }
.isc-prev { margin: 0; font-size: 13px; color: var(--isc-text-2); }
.isc-corr { display: grid; gap: 12px; padding: 14px; border-radius: 18px; background: rgba(248, 250, 252, .035); border: 1px solid var(--isc-line-soft); }
.isc-switch { display: flex; gap: 10px; align-items: center; font-weight: 700; color: var(--isc-text); cursor: pointer; margin: 0; }
.isc-switch input { width: 18px; height: 18px; accent-color: #a78bfa; margin: 0; }
.isc-corr__v { margin-left: auto; font-size: 24px; color: #ddd6fe !important; }

@media (max-width: 760px) {
    .isc-modal { padding: 0; align-items: stretch; }
    .isc-box { max-height: none; height: 100%; border-radius: 0; padding: 14px 14px 30px; zoom: 1 !important; }
    .isc-head { grid-template-columns: 46px minmax(0, 1fr) auto; }
    .isc-head .isc-pct { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
    .isc-head [data-a="chiudi"] { grid-column: 3; grid-row: 1; }
    .isc-ks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .isc-grid { grid-template-columns: 1fr; }
    .isc-why li { grid-template-columns: 20px minmax(0, 1fr) auto; }
    .isc-why small { display: none; }
    .isc-tabs button { padding: 10px 11px; }
}
@media (prefers-reduced-motion: reduce) { .isc-modal * { transition: none !important; } }

/* Barra di scorrimento moderna (scura e arrotondata) */
.isc-box, .ic-drawer { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .35) transparent; }
.isc-box::-webkit-scrollbar, .ic-drawer::-webkit-scrollbar { width: 10px; }
.isc-box::-webkit-scrollbar-track, .ic-drawer::-webkit-scrollbar-track { background: transparent; margin: 18px 0; }
.isc-box::-webkit-scrollbar-thumb, .ic-drawer::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .3); border-radius: 999px; border: 3px solid #2c3648; }
.isc-box::-webkit-scrollbar-thumb:hover, .ic-drawer::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .5); }
