/* CyberAsset Access — stile della proposta C (layouts/c-dark.html) */
:root {
  --bg: #0B0D10; --surface: #15181D; --surface-2: #1C2026; --surface-3: #242931;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.16);
  --text: #F2F4F7; --muted: #9AA3AF; --faint: #6B7380;
  --accent: #C6F432; --on-accent: #0B0D10; --accent-ink: #C6F432; --ring: #C6F432;
  --danger: #FF5D5D; --warning: #FFB547; --success: #3DDC97;
  --danger-bg: rgba(255,93,93,.12); --warning-bg: rgba(255,181,71,.12); --success-bg: rgba(61,220,151,.12);
  --panel: #F4F5F2; --panel-text: #0B0D10; --panel-muted: #5B636E; --panel-border: rgba(0,0,0,.07);
  --overlay: rgba(5,6,8,.72);
  --shadow: 0 20px 50px rgba(0,0,0,.45);
  --r-lg: 24px; --r-md: 16px; --r-sm: 10px;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #EEF0EC; --surface: #FFFFFF; --surface-2: #F5F6F3; --surface-3: #E8EAE5;
  --border: rgba(11,13,16,.09); --border-strong: rgba(11,13,16,.18);
  --text: #0B0D10; --muted: #4F5763; --faint: #6B7380;
  --accent: #C6F432; --on-accent: #0B0D10; --accent-ink: #3F6212; --ring: #3F6212;
  --danger: #C62828; --warning: #9A5B00; --success: #0F7B4F;
  --danger-bg: #FDECEC; --warning-bg: #FFF4E0; --success-bg: #E5F6EE;
  --panel: #0B0D10; --panel-text: #F2F4F7; --panel-muted: #A1A9B4; --panel-border: rgba(255,255,255,.08);
  --overlay: rgba(11,13,16,.45);
  --shadow: 0 20px 50px rgba(11,13,16,.18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
.ic { flex: none; display: block; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -.02em; }


/* Shell */
.app { display: grid; grid-template-columns: 72px 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0; border-right: 1px solid var(--border); background: var(--bg); z-index: 20; }
.rail .logo { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); margin-bottom: 14px; }
.rail-btn { position: relative; width: 48px; height: 48px; border-radius: 14px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; transition: background .15s, color .15s; }
.rail-btn:hover { background: var(--surface-2); color: var(--text); }
.rail-btn[aria-current="page"] { background: var(--surface-3); color: var(--text); }
.rail-btn[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.rail-btn[data-tip]:hover::after, .rail-btn[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 58px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--border); pointer-events: none; z-index: 30;
}
.rail .spacer { flex: 1; }
.rail .fab { display: none; }

main { min-width: 0; padding: 32px 40px 80px; max-width: 1320px; width: 100%; }

/* Header vista */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.brand-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.h-xl { font-size: clamp(34px, 4.2vw, 56px); line-height: 1; font-weight: 700; letter-spacing: -.035em; }
.h-lg { font-size: 32px; line-height: 1.1; font-weight: 700; }
.h-md { font-size: 20px; font-weight: 600; }

/* Bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px; transition: transform .1s, background .15s, border-color .15s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn-primary:hover { background: #d4ff4f; }
.btn-danger { color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* Ricerca */
.search { position: relative; margin-bottom: 20px; }
.search .ic { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 64px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); padding: 0 20px 0 56px; font-size: 18px; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }

/* Pillole stato */
.pills { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 28px; }
.pill { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); text-align: left; min-height: 72px; transition: border-color .15s, transform .15s; }
.pill:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.pill .big { font-family: var(--font-head); font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.pill .lbl { font-size: 13px; color: var(--muted); }
.pill .dot { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ring-mini { flex: none; }

/* Sezioni */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-head h2 { font-size: 18px; font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* Carosello preferiti */
.carousel-wrap { position: relative; margin-bottom: 32px; }
.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px; }
.carousel::-webkit-scrollbar { display: none; }
.fav { scroll-snap-align: start; flex: 0 0 220px; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); text-align: left; }
.fav:hover { border-color: var(--border-strong); }
.fav .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav > div { min-width: 0; flex: 1; }
.car-ctrl { display: flex; gap: 6px; }

/* Avatar */
.av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-family: var(--font-head); font-size: 14px; flex: none; }
.av-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }

