:root { --ed-bg: #0e0e0d; --ed-panel: #151514; --ed-panel-2: #1c1c1a; --ed-line: #2a2a27; --ed-text: #f4f4f2; --ed-soft: #a3a39d; --ed-faint: #6e6e69; --ed-danger: #f87171; }
html, body { background: var(--ed-bg); color: var(--ed-text); font-size: 13px; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lbl { display: block; margin-bottom: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ed-faint); }
input, select, textarea { width: 100%; box-sizing: border-box; font: inherit; color: var(--ed-text); background: var(--ed-panel-2); border: 1px solid var(--ed-line); border-radius: 0; padding: 9px 10px; outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--ed-soft); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input[type=range] { padding: 0; accent-color: var(--nms-amber); background: none; border: 0; }
input[type=checkbox] { width: auto; accent-color: var(--nms-amber); margin: 2px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--ed-line); background: transparent; font-weight: 600; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover:not(:disabled) { border-color: var(--ed-soft); }
.btn.primary { background: var(--ed-text); color: var(--nms-ink); border-color: var(--ed-text); }
.btn.primary:hover:not(:disabled) { background: transparent; color: var(--ed-text); }
.btn.danger { color: var(--ed-danger); }
.btn.danger:hover:not(:disabled) { border-color: var(--ed-danger); }
.btn.danger.solid { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn:disabled { opacity: .35; cursor: default; }
.icon-btn { width: 34px; padding: 0; }
.seg { display: flex; border: 1px solid var(--ed-line); }
.seg button { flex: 1; height: 32px; padding: 0 12px; border: 0; background: none; color: var(--ed-soft); font-weight: 600; font-size: 12px; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--ed-line); }
.seg button.on { background: var(--ed-text); color: var(--nms-ink); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; line-height: 1.45; color: var(--ed-faint); }
.check b { display: block; color: var(--ed-text); font-weight: 600; }
.muted { color: var(--ed-faint); line-height: 1.55; margin: 0; }
.toast { background: var(--ed-text); color: var(--nms-ink); z-index: 200; }

/* Accesso */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 15%, #262623, var(--ed-bg) 70%); }
.login form { width: min(360px, 100%); display: grid; gap: 14px; }
.login img { height: 34px; filter: invert(1); justify-self: start; margin-bottom: 22px; }
.login h1 { margin: 0 0 6px; font-size: 32px; letter-spacing: -.035em; }
.login .btn { height: 44px; }
.login .err { color: var(--ed-danger); min-height: 18px; margin: 0; line-height: 1.45; }
.login .pw-field { display: grid; }
.login .pw-box { display: flex; border: 1px solid var(--ed-line); background: var(--ed-panel-2); transition: border-color .15s; }
.login .pw-box:focus-within { border-color: var(--ed-soft); }
.login .bad .pw-box { border-color: var(--ed-danger); }
.login .pw-box input { border: 0; background: none; height: 46px; font-size: 16px; letter-spacing: .02em; } /* 16px: iPhone non ingrandisce la pagina */
.login .pw-box button { border: 0; background: none; padding: 0 14px; color: var(--ed-soft); font-weight: 600; font-size: 12px; }
.login .pw-box button:hover { color: var(--ed-text); }
.login .hint { margin: -6px 0 0; color: var(--nms-amber); font-size: 12px; }
.login .btn:disabled { opacity: .6; }
.login form.bad { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@media (prefers-reduced-motion: reduce) { .login form.bad { animation: none; } }
.login .forgot { border-top: 1px solid var(--ed-line); padding-top: 14px; color: var(--ed-faint); }
.login .forgot summary { cursor: pointer; font-weight: 600; color: var(--ed-soft); list-style: none; }
.login .forgot p { margin: 10px 0 0; }
.login .forgot code { display: block; margin-top: 8px; padding: 10px; background: var(--ed-panel-2); color: var(--ed-text); font-size: 11px; line-height: 1.5; word-break: break-all; user-select: all; }

/* ——— Libreria ——— */
.lib { min-height: 100vh; }
.lib-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 64px; padding: 0 32px; background: rgba(14,14,13,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ed-line); }
.lib-top img { height: 26px; filter: invert(1); }
.lib-top .crumb { padding-left: 18px; border-left: 1px solid var(--ed-line); font-weight: 600; color: var(--ed-soft); }
.search { position: relative; margin-left: auto; width: min(340px, 34vw); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ed-faint); }
.search input { padding-left: 34px; }
.lib-main { max-width: 1320px; margin: 0 auto; padding: 36px 32px 80px; }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.lib-head h1 { margin: 0; font-size: 46px; line-height: 1; letter-spacing: -.045em; }
.lib-head p { margin: 10px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ed-line); margin-bottom: 32px; }
.tile { padding: 20px 22px; }
.tile + .tile { border-left: 1px solid var(--ed-line); }
.tile b { display: block; font-size: 32px; letter-spacing: -.03em; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile small { color: var(--ed-faint); }
.meter { height: 4px; background: var(--ed-line); margin-top: 12px; }
.meter i { display: block; height: 100%; background: var(--ed-text); }
.meter.warn i { background: var(--nms-amber); }
.filters { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.filters select { width: auto; min-width: 160px; height: 34px; padding: 0 10px; }
.filters .spacer { flex: 1; }
.count { color: var(--ed-faint); font-size: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card { position: relative; text-align: left; border: 1px solid var(--ed-line); background: var(--ed-panel); display: flex; flex-direction: column; cursor: pointer; transition: border-color .2s, transform .35s var(--ease); }
.card:hover { border-color: var(--ed-soft); transform: translateY(-2px); }
.card .cover { aspect-ratio: 16 / 9; background: var(--ed-panel-2); overflow: hidden; position: relative; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.card:hover .cover img { transform: scale(1.05); }
.badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge { padding: 4px 8px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: rgba(0,0,0,.62); backdrop-filter: blur(6px); display: inline-flex; align-items: center; gap: 5px; }
.badge.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.badge.draft { color: var(--nms-amber); }
.card .body { padding: 14px 16px 16px; display: grid; gap: 4px; }
.card .client { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ed-faint); min-height: 14px; }
.card b { font-size: 16px; letter-spacing: -.01em; }
.card .facts { display: flex; gap: 14px; color: var(--ed-faint); font-size: 12px; margin-top: 6px; }
.card .facts span { display: inline-flex; gap: 5px; align-items: center; }
.card .facts svg { width: 13px; height: 13px; }
.more { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.card:hover .more, .more[aria-expanded=true], .row-item .more { opacity: 1; }
.card.new { align-items: center; justify-content: center; min-height: 262px; border-style: dashed; color: var(--ed-soft); gap: 10px; font-weight: 600; }
.card.new svg { width: 28px; height: 28px; }
.empty { padding: 60px 0; text-align: center; color: var(--ed-faint); }

/* elenco */
.list { border: 1px solid var(--ed-line); }
.row-item { display: grid; grid-template-columns: 96px minmax(0, 2.2fr) repeat(4, minmax(0, 1fr)) 40px; gap: 16px; align-items: center; padding: 10px 14px; cursor: pointer; position: relative; }
.row-item + .row-item { border-top: 1px solid var(--ed-line); }
.row-item:hover { background: var(--ed-panel); }
.row-item.head { cursor: default; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ed-faint); background: none; }
.row-item img { width: 96px; height: 54px; object-fit: cover; display: block; background: var(--ed-panel-2); }
.row-item .t b { display: block; font-size: 14px; }
.row-item .t small { color: var(--ed-faint); }
.row-item .num { font-variant-numeric: tabular-nums; color: var(--ed-soft); }
.row-item .more { position: static; background: none; }

/* menu azioni */
.menu { position: fixed; z-index: 120; min-width: 220px; padding: 6px; background: var(--ed-panel-2); border: 1px solid var(--ed-line); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; color: var(--ed-text); text-align: left; text-decoration: none; font-weight: 500; }
.menu button:hover, .menu a:hover { background: var(--ed-line); }
.menu hr { border: 0; border-top: 1px solid var(--ed-line); margin: 6px 0; }
.menu .danger { color: var(--ed-danger); }

/* finestre */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal form { width: min(480px, 100%); background: var(--ed-panel); border: 1px solid var(--ed-line); padding: 28px; display: grid; gap: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: rise .3s var(--ease); }
.modal h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.modal .slug { display: flex; align-items: stretch; }
.modal .slug span { display: flex; align-items: center; padding: 0 10px; background: var(--ed-bg); border: 1px solid var(--ed-line); border-right: 0; color: var(--ed-faint); white-space: nowrap; font-size: 12px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal .err { color: var(--ed-danger); margin: 0; min-height: 0; }

/* statistiche */
.drawer { position: fixed; z-index: 140; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--ed-panel); border-left: 1px solid var(--ed-line); box-shadow: -30px 0 80px rgba(0,0,0,.5); display: flex; flex-direction: column; animation: slidein .35s var(--ease); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0 } }
.drawer header { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--ed-line); }
.drawer header div { flex: 1; min-width: 0; }
.drawer header b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer .content { flex: 1; overflow-y: auto; padding: 22px 20px 32px; display: grid; gap: 28px; align-content: start; }
.hero { display: flex; align-items: baseline; gap: 12px; }
.hero b { font-size: 48px; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--ed-line); }
.bars i { flex: 1; min-width: 2px; background: var(--ed-soft); border-radius: 3px 3px 0 0; transition: background .15s; }
.bars i.zero { background: var(--ed-line); height: 2px !important; border-radius: 0; }
.bars i:hover { background: var(--nms-amber); }
.axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--ed-faint); }
.tip { position: fixed; z-index: 160; pointer-events: none; padding: 6px 9px; background: var(--ed-text); color: var(--nms-ink); font-size: 12px; font-weight: 600; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.rank { display: grid; gap: 10px; }
.rank div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.rank span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank em { font-style: normal; color: var(--ed-soft); font-variant-numeric: tabular-nums; }
.rank i { grid-column: 1 / -1; height: 4px; background: var(--ed-soft); border-radius: 0 2px 2px 0; }

/* ——— Spazio di lavoro ——— */
.work { position: fixed; inset: 0; display: grid; grid-template: 56px minmax(0, 1fr) / 256px minmax(0, 1fr) 320px; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--ed-line); background: var(--ed-panel); }
.top .title { width: 300px; background: none; border-color: transparent; font-size: 15px; font-weight: 600; }
.top .title:hover { border-color: var(--ed-line); }
.status { display: flex; align-items: center; gap: 7px; color: var(--ed-faint); font-size: 12px; margin: 0 auto 0 8px; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.status.saving::before { background: var(--ed-soft); animation: blink 1s infinite; }
.status.error::before { background: #ef4444; }
@keyframes blink { 50% { opacity: .2 } }
.pub-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nms-amber); display: none; }
.unpublished .pub-dot { display: block; }