/* Tile spazi */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.tile { position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 20px; text-align: left; transition: transform .15s, background .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.tile .ti { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
.tile .tn { font-family: var(--font-head); font-weight: 600; font-size: 17px; line-height: 1.2; }
.tile .badge-count { position: absolute; top: 14px; right: 14px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.tile[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: transparent; }
.tile[aria-pressed="true"] .ti { background: var(--accent); color: var(--on-accent); }
.tile.add { background: transparent; border: 1.5px dashed var(--border-strong); }
.tile.add .ti { background: var(--text); color: var(--bg); }

/* Pannello lista stile UI 5 */
.panel { background: var(--panel); color: var(--panel-text); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.panel-head h2 { font-size: 20px; }
.panel-head .muted { color: var(--panel-muted); }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 20px; border-top: 1px solid var(--panel-border); }
.row:first-of-type { border-top: 0; }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; background: none; border: 0; padding: 4px 0; text-align: left; color: inherit; }
.row-main .name { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-main .sub { font-size: 13px; color: var(--panel-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main > div { min-width: 0; }
.row .icon-btn { color: var(--panel-muted); }
.row .icon-btn:hover { background: rgba(127,127,127,.14); color: var(--panel-text); }
.row:hover { background: rgba(127,127,127,.06); }
.more { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 16px 20px; border: 0; border-top: 1px solid var(--panel-border); background: transparent; color: var(--panel-text); font-weight: 600; }
.more:hover { background: rgba(127,127,127,.06); }
.empty { padding: 40px 20px; text-align: center; color: var(--panel-muted); }
.empty .ic { margin: 0 auto 10px; }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.muted { background: var(--surface-3); color: var(--muted); }
.badge.accent { background: var(--accent); color: var(--on-accent); }
.panel .badge.muted { background: rgba(127,127,127,.15); color: var(--panel-muted); }

/* Dettaglio */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs button { background: none; border: 0; padding: 4px 2px; color: var(--muted); font-weight: 500; }
.crumbs button:hover { color: var(--text); text-decoration: underline; }
.detail-top { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.detail-top .t { flex: 1; min-width: 200px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.field { padding: 14px 0; border-top: 1px solid var(--border); }
.field:first-of-type { border-top: 0; padding-top: 0; }
.field .k { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.field .v { display: flex; align-items: center; gap: 8px; }
.field .v .val { flex: 1; min-width: 0; font-size: 18px; overflow-wrap: anywhere; white-space: pre-wrap; }
.field .v .val.mono { font-size: 17px; letter-spacing: .02em; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; transition: width .3s; }
.checklist { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.checklist li.ok .ic { color: var(--success); }
.checklist li.no { color: var(--muted); }
.checklist li.no .ic { color: var(--faint); }
.share-mini { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.share-mini:first-of-type { border-top: 0; }
.share-mini > div { flex: 1; min-width: 0; }
.share-mini .to { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-mini .meta { font-size: 12px; color: var(--muted); }

/* Salute */
.health-top { display: grid; grid-template-columns: 320px 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.gauge-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.gauge { position: relative; width: 240px; height: 200px; }
.gauge svg { width: 100%; height: 100%; }
.gauge .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 10px; }
.gauge .num b { font-family: var(--font-head); font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; }
.risk-chip { margin-top: 6px; padding: 10px 16px; border-radius: 999px; background: var(--surface-3); font-weight: 500; font-size: 14px; }
.hgroup { border-top: 1px solid var(--border); }
.hgroup:first-child { border-top: 0; }
.hgroup > button { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 4px; background: none; border: 0; text-align: left; min-height: 64px; }
.hgroup > button .dot { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.hgroup > button > div { flex: 1; }
.hgroup > button .t { font-weight: 600; }
.hgroup > button .s { font-size: 13px; color: var(--muted); }
.hgroup > button .chev { transition: transform .2s; color: var(--muted); }
.hgroup > button[aria-expanded="true"] .chev { transform: rotate(90deg); }
.hgroup ul { list-style: none; margin: 0 0 12px; padding: 0 0 0 58px; display: grid; gap: 6px; }
.hgroup li button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); text-align: left; }
.hgroup li button:hover { border-color: var(--border-strong); }

/* Condivisioni */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.seg button { min-height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.share-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.share-card { display: flex; flex-direction: column; gap: 14px; }
.share-card .top { display: flex; align-items: center; gap: 12px; }
.share-card .top > div { flex: 1; min-width: 0; }
.share-card .top .n { font-weight: 600; }
.share-card .top .to { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; font-size: 13px; }
.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { font-weight: 500; }
.share-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Sviluppatori */
.dev-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 16px; }
.term { background: #07080A; color: #D7DCE2; border-radius: var(--r-lg); border: 1px solid rgba(255,255,255,.08); overflow: hidden; font-family: var(--mono); font-size: 13.5px; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); color: #8C949E; font-size: 12px; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a2f37; display: block; }
.term-bar span { margin-left: 8px; }
.term-line { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 16px; }
.term-line + .term-line { border-top: 1px dashed rgba(255,255,255,.06); }
.term-line code { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 11px; }
.term-line code .p { color: #C6F432; }
.term-line .out { display: block; color: #7D8691; margin-top: 4px; }
.term .icon-btn { color: #8C949E; }
.term .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.sa { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.sa:first-of-type { border-top: 0; padding-top: 0; }
.sa > div { flex: 1; min-width: 0; }
.sa .n { font-weight: 600; font-family: var(--mono); font-size: 14px; }
.sa .m { font-size: 12.5px; color: var(--muted); }
.token-box { margin-top: 14px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--accent); }
.token-box .mono { overflow-wrap: anywhere; font-size: 13px; }

/* Impostazioni */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.set-row:first-of-type { border-top: 0; padding-top: 0; }
.set-row .t { font-weight: 600; }
.set-row .s { font-size: 13px; color: var(--muted); }
select.input { width: auto; }

/* Switch */
.switch { position: relative; display: inline-flex; flex: none; width: 52px; height: 30px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .18s, background .15s; }
.switch input:checked + span { background: var(--accent); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(22px); background: var(--on-accent); }
.switch input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Form */
.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); }
textarea.input { min-height: 120px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.lbl { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.fgroup { margin-bottom: 16px; }
.err { color: var(--danger); font-size: 12.5px; margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.with-btn { display: flex; gap: 8px; }
.with-btn .input { flex: 1; }
.with-btn .icon-btn { width: 48px; height: 48px; border: 1px solid var(--border-strong); background: var(--surface-2); flex: none; }

/* Modali */
.overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 100; }
.overlay[hidden] { display: none; }
.dialog { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 26px; animation: pop .18s ease-out; }
.dialog.sm { width: min(420px, 100%); }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.dlg-head h2 { font-size: 24px; }
.dlg-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.dlg-foot .btn { flex: 1; min-width: 140px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.type-tile { aspect-ratio: 1.15 / 1; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 13.5px; text-align: center; padding: 8px; }
.type-tile .ti { width: 46px; height: 46px; border-radius: 14px; background: var(--surface-3); display: grid; place-items: center; }
.type-tile:hover { border-color: var(--border-strong); }
.type-tile:hover .ti { background: var(--accent); color: var(--on-accent); }

.gen-toggle { width: 100%; margin-top: 10px; border-radius: 14px; }
.gen { margin-top: 10px; border: 1px solid var(--border); border-radius: 18px; padding: 14px; display: grid; gap: 10px; background: var(--surface-2); }
.gen-out { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); }
.gen-out .mono { flex: 1; min-width: 0; font-size: 18px; overflow-wrap: anywhere; }
.gen-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); min-height: 54px; }
.gen-row label { font-weight: 500; font-size: 14px; }
.range-head { display: flex; justify-content: space-between; font-weight: 500; font-size: 14px; }
.range-head output { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.strength-line { display: flex; justify-content: space-between; font-size: 12.5px; margin: 10px 0 6px; color: var(--muted); }
.strength-line b { color: var(--text); font-weight: 600; }

.mode-tiles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.mode-tile { border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface-2); padding: 14px 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: left; font-weight: 600; font-size: 13.5px; min-height: 92px; }
.mode-tile small { font-weight: 400; color: var(--muted); font-size: 12px; line-height: 1.35; }
.mode-tile[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-tile[aria-checked="true"] .ic { color: var(--accent-ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); font-weight: 600; font-size: 13.5px; }
.chip[aria-checked="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.share-result { text-align: center; }
.share-result .okc { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); margin: 0 auto 14px; }
.url-box { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); text-align: left; margin: 16px 0; }
.url-box .mono { flex: 1; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.pin-box { padding: 18px; border-radius: 18px; background: var(--accent); color: var(--on-accent); margin-bottom: 14px; }
.pin-box .pin { font-family: var(--mono); font-size: 38px; font-weight: 600; letter-spacing: .18em; }
.pin-box small { display: block; font-size: 13px; font-weight: 500; }
.countdown { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }

/* Toast */
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 200; max-width: min(380px, calc(100vw - 32px)); }
.caa-toast { padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 500; font-size: 14px; box-shadow: var(--shadow); animation: pop .2s ease-out; transition: opacity .25s, transform .25s; border-left: 4px solid var(--accent); }
.caa-toast--success { border-left-color: var(--success); }
.caa-toast--error { border-left-color: var(--danger); }
.caa-toast.is-leaving { opacity: 0; transform: translateY(6px); }

/* Responsive */
@media (max-width: 1100px) {
  main { padding: 28px 28px 80px; }
  .detail-grid, .dev-grid { grid-template-columns: 1fr; }
  .health-top { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 72px; flex-direction: row; justify-content: space-around; padding: 0 8px; border-right: 0; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); }
  .rail .logo, .rail .spacer, .rail .rail-btn.desk { display: none; }
  .rail-btn[aria-current="page"]::before { left: 14px; right: 14px; top: auto; bottom: -10px; width: auto; height: 3px; }
  .rail-btn[data-tip]:hover::after, .rail-btn[data-tip]:focus-visible::after { display: none; }
  .rail .fab { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); margin-top: -28px; box-shadow: 0 10px 24px rgba(198,244,50,.25); }
  main { padding: 20px 16px 110px; }
  .pills { grid-template-columns: 1fr; gap: 8px; }
  .pill { min-height: 60px; }
  .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .tile { padding: 16px; aspect-ratio: 1.1 / 1; }
  .tile .ti { width: 48px; height: 48px; }
  .search input { height: 56px; font-size: 16px; }
  .type-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mode-tiles { grid-template-columns: 1fr; }
  .mode-tile { min-height: 0; flex-direction: row; align-items: center; }
  .dialog { padding: 20px; }
  .share-list { grid-template-columns: 1fr; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
  #toasts { right: 16px; bottom: 90px; }
  .head-cta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ */
/* Aggiunte di CyberAsset Access (accesso, barra superiore, tabelle)   */
/* ------------------------------------------------------------------ */
[hidden] { display: none !important; }
.rail .logo img { width: 26px; height: auto; display: block; }

/* Accesso */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-hero { position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--border); background:
  radial-gradient(600px 400px at 0% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--bg); }
.login-hero .logo-full { width: 210px; height: auto; display: block; }
.login-hero h1 { font-size: clamp(38px, 4.6vw, 64px); line-height: 1; letter-spacing: -.035em; font-weight: 700; max-width: 12ch; }
.login-hero h1 em { font-style: normal; color: var(--accent); }
.login-hero p { color: var(--muted); max-width: 46ch; font-size: 16px; margin: 18px 0 0; }
.login-hero .trust { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.login-hero .trust span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); }
.login-hero .trust .ic { color: var(--accent); }
.login-hero .foot { font-size: 12px; color: var(--faint); }
.login-side { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(420px, 100%); }
.login-card .logo-mobile { display: none; width: 170px; margin-bottom: 28px; }
.login-card h2 { font-size: 30px; font-weight: 700; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin: 0 0 26px; }
.login-card .btn { width: 100%; min-height: 52px; font-size: 15px; }
.code-input { font-family: var(--mono); font-size: 30px; letter-spacing: .5em; text-align: center; min-height: 64px; padding-left: .5em; }
.linkish { background: none; border: 0; color: var(--muted); font-weight: 500; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--text); }
.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; margin-bottom: 16px; }
.msg.err { background: var(--danger-bg); color: var(--danger); margin-top: 0; }
.msg.ok { background: var(--success-bg); color: var(--success); }
.msg.info { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* Barra superiore con logo */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.topbar .logo-full { height: 46px; width: auto; display: block; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .em { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* Credenziali (area utente) */
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.cred { display: flex; flex-direction: column; gap: 4px; }
.cred .top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cred .top > div { flex: 1; min-width: 0; }
.cred .top .n { font-family: var(--font-head); font-weight: 600; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred .top a { font-size: 13px; color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cred .top a:hover { color: var(--accent-ink); }
.cred .top a .ic { display: inline; vertical-align: -1px; }
.cred .tile-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.cred .note { font-size: 13.5px; color: var(--muted); white-space: pre-wrap; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.secret-val { font-family: var(--mono); font-size: 17px; letter-spacing: .02em; overflow-wrap: anywhere; }
.secret-val.masked { letter-spacing: .2em; color: var(--muted); }
.hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); margin-top: 22px; }

/* Righe del pannello: azioni a destra */
.row-actions { display: flex; gap: 2px; align-items: center; }
.row .meta-r { font-size: 12.5px; color: var(--panel-muted); text-align: right; white-space: nowrap; }
.panel .btn { background: transparent; color: var(--panel-text); border-color: var(--panel-border); }

/* Tabella del registro */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .ua { color: var(--faint); font-size: 12px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.ev:first-of-type { border-top: 0; padding-top: 0; }
.ev .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); flex: none; color: var(--muted); }
.ev .dot.accent { background: var(--accent); color: var(--on-accent); }
.ev .t { font-weight: 600; font-size: 14px; }
.ev .m { font-size: 12.5px; color: var(--muted); }

/* Invito: modulo + anteprima */
.dialog.xl { width: min(1180px, 100%); }
.invite-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; }
.preview { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); background: #EEF0EC; display: flex; flex-direction: column; min-height: 520px; }
.preview .bar { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12.5px; }
.preview .bar b { color: var(--text); font-weight: 600; }
.preview .bar span { color: var(--muted); }
.preview iframe { flex: 1; width: 100%; border: 0; background: #EEF0EC; min-height: 480px; }
textarea.input.tall { min-height: 300px; line-height: 1.55; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .invite-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-card .logo-mobile { display: block; }
}
@media (max-width: 768px) {
  .topbar { margin-bottom: 20px; }
  .topbar .logo-full { height: 36px; }
  .who .em { display: none; }
  .cred-grid { grid-template-columns: 1fr; }
  .row .meta-r { display: none; }
}