.scenes { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--ed-line); background: var(--ed-panel); }
.scenes-head { padding: 16px 16px 10px; }
.scenes-head .lbl { margin: 0; }
.scene-list { flex: 1; overflow-y: auto; padding: 0 10px; display: flex; flex-direction: column; gap: 4px; }
.scene { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px; border: 1px solid transparent; cursor: pointer; position: relative; }
.scene:hover { background: var(--ed-panel-2); }
.scene.on { background: var(--ed-panel-2); border-color: var(--ed-line); }
.scene.on::before { content: ''; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; background: var(--nms-amber); }
.scene img { width: 76px; height: 38px; object-fit: cover; display: block; pointer-events: none; background: var(--ed-line); }
.scene .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.scene .name small { display: block; color: var(--ed-faint); font-size: 11px; margin-top: 2px; font-weight: 400; }
.scene input { padding: 4px 6px; }
.scene .star { border: 0; background: none; color: var(--ed-faint); padding: 4px; font-size: 14px; line-height: 1; opacity: 0; }
.scene:hover .star, .scene .star.on { opacity: 1; }
.scene .star.on { color: var(--nms-amber); }
.scene.drop-before { box-shadow: 0 -2px 0 var(--nms-amber); }
.scene.uploading { cursor: default; }
.scene.uploading img { animation: blink 1.4s infinite; }
.dropzone { margin: 10px; padding: 18px 12px; border: 1px dashed var(--ed-line); text-align: center; color: var(--ed-faint); line-height: 1.5; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.dropzone b { color: var(--ed-text); }
.dropzone.over, .dropzone:hover { border-color: var(--nms-amber); color: var(--ed-soft); background: rgba(245,158,11,.05); }

.stage { position: relative; min-width: 0; background: #000; overflow: hidden; }
.stage #psv { position: absolute; inset: 0; }
.stage.drag-over::after { content: 'Rilascia per collegare la stanza in questo punto'; position: absolute; z-index: 30; inset: 12px; display: grid; place-items: center; border: 2px dashed var(--nms-amber); font-weight: 600; pointer-events: none; background: rgba(0,0,0,.3); }
.tools { position: absolute; z-index: 20; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; background: rgba(21,21,20,.85); border: 1px solid var(--ed-line); backdrop-filter: blur(12px); }
.tools .btn { border: 0; height: 38px; }
.tools i { width: 1px; background: var(--ed-line); }
.tools .btn.on { color: var(--nms-amber); }
.hint { position: absolute; z-index: 20; left: 50%; top: 14px; transform: translateX(-50%); padding: 7px 12px; font-size: 12px; color: var(--ed-soft); background: rgba(21,21,20,.75); backdrop-filter: blur(10px); white-space: nowrap; pointer-events: none; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.empty-stage { position: absolute; z-index: 100; inset: 0; display: grid; place-items: center; text-align: center; color: var(--ed-faint); line-height: 1.6; background: var(--ed-bg); }
.empty-stage > div > b { display: block; font-size: 22px; color: var(--ed-text); margin-bottom: 6px; letter-spacing: -.02em; }
.empty-stage .howto { font-size: 14px; }
.empty-stage .howto ol { gap: 14px; }
.level-grid { position: absolute; z-index: 15; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(245,158,11,.45) 1px, transparent 1px), linear-gradient(90deg, rgba(245,158,11,.45) 1px, transparent 1px); background-size: 48px 48px; background-position: center; }
.sel-ring { width: 100%; height: 100%; box-sizing: border-box; border: 2px dashed var(--nms-amber); border-radius: 50%; animation: spin 10s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg) } }
.stage.dragging, .stage.dragging * { cursor: grabbing !important; }
.stage .psv-tooltip { background: rgba(21,21,20,.9); border-radius: 0; }
.stage .psv-tooltip-content { font: 600 12px 'Plus Jakarta Sans', system-ui, sans-serif; padding: 6px 10px; }

.inspector { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--ed-line); background: var(--ed-panel); }
.tabs { display: flex; border-bottom: 1px solid var(--ed-line); }
.tabs button { flex: 1; height: 46px; border: 0; background: none; color: var(--ed-faint); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ed-text); border-bottom-color: var(--ed-text); }
.pane { flex: 1; overflow-y: auto; padding: 20px 18px 24px; display: flex; flex-direction: column; gap: 22px; }
.pane h3 { margin: 6px 0 -8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ed-soft); padding-top: 18px; border-top: 1px solid var(--ed-line); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.size-row { display: grid; grid-template-columns: 1fr 64px; gap: 10px; align-items: center; }
.target { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: center; }
.target img { width: 88px; height: 44px; object-fit: cover; background: var(--ed-panel-2); display: block; }
.copy { display: flex; }
.copy input { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--ed-soft); }
.copy .btn { height: auto; border-left: 0; }
.actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.actions .btn { flex: 1; }
.kbd { font-size: 10.5px; color: var(--ed-faint); border: 1px solid var(--ed-line); padding: 1px 5px; }
.file-pick { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; }
.file-pick img, .file-pick .ph { width: 64px; height: 64px; object-fit: contain; background: var(--ed-panel-2) repeating-conic-gradient(#222 0 25%, #1a1a18 0 50%) 0 0 / 12px 12px; display: block; }
.file-pick small { color: var(--ed-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact { display: grid; grid-template-columns: 110px 1fr 30px; gap: 6px; }
.contact select, .contact input { padding: 7px 8px; }
.contact .btn { height: auto; padding: 0; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile:nth-child(3) { border-left: 0; }
  .tile:nth-child(n+3) { border-top: 1px solid var(--ed-line); }
  .lib-top, .lib-main { padding-left: 16px; padding-right: 16px; }
  .lib-top .crumb { display: none; }
  .row-item { grid-template-columns: 72px minmax(0, 1fr) 40px; }
  .row-item > :nth-child(n+3):not(.more) { display: none; }
}
@media (max-width: 600px) {
  /* telefono: in alto solo icone, così tutto sta in una riga */
  .lib-top { gap: 8px; }
  .lib-top .btn:not(.icon-btn) { font-size: 0; gap: 0; padding: 0 11px; }
  .lib-top .search { width: auto; flex: 1; min-width: 0; }
  .card.new { display: none; } /* c'è già il pulsante + in alto */
  .filters { gap: 8px; }
  #fStatus { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filters .spacer { display: none; }
  .filters select { flex: 1 1 35%; min-width: 0; }
  .lib-head h1 { font-size: 36px; }
}

/* ——— Chiarezza: sezioni, spiegazioni, controllo del tour ——— */
.help { margin: 6px 0 0; color: var(--ed-faint); font-size: 12px; line-height: 1.5; }
.howto { color: var(--ed-soft); line-height: 1.55; }
.howto > b { display: block; color: var(--ed-text); font-size: 14px; margin-bottom: 10px; }
.howto ol { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.howto li b { color: var(--ed-text); }
.pane:has(.sec) { gap: 0; padding-top: 6px; }
.sec { border-bottom: 1px solid var(--ed-line); }
.sec > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 16px 0; cursor: pointer; user-select: none; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after { content: ''; margin-left: auto; width: 7px; height: 7px; border: solid var(--ed-faint); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-3px); transition: transform .2s; flex: none; }
.sec[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.sec > summary b { font-size: 13px; }
.sec > summary small { color: var(--ed-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec[open] { padding-bottom: 18px; }
.sec[open] > :not(summary) + :not(summary) { margin-top: 14px; }
#checkBtn.warn { color: var(--nms-amber); border-color: rgba(245,158,11,.4); }
#checkBtn.ok { color: #4ade80; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; align-items: center; }
.keys span { color: var(--ed-soft); white-space: nowrap; }
.keys b { font-weight: 500; }
kbd { display: inline-block; min-width: 22px; padding: 2px 6px; text-align: center; font: 600 11px 'Plus Jakarta Sans', system-ui, sans-serif; border: 1px solid var(--ed-line); border-bottom-width: 2px; background: var(--ed-panel); color: var(--ed-text); }


/* ——— Controlli ——— */
.health { min-height: 100vh; }
.health .lib-top .crumb { display: block; border-left: 0; padding-left: 0; color: var(--ed-text); }
.health-main { display: grid; grid-template-columns: 300px 1fr; max-width: 1320px; margin: 0 auto; min-height: calc(100vh - 64px); }
.health-tours { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 20px 12px; border-right: 1px solid var(--ed-line); }
.health-tours button { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; background: none; text-align: left; }
.health-tours button:hover, .health-tours button.on { background: var(--ed-panel-2); }
.health-tours button.on { box-shadow: inset 2px 0 var(--ed-text); }
.health-tours img, .health-tours .ph { width: 56px; height: 36px; object-fit: cover; background: var(--ed-line); }
.health-tours b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-tours small { color: var(--ed-faint); }
.health-tours i { font-style: normal; font-weight: 700; font-size: 12px; min-width: 24px; text-align: center; }
.health-tours i.warn { color: var(--nms-amber); }
.health-tours i.ok { color: #4ade80; }
.health-detail { padding: 36px 40px 80px; min-width: 0; }
.health-head { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.health-head > div { flex: 1; min-width: 260px; }
.health-head h1 { margin: 0 0 6px; font-size: 32px; letter-spacing: -.035em; }
.issue { border-top: 1px solid var(--ed-line); padding: 22px 0 8px; }
.issue h2 { display: flex; gap: 10px; margin: 0 0 4px; font-size: 16px; }
.issue h2 i { font-style: normal; color: var(--nms-amber); }
.issue > p { margin: 0 0 14px 20px; max-width: 64ch; }
.issue ul { list-style: none; margin: 0; padding: 0; }
.issue li { display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 20px; }
.issue li:hover { background: var(--ed-panel); }
.issue .pics { display: flex; align-items: center; gap: 6px; color: var(--ed-faint); flex: none; }
.issue .pics img, .issue .pics .ph { width: 64px; height: 32px; object-fit: cover; background: var(--ed-line); }
.issue .what { flex: 1; min-width: 0; }
.issue .what b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.issue .what small { color: var(--ed-faint); }
.issue .what small.auto { color: #4ade80; }
.issue .btn { flex: none; }
.all-ok { display: grid; justify-items: center; gap: 10px; padding: 80px 0; color: var(--ed-soft); }
.all-ok i { font-style: normal; font-size: 32px; color: #4ade80; }
@media (max-width: 800px) {
  .health-main { grid-template-columns: 1fr; }
  .health-tours { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--ed-line); }
  .health-tours button { width: auto; flex: none; grid-template-columns: 1fr auto; }
  .health-tours img, .health-tours .ph, .health-tours small { display: none; }
  .health-detail { padding: 24px 16px 60px; }
  /* telefono: miniature e testo su una riga, i pulsanti sotto a tutta larghezza */
  .issue li { flex-wrap: wrap; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--ed-line); }
  .issue .what { flex: 1 1 calc(100% - 150px); }
  .issue li .btn { flex: 1 1 40%; }
  .issue .pics img, .issue .pics .ph { width: 48px; height: 24px; }
  .health .lib-top #healthSum { display: none; }
}