/*
 * Viewer: tema Precision Drone (colori e font del sito istituzionale).
 * Si carica dopo potree.css, style.css e bootstrap: sovrascrive solo l'aspetto,
 * non la struttura. Variabili in /brand/brand.css.
 */

/* ------------------------------------------------------------------ base */
html, body { font-family: var(--pd-font); }
body { background: var(--pd-ink); }

:focus-visible { outline: 2px solid var(--pd-yellow) !important; outline-offset: 2px; }

.pd-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ sidebar */
#potree_sidebar_container {
  background: var(--pd-ink) !important;
  border-right: 1px solid var(--pd-line-dark) !important;
  font-size: 13px !important;
  scrollbar-width: thin;
  scrollbar-color: var(--pd-line-dark) transparent;
}
#sidebar_root {
  color: #dfe3e4;
  font-family: var(--pd-font) !important;
  font-size: 13px;
  line-height: 1.45;
}
#sidebar_root a { color: var(--pd-yellow); }
#sidebar_root input[type=checkbox], #sidebar_root input[type=radio] { accent-color: var(--pd-yellow); width: 16px; height: 16px; }
#sidebar_root input[type=range] { accent-color: var(--pd-yellow); }
#sidebar_root legend {
  font-size: 11px !important; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--pd-text-on-dark); margin: 6px 0 4px 0; border: 0; width: auto;
}
#sidebar_root label { font-weight: 400; margin-bottom: 0; }

/* intestazione: logo e progetto */
#sidebar_header {
  padding: 16px 18px 14px 18px;
  border-bottom: 1px solid var(--pd-line-dark);
  background: var(--pd-ink);
}
#sidebar_header #potree_branding, #sidebar_header #potree_languages { display: none !important; }
.pd-sb-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pd-sb-brand a { display: inline-flex; }
.pd-sb-brand img { height: 42px; width: auto; display: block; }
.pd-sb-project { margin-top: 12px; }
.pd-sb-kicker { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--pd-yellow); }
.pd-sb-title { margin: 2px 0 0 0; font-size: 18px; font-weight: 600; line-height: 1.25; color: #fff; word-break: break-word; }
.pd-sb-close {
  border: 1px solid var(--pd-line-dark); background: transparent; color: #fff; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.pd-sb-close:hover { border-color: var(--pd-yellow); color: var(--pd-yellow); }

/* pannello rapido in cima: conformità, tiled model, misure a terra */
#pd_quick { padding: 12px 18px 4px 18px; border-bottom: 1px solid var(--pd-line-dark); }
#pd_quick > * + * { margin-top: 10px; }
.pd-q-card { border: 1px solid var(--pd-line-dark); background: var(--pd-ink-2); padding: 10px 12px; }
.pd-q-title {
  margin: 0 0 8px 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--pd-text-on-dark); display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.pd-q-row { display: flex; align-items: center; gap: 8px; }
.pd-q-row + .pd-q-row { margin-top: 6px; }
.pd-q-muted { color: var(--pd-text-on-dark); font-size: 12px; }

.pd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 6px 12px; border: 1px solid var(--pd-line-dark);
  background: transparent; color: #fff; font: 500 13px/1.2 var(--pd-font); cursor: pointer; text-align: left;
  border-radius: 0;
}
.pd-btn:hover { border-color: var(--pd-yellow); }
.pd-btn--primary { background: var(--pd-yellow); border-color: var(--pd-yellow); color: var(--pd-ink); font-weight: 600; }
.pd-btn--primary:hover { background: #ffe14d; border-color: #ffe14d; }
.pd-btn--block { width: 100%; justify-content: flex-start; }
.pd-btn svg { flex: none; }

/* Conformità misure */
/* scudetto colorato secondo l'esito: verde conforme, rosso da verificare, nero incompleta */
button.pd-compliance-btn {
  width: 100% !important; margin: 0 !important; min-height: 44px; padding: 8px 12px !important;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--pd-line-dark) !important; border-left: 4px solid var(--pd-c, #dfe3e4) !important; border-radius: 0 !important;
  background: var(--pd-ink) !important; color: #fff !important;
  font: 600 13px/1.2 var(--pd-font) !important; cursor: pointer; text-align: left;
}
button.pd-compliance-btn:hover { background: var(--pd-ink-2) !important; border-color: var(--pd-c, var(--pd-yellow)) !important; }
button.pd-compliance-btn .pd-compliance-shield {
  flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--pd-c, #dfe3e4); color: #fff;
}
button.pd-compliance-btn .pd-compliance-label { flex: 1; }
button.pd-compliance-btn .pd-compliance-state {
  font: 600 11px/1 var(--pd-font); letter-spacing: .04em; text-transform: uppercase; color: var(--pd-c-text, #dfe3e4);
}
button.pd-compliance-btn.pd-compliance--ok { --pd-c: #2e9e5b; --pd-c-text: #7fd6a2; }
button.pd-compliance-btn.pd-compliance--ko { --pd-c: #d64545; --pd-c-text: #ff9b9b; }
button.pd-compliance-btn.pd-compliance--incompleto { --pd-c: #0b0d0e; --pd-c-text: #c9cfd2; }
button.pd-compliance-btn.pd-compliance--incompleto .pd-compliance-shield { box-shadow: inset 0 0 0 1.5px #c9cfd2; }

/* tiled model: pulsante mostra / nascondi */
.pd-tile-toggle { flex: 1; justify-content: space-between; }
.pd-tile-toggle[aria-pressed="true"] { border-color: var(--pd-green); }
.pd-tile-toggle .pd-tile-state { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--pd-text-on-dark); }
.pd-tile-toggle[aria-pressed="true"] .pd-tile-state { color: var(--pd-green); }
.pd-tile-toggle .pd-eye-off { display: none; }
.pd-tile-toggle[aria-pressed="false"] .pd-eye-on { display: none; }
.pd-tile-toggle[aria-pressed="false"] .pd-eye-off { display: inline; }
.pd-q-icon-btn { width: 36px; padding: 0; justify-content: center; flex: none; }

/* misure a terra */
#pd_measure_real { list-style: none; margin: 0 !important; }
#pd_measure_real label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
#pd_measure_real_info { margin: 6px 0 0 0 !important; font-size: 12px !important; opacity: 1 !important; color: var(--pd-text-on-dark); }
.pd-kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0 0 0; font-size: 12px; }
.pd-kv dt { color: var(--pd-text-on-dark); font-weight: 400; }
.pd-kv dd { margin: 0; color: #fff; font-family: var(--pd-mono); font-size: 12px; text-align: right; }

/* riga di accesso (clienti / link condivisi) e accesso clienti */
#pd_access_info { margin: 12px 18px 0 18px !important; border-radius: 0 !important; font-family: var(--pd-font) !important; background: var(--pd-ink-2) !important; border: 1px solid var(--pd-line-dark); }
#pd_access_info a { color: var(--pd-yellow) !important; }
#pd_client_access { margin: 12px 18px 0 18px !important; border-radius: 0 !important; font-family: var(--pd-font) !important; border-color: var(--pd-yellow) !important; background: rgba(250, 210, 1, .08) !important; color: #f3eccb !important; }
#pd_client_access .pd-ca-title { color: var(--pd-yellow) !important; }
#pd_client_access .pd-ca-meta a { color: var(--pd-yellow) !important; }

/* sezioni (accordion) */
#potree_menu { margin-top: 8px; }
.accordion > h3, #potree_menu > h3 {
  background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--pd-line-dark) !important;
  box-shadow: none !important; text-shadow: none !important; color: #fff !important;
  font: 500 14px/1.3 var(--pd-font) !important; margin: 0 !important; padding: 13px 18px 13px 40px !important;
  border-radius: 0 !important; position: relative;
}
#potree_menu > h3:hover { filter: none !important; background: var(--pd-ink-2) !important; }
.accordion > h3.ui-state-active, #potree_menu > h3[aria-expanded="true"] {
  color: var(--pd-yellow) !important; background: var(--pd-ink-2) !important;
  box-shadow: inset 3px 0 0 var(--pd-yellow) !important;
}
.accordion > h3 .ui-accordion-header-icon { left: 16px !important; filter: invert(1); opacity: .7; }
.accordion > h3.ui-state-active .ui-accordion-header-icon { filter: none; opacity: 1; }
.accordion > div, .accordion-content { background: var(--pd-ink) !important; color: #dfe3e4 !important; border: 0 !important; }
.ui-accordion .ui-accordion-content { padding: 6px 0 12px 0 !important; }
.pv-menu-list > * { margin: 6px 18px !important; }

/* separatori di sezione */
#sidebar_root .divider { margin: 14px 0 6px 0 !important; text-align: left !important; padding: 0 18px !important; }
#sidebar_root .divider > span {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--pd-text-on-dark);
}
#sidebar_root .divider > span:before { display: none; }
#sidebar_root .divider > span:after { background: var(--pd-line-dark) !important; left: 100%; margin-left: 10px; }

/* pulsanti a scelta (Show/Hide, Clip Task, …) */
#sidebar_root .ui-button, #sidebar_root fieldset label.ui-button {
  background: transparent !important; color: #dfe3e4 !important; border: 1px solid var(--pd-line-dark) !important;
  border-radius: 0 !important; font: 500 12px/1.2 var(--pd-font) !important; padding: 8px 4px !important;
  text-shadow: none !important; box-shadow: none !important;
}
#sidebar_root fieldset span[style*="display: flex"] > span + span label.ui-button { border-left: 0 !important; }
#sidebar_root .ui-button:hover { background: var(--pd-ink-2) !important; color: #fff !important; }
#sidebar_root .ui-button.ui-state-active, #sidebar_root .ui-state-active {
  background: var(--pd-yellow) !important; border-color: var(--pd-yellow) !important; color: var(--pd-ink) !important;
}
#sidebar_root input[type=radio]:focus-visible + label, #sidebar_root fieldset input:focus-visible ~ label { outline: 2px solid var(--pd-yellow); }

/* cursori */
#sidebar_root .ui-slider, .pv-menu-list .ui-slider {
  background: var(--pd-line-dark) !important; border: 0 !important; height: 4px !important; border-radius: 0;
}
#sidebar_root .ui-slider .ui-slider-range { background: var(--pd-yellow) !important; }
#sidebar_root .ui-slider-handle {
  background: var(--pd-yellow) !important; border: 2px solid var(--pd-ink) !important; border-radius: 0 !important;
  width: 14px !important; height: 14px !important; top: -6px !important; cursor: grab;
}

/* icone degli strumenti (misure, ritaglio, navigazione) */
#sidebar_root .button-icon { width: 30px !important; height: 30px !important; padding: 3px; margin: 2px !important; border: 1px solid transparent; }
#sidebar_root .button-icon:hover { filter: none !important; border-color: var(--pd-yellow); background: var(--pd-ink-2); }

/* campi e select */
#sidebar_root input[type=text], #sidebar_root input[type=number], #sidebar_root select, #sidebar_root textarea {
  background: var(--pd-ink-2); color: #fff; border: 1px solid var(--pd-line-dark); border-radius: 0; font-family: var(--pd-font);
}
#sidebar_root .ui-selectmenu-button { background: var(--pd-ink-2) !important; color: #fff !important; border: 1px solid var(--pd-line-dark) !important; border-radius: 0 !important; }

/* albero della scena */
#sidebar_root .jstree-default .jstree-anchor, #sidebar_root .jstree-anchor { color: #dfe3e4 !important; font-family: var(--pd-font); }
#sidebar_root .jstree-hovered { background: var(--pd-ink-2) !important; box-shadow: none !important; border-radius: 0 !important; }
#sidebar_root .jstree-clicked { background: rgba(250, 210, 1, .15) !important; box-shadow: none !important; border-radius: 0 !important; color: #fff !important; }

/* pannello proprietà / misure */
#sidebar_root .measurement-panel, #sidebar_root .propertypanel { font-family: var(--pd-font); }
#sidebar_root table { font-family: var(--pd-font); }
.measurement-detail-node-marker { font-family: var(--pd-mono); }

/* ------------------------------------------------------------------ area 3D */

/* pulsante menu di Potree */
.potree_menu_toggle {
  width: 44px !important; height: 44px !important; margin: 8px !important; padding: 9px;
  background: rgba(26, 32, 35, .9) !important; border: 1px solid var(--pd-line-dark); box-sizing: border-box;
}
.potree_menu_toggle:hover { border-color: var(--pd-yellow); }

/* marchio e nome progetto in alto a sinistra */
#pd_brandbar {
  position: absolute; top: 8px; left: 8px; z-index: 5;
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px 0 10px;
  background: rgba(26, 32, 35, .9); border: 1px solid var(--pd-line-dark); color: #fff;
  max-width: calc(100% - 80px);
}
#pd_brandbar a { display: inline-flex; flex: none; }
#pd_brandbar img { height: 32px; width: auto; display: block; }
#pd_brandbar .pd-bb-sep { width: 1px; height: 22px; background: var(--pd-line-dark); flex: none; }
#pd_brandbar .pd-bb-title { font: 500 14px/1.2 var(--pd-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* selettore 3D / Tour (ADR-005, D10), come nella pagina del tour */
#pd_brandbar .pd-bb-views { display: flex; flex: none; border: 1px solid var(--pd-line-dark); border-radius: 999px; padding: 2px; }
#pd_brandbar .pd-bb-views a, #pd_brandbar .pd-bb-views span { padding: 3px 11px; border-radius: 999px; font: 500 12.5px/1.4 var(--pd-font); color: #fff; text-decoration: none; }
#pd_brandbar .pd-bb-views span[aria-current] { background: var(--pd-yellow); color: var(--pd-ink); }
#pd_brandbar .pd-bb-views a:hover, #pd_brandbar .pd-bb-views a:focus-visible { color: var(--pd-yellow); }

/* barra degli strumenti a destra */
#pd_toolbar {
  position: fixed; top: 8px; right: 8px; z-index: 6;
  display: flex; flex-direction: column; gap: 6px;
}
.pd-tool {
  width: 44px; height: 44px; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(26, 32, 35, .9); border: 1px solid var(--pd-line-dark); cursor: pointer; position: relative;
}
.pd-tool:hover, .pd-tool[aria-expanded="true"] { border-color: var(--pd-yellow); }
.pd-tool[aria-expanded="true"] { box-shadow: inset 0 -3px 0 var(--pd-yellow); }
.pd-tool { color: #fff; }
.pd-tool svg { display: block; pointer-events: none; }
.pd-tool:hover { color: var(--pd-yellow); }
.pd-tool--primary { background: var(--pd-yellow); border-color: var(--pd-yellow); color: var(--pd-ink) !important; }
.pd-tool--primary:hover { background: #ffe14d; }
/* etichetta al passaggio del mouse o al focus */
.pd-tool::after {
  content: attr(data-label); position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--pd-ink); color: #fff; border: 1px solid var(--pd-line-dark); padding: 4px 8px;
  font: 500 12px/1.2 var(--pd-font); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s;
}
.pd-tool:hover::after, .pd-tool:focus-visible::after { opacity: 1; }

/* vecchie regole delle icone tonde: annullate */
#fullscreen_icon, #question_icon, #layers_icon, #addAnnotationBtn {
  position: static !important; width: 44px !important; height: 44px !important; max-width: none !important; max-height: none !important;
  border-radius: 0 !important; background-color: rgba(26, 32, 35, .9) !important; top: auto !important; right: auto !important; bottom: auto !important;
}
#addAnnotationBtn { position: fixed !important; right: 8px !important; bottom: 72px !important; background: var(--pd-yellow) !important; z-index: 6; display: inline-flex; }
/* con la sidebar aperta il logo è già lì: in alto a sinistra resta solo il menu */
body.pd-sidebar-open #pd_brandbar { display: none; }

/* pannello livelli (filtri annotazioni) */
#layers_panel {
  position: fixed !important; top: 8px !important; right: 60px !important; opacity: 1 !important;
  background: var(--pd-ink) !important; border: 1px solid var(--pd-line-dark) !important; border-radius: 0 !important;
  padding: 12px 14px !important; min-width: 240px; font: 13px/1.4 var(--pd-font) !important; color: #fff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
#layers_panel b { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--pd-text-on-dark); margin-bottom: 4px; }
#layers_panel .layer-row { padding: 4px 0; }
#layers_panel input { accent-color: var(--pd-yellow); width: 16px; height: 16px; }
#layers_panel .layer-dot { border-radius: 0 !important; }

/* aiuto comandi */
#question_panel img { border-radius: 0 !important; border: 1px solid var(--pd-line-dark); }

/* moduli annotazioni */
.custom-form {
  background: var(--pd-ink) !important; opacity: 1 !important; border: 1px solid var(--pd-line-dark) !important; border-radius: 0 !important;
  font: 13px/1.4 var(--pd-font) !important; padding: 16px !important; gap: 6px; right: 60px !important; bottom: 72px !important;
  height: auto !important; min-height: 0; align-items: stretch !important; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.custom-form b { font-size: 15px; font-weight: 600; margin-bottom: 6px; display: block; }
.custom-form label { font-size: 12px; color: var(--pd-text-on-dark); margin: 4px 0 0 0; }
.custom-form input, .custom-form select, .custom-form textarea {
  width: 100%; background: var(--pd-ink-2); color: #fff; border: 1px solid var(--pd-line-dark); border-radius: 0; padding: 6px 8px; font: 13px var(--pd-font);
}
.custom-form button, #submitAnnotation, #editAnnotation, #submitTypeBtn, #pickPointButton {
  background: var(--pd-yellow) !important; color: var(--pd-ink) !important; border: 1px solid var(--pd-yellow) !important;
  border-radius: 0 !important; padding: 8px 12px !important; font: 600 13px var(--pd-font) !important; margin-top: 8px;
}
#pickPointButton { background: transparent !important; color: #fff !important; border-color: var(--pd-line-dark) !important; margin-top: 0; white-space: nowrap; }
.position-input-container { display: flex; gap: 6px; }

/* pulsanti sulle annotazioni */
.annotation-edit-button, .annotation-delete-button { border-radius: 0 !important; font-family: var(--pd-font) !important; }
.annotation-edit-button { background: var(--pd-ink) !important; }
.annotation-delete-button { background: var(--pd-danger) !important; }
.annotation-edit-button:hover, .annotation-delete-button:hover { border-color: var(--pd-yellow) !important; }
.annotation .annotation-titlebar, .annotation-titlebar { font-family: var(--pd-font) !important; }

/* barra Visualizzazione / Modifica */
#pd_modebar {
  border-radius: 0 !important; background: rgba(26, 32, 35, .95) !important; border: 1px solid var(--pd-line-dark);
  font: 13px/1.3 var(--pd-font) !important; padding: 8px 12px !important; bottom: 12px !important;
}
#pd_modebar button { border-radius: 0 !important; padding: 6px 12px !important; border-color: var(--pd-line-dark) !important; font-weight: 500; }
#pd_modebar button:hover { border-color: var(--pd-yellow) !important; }
#pd_modebar button.pd-primary { background: var(--pd-yellow) !important; border-color: var(--pd-yellow) !important; color: var(--pd-ink) !important; }
#pd_modebar .pd-modebar-label.pd-edit, #pd_modebar .pd-modebar-hint.pd-dirty { color: var(--pd-yellow) !important; }
body.pd-mode-edit #pd_modebar { outline: 2px solid var(--pd-yellow) !important; }

/* scheda Conformità misure */
#pd_compliance_modal .pdc-panel { border-radius: 0 !important; font-family: var(--pd-font) !important; border-top: 4px solid var(--pd-yellow); }
#pd_compliance_modal .pdc-kicker { color: var(--pd-yellow-ink) !important; }
#pd_compliance_modal .pdc-actions button { border-radius: 0 !important; }
#pd_compliance_modal .pdc-statement { border-left-color: var(--pd-green) !important; background: var(--pd-green-light) !important; border-radius: 0 !important; }
#pd_compliance_modal .pdc-alert { border-left-color: var(--pd-yellow) !important; background: var(--pd-yellow-light) !important; border-radius: 0 !important; }
#pd_compliance_modal .pdc-dataset { border-radius: 0 !important; }
#pd_compliance_modal a { color: var(--pd-green-ink) !important; }

/* messaggi a schermo */
.pd-toast { font-family: var(--pd-font) !important; border-radius: 0 !important; border-left: 4px solid var(--pd-yellow); }

/* schermi piccoli */
@media (max-width: 720px) {
  #pd_brandbar { max-width: calc(100% - 130px); }
  #pd_brandbar .pd-bb-title, #pd_brandbar .pd-bb-sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #potree_render_area, .canvas { transition: none !important; }
}

/* accesso clienti dentro il pannello rapido */
#pd_quick #pd_client_access, #pd_quick #pd_access_info { margin: 0 !important; }

/* strumenti di modifica degli oggetti 3D (modalità Modifica) */
#editControlsBlock { font-family: var(--pd-font) !important; border-radius: 0 !important; border-color: var(--pd-line-dark) !important; background: var(--pd-ink-2) !important; }
#editControlsBlock button, #editControlsFloating button {
  border-radius: 0 !important; background: transparent !important; color: #fff !important;
  border: 1px solid var(--pd-line-dark) !important; min-width: 28px; min-height: 28px; font: 600 12px var(--pd-font) !important;
}
#editControlsBlock button:hover, #editControlsFloating button:hover { border-color: var(--pd-yellow) !important; }

/* modalità foto: pulsanti di Potree (ritorno al 3D e frecce) */
#potree_render_area input[type=button][value="Back to 3D view"] {
  background: var(--pd-yellow); color: var(--pd-ink); border: 1px solid var(--pd-yellow); border-radius: 0;
  padding: 10px 16px !important; font: 600 14px var(--pd-font); cursor: pointer; bottom: 16px !important; right: 64px !important;
}
#potree_render_area input[type=button][value="🡅"], #potree_render_area input[type=button][value="🡆"],
#potree_render_area input[type=button][value="🡇"], #potree_render_area input[type=button][value="🡄"] {
  width: 40px; height: 40px; background: rgba(26, 32, 35, .9); color: #fff; border: 1px solid var(--pd-line-dark); border-radius: 0; cursor: pointer;
}

/* segno temporaneo sul nuovo centro di rotazione (doppio clic) */
.pd-pivot-marker {
  position: fixed; z-index: 7; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none;
  border: 2px solid var(--pd-yellow); box-shadow: 0 0 0 2px rgba(26, 32, 35, .8), inset 0 0 0 2px rgba(26, 32, 35, .8);
  border-radius: 50%;
}
.pd-pivot-marker::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--pd-yellow); border-radius: 50%; }

/* albero "Oggetti in scena" */
#jstree_scene { padding: 4px 8px 8px 8px; font-size: 13px; }
#jstree_scene .jstree-anchor { height: auto; line-height: 28px; padding: 0 6px; }
#jstree_scene .jstree-node { min-height: 28px; line-height: 28px; }
#jstree_scene .jstree-anchor > b { font-weight: 600; }
#jstree_scene .jstree-anchor:focus-visible { outline: 2px solid var(--pd-yellow) !important; }
#jstree_scene .jstree-icon.jstree-ocl { filter: invert(1) brightness(1.4); opacity: .8; }
#jstree_scene .jstree-themeicon-custom { filter: none; }
#jstree_scene .jstree-wholerow-hovered, #jstree_scene .jstree-hovered { background: var(--pd-ink-2) !important; }

/* crediti e licenze */
.pd-credits { padding: 4px 18px 8px 18px; font-size: 12px; line-height: 1.5; color: #dfe3e4; }
.pd-credits p { margin: 0 0 8px 0; }
.pd-credits ul { list-style: none; margin: 0 0 8px 0; padding: 0; }
.pd-credits li { padding: 5px 0; border-bottom: 1px solid var(--pd-line-dark); display: flex; justify-content: space-between; gap: 8px; }
.pd-credits li span { color: var(--pd-text-on-dark); text-align: right; }

/* ------------------------------------------------------------------ mappe di sfondo */
/* Il riquadro resta pieno (copre la sidebar chiusa, che sta sotto il viewer); si nasconde
   solo il globo finché non si accende una mappa. */
#cesiumContainer { background: var(--pd-ink) !important; }
#cesiumContainer > .cesium-viewer { visibility: hidden; }
/* i crediti di Cesium sono sostituiti dalla riga delle fonti qui sotto (e da "Crediti e licenze") */
.cesium-widget-credits, .cesium-credit-logoContainer, .cesium-credit-expand-link { display: none !important; }

#pd_attrib {
  position: fixed; left: 0; bottom: 0; z-index: 5; display: none;
  max-width: 60vw; padding: 2px 8px; font: 10px/1.5 var(--pd-font); color: #dfe3e4;
  background: rgba(26, 32, 35, .75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.pd-sidebar-open #pd_attrib { left: 400px; }
#pd_attrib a { color: #fff; text-decoration: underline; text-decoration-color: rgba(250, 210, 1, .7); }

.pd-seg { display: flex; flex-wrap: wrap; border: 1px solid var(--pd-line-dark); }
.pd-seg-btn {
  flex: 1 1 auto; min-height: 34px; padding: 6px 10px; border: 0; border-right: 1px solid var(--pd-line-dark);
  background: transparent; color: #dfe3e4; font: 500 12px/1.2 var(--pd-font); cursor: pointer;
}
.pd-seg-btn:last-child { border-right: 0; }
.pd-seg-btn:hover { background: var(--pd-ink); color: #fff; }
.pd-seg-btn.is-active { background: var(--pd-yellow); color: var(--pd-ink); }

/* ------------------------------------------------------------------ sidebar per funzione */
/* titoli dei gruppi: Livelli, Vista, Misure, Gestione del progetto */
#pd_quick > .pd-q-group {
  margin: 18px 0 2px 0; padding: 0; font: 600 12px/1.3 var(--pd-font); letter-spacing: .1em; text-transform: uppercase;
  color: var(--pd-yellow); display: flex; align-items: center; gap: 10px;
}
#pd_quick > .pd-q-group::after { content: ""; flex: 1; height: 1px; background: var(--pd-line-dark); }
/* "Gestione del progetto" solo per il team in modalità Modifica (lì c'è Accesso clienti) */
body:not(.pd-mode-edit) #pd_quick > [data-pd-quick="grp_project"] { display: none; }

/* sezioni di Potree come riquadri apribili, allineati alle schede */
#pd_quick > .pd-acc { border: 1px solid var(--pd-line-dark); background: var(--pd-ink-2); }
#pd_quick > .pd-acc > h3 { border-bottom: 0 !important; padding: 11px 12px 11px 34px !important; font-size: 13px !important; cursor: pointer; }
#pd_quick > .pd-acc > h3:hover { background: var(--pd-ink) !important; }
#pd_quick > .pd-acc > h3[aria-expanded="true"] { color: var(--pd-yellow) !important; box-shadow: inset 3px 0 0 var(--pd-yellow) !important; border-bottom: 1px solid var(--pd-line-dark) !important; }
#pd_quick > .pd-acc > h3 .ui-accordion-header-icon { left: 10px !important; }
#pd_quick > .pd-acc > div { background: var(--pd-ink) !important; }
#pd_quick > .pd-acc .pv-menu-list > * { margin: 6px 12px !important; }
#pd_quick > .pd-acc .divider { padding: 0 12px !important; }
#pd_quick { border-bottom: 0; padding-bottom: 18px; }
/* freccia apri/chiudi */
#pd_quick > .pd-acc > h3::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
  transition: transform .15s; opacity: .8;
}
#pd_quick > .pd-acc > h3[aria-expanded="true"]::before { transform: rotate(45deg); margin-top: -6px; }
@media (prefers-reduced-motion: reduce) { #pd_quick > .pd-acc > h3::before { transition: none; } }

/* sezioni a fisarmonica (brand-ui.js): contenuto dei riquadri dentro le sezioni */
#pd_quick > .pd-acc > .pd-acc-panel { padding: 10px 12px; }
#pd_quick > .pd-acc > .pd-acc-panel > * + * { margin-top: 10px; }
#pd_quick > .pd-acc .pd-q-card { background: transparent; border-color: var(--pd-line-dark); }
#pd_quick > .pd-acc--hidden { display: none !important; }
/* Accesso clienti solo in modalità Modifica; il titolo del riquadro è già nell'intestazione */
body:not(.pd-mode-edit) #pd_quick > .pd-acc--edit-only { display: none; }
#pd_quick [data-pd-section="accesso"] .pd-ca-title { display: none; }
#pd_quick [data-pd-section="accesso"] #pd_client_access { border: 0 !important; padding: 0 !important; background: transparent !important; }
/* i titoli dei gruppi della versione precedente non si usano più */
#pd_quick > .pd-q-group { display: none; }

/* ------------------------------------------------------------------ attesa all'apertura */
#pd_loading {
  position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: var(--pd-ink); transition: opacity .4s ease;
}
#pd_loading.is-done { opacity: 0; pointer-events: none; }
.pd-loading-box { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pd-loading-mark { position: relative; width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; }
.pd-loading-mark img { width: 72px; height: 72px; animation: pd-drone-hover 1.6s ease-in-out infinite; }
.pd-loading-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(250, 210, 1, .18); border-top-color: var(--pd-yellow);
  animation: pd-spin 1s linear infinite;
}
.pd-loading-text { margin: 0; font: 500 14px/1.4 var(--pd-font); color: #dfe3e4; letter-spacing: .02em; }
@keyframes pd-spin { to { transform: rotate(360deg); } }
@keyframes pd-drone-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) {
  .pd-loading-mark img { animation: none; }
  .pd-loading-ring { animation: pd-pulse 2s ease-in-out infinite; border-top-color: rgba(250, 210, 1, .18); }
  @keyframes pd-pulse { 50% { border-color: rgba(250, 210, 1, .6); } }
  #pd_loading { transition: none; }
}

/* menu dentro la barra del logo (brand-ui.js): stesso sfondo, a destra del nome */
#pd_brandbar.pd-bb--menu { padding-right: 4px; }
#pd_brandbar .potree_menu_toggle {
  float: none; flex: none; width: 36px !important; height: 36px !important; margin: 0 !important; padding: 7px;
  background: transparent !important; border: 1px solid transparent; cursor: pointer;
}
#pd_brandbar .potree_menu_toggle:hover, #pd_brandbar .potree_menu_toggle:focus-visible { border-color: var(--pd-yellow); }
/* pulsante VR di Potree spostato nella barra (brand-ui.js): stesse misure del menu */
#pd_brandbar .pd-bb-vr {
  position: static !important; flex: none; display: flex !important; flex-direction: column; align-items: center; justify-content: center;
  width: 36px !important; height: 36px !important; margin: 0 !important; padding: 0 !important;
  background: transparent !important; border: 1px solid rgba(255, 255, 255, .35) !important; border-radius: 3px !important;
  color: #fff !important; font: 600 13px/1 var(--pd-font) !important; text-shadow: none !important; opacity: 1 !important;
  cursor: pointer; z-index: auto !important;
}
#pd_brandbar .pd-bb-vr div { line-height: 1; }
#pd_brandbar .pd-bb-vr div:first-child { font-size: 7px !important; letter-spacing: .04em; margin-bottom: 1px; }
#pd_brandbar .pd-bb-vr:hover, #pd_brandbar .pd-bb-vr:focus-visible { border-color: var(--pd-yellow) !important; }
/* telefono: con la sidebar aperta la barra degli strumenti coprirebbe il pulsante di chiusura */
@media (max-width: 720px) {
  body.pd-sidebar-open #pd_toolbar { display: none; }
}

/* pallino dell'esito sull'intestazione "Misure" */
#pd_quick .pd-acc > h3 .pd-sec-dot {
  display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 50%; vertical-align: middle;
  background: var(--pd-c, #dfe3e4);
}
#pd_quick .pd-acc > h3 .pd-sec-dot.pd-compliance--ok { --pd-c: #2e9e5b; }
#pd_quick .pd-acc > h3 .pd-sec-dot.pd-compliance--ko { --pd-c: #d64545; }
#pd_quick .pd-acc > h3 .pd-sec-dot.pd-compliance--incompleto { --pd-c: #0b0d0e; box-shadow: 0 0 0 1.5px #c9cfd2; }
/* secondo pallino: report finale (report-panel.js, ADR-008), quadrato per distinguerlo */
#pd_quick .pd-acc > h3 .pd-sec-dot--report { border-radius: 2px; margin-left: 6px; }
#pd_quick .pd-acc > h3 .pd-sec-dot.pd-report--ok { --pd-c: #2e9e5b; }
#pd_quick .pd-acc > h3 .pd-sec-dot.pd-report--pending { --pd-c: #e8892b; }
#pd_quick .pd-acc > h3 .pd-sec-dot.pd-report--missing { --pd-c: #6b7478; }

/* report finale nella sezione "Misure" */
.pd-report { display: flex; flex-direction: column; gap: 6px; }
.pd-report-type { font: 600 11px/1.2 var(--pd-font); letter-spacing: .04em; text-transform: uppercase; color: #c9cfd2; }
.pd-report-title { font: 500 13px/1.3 var(--pd-font); color: #fff; }
.pd-report-badge {
  align-self: flex-start; padding: 3px 8px; border-radius: 3px;
  font: 600 11px/1.2 var(--pd-font); color: #fff; background: var(--pd-c, #6b7478);
}
.pd-report--ok .pd-report-badge { --pd-c: #2e9e5b; }
.pd-report--pending .pd-report-badge { --pd-c: #e8892b; color: #1a1f22; }
.pd-report--missing .pd-report-badge { --pd-c: #6b7478; }
.pd-report-who { font: 400 12px/1.3 var(--pd-font); color: #c9cfd2; }
.pd-report-open { text-decoration: none; color: inherit; }

/* attesa durante i caricamenti (busy-indicator.js): piccola, non blocca la scena */
#pd_busy {
  position: fixed; top: 12px; left: 50%; z-index: 40; transform: translate(-50%, -8px);
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px;
  background: rgba(26, 32, 35, .92); border: 1px solid var(--pd-line-dark); color: #dfe3e4;
  font: 500 13px/1.2 var(--pd-font); pointer-events: none;
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
#pd_busy.is-on { opacity: 1; transform: translate(-50%, 0); }
#pd_busy .pd-busy-mark { position: relative; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
#pd_busy .pd-busy-mark img { width: 20px; height: 20px; }
#pd_busy .pd-busy-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(250, 210, 1, .18); border-top-color: var(--pd-yellow); animation: pd-spin 1s linear infinite;
}
body.pd-sidebar-open #pd_busy { left: calc(50% + 200px); }
@media (max-width: 720px) { body.pd-sidebar-open #pd_busy { display: none; } }
@media (prefers-reduced-motion: reduce) {
  #pd_busy { transition: none; }
  #pd_busy .pd-busy-ring { animation: pd-pulse 2s ease-in-out infinite; }
}

/* Mappe 2D: linea del confronto a tendina (maps2d.js) */
#pd_m2d_split {
    position: fixed; z-index: 5; width: 3px; margin-left: -1.5px;
    background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
    cursor: ew-resize; touch-action: none;
}
#pd_m2d_split::before { content: ""; position: absolute; inset: 0 -10px; }   /* più facile da prendere */
#pd_m2d_split:focus-visible { outline: 2px solid var(--pd-yellow); outline-offset: 2px; }
#pd_m2d_split .pd-m2d-split-handle {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: #fff; color: #222; font-size: 15px; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
#pd_m2d_split span {
    position: absolute; bottom: 70px; white-space: nowrap; font-size: 12px; padding: 2px 6px;
    border-radius: 4px; background: rgba(20, 22, 28, .8); color: #fff; max-width: 40vw; overflow: hidden; text-overflow: ellipsis;
}
#pd_m2d_split .pd-m2d-split-l { right: 10px; }
#pd_m2d_split .pd-m2d-split-r { left: 10px; }

/* Punti a terra (GCP e check point) sopra il 3D: maps2d.js */
.pd-gcp-layer { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.pd-gcp {
    position: fixed; transform: translate(-7px, -7px); pointer-events: auto;
    display: flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
    font: 600 11px/1 var(--pd-font); color: #fff; cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,.9);
}
.pd-gcp-dot {
    width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box;
    box-shadow: 0 0 0 1px rgba(0,0,0,.6); background: radial-gradient(circle, #fff 0 2px, transparent 2.5px), var(--pd-gcp-color, #2e7d32);
}
.pd-gcp--cp .pd-gcp-dot { border-radius: 2px; }   /* check point: quadrato, stesso colore del file */
.pd-gcp--ex .pd-gcp-dot { background: radial-gradient(circle, #fff 0 2px, transparent 2.5px), #8a8f98; border-style: dashed; }   /* escluso: grigio */
.pd-gcp--ex .pd-gcp-name { opacity: .75; text-decoration: line-through; }
.pd-tc--escluso { opacity: .8; }
.pd-gcp-info {
    display: none; position: absolute; left: 18px; top: 14px; white-space: nowrap; text-align: left;
    padding: 6px 8px; border-radius: 6px; background: rgba(20, 22, 28, .92); font-weight: 400; line-height: 1.45;
    text-shadow: none; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.pd-gcp.is-open .pd-gcp-info, .pd-gcp:focus-visible .pd-gcp-info { display: block; }
.pd-gcp:focus-visible { outline: none; }
.pd-gcp:focus-visible .pd-gcp-dot { outline: 2px solid var(--pd-yellow); outline-offset: 2px; }
.pd-gcp-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; margin-right: 2px; vertical-align: -1px; }
.pd-gcp-actions { display: block; margin-top: 5px; }
.pd-gcp-measure { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--pd-yellow); color: #111; font-weight: 600; cursor: pointer; }
.pd-gcp-line { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 4; display: none; }
.pd-gcp-line line { stroke: var(--pd-yellow); stroke-width: 2.5; stroke-dasharray: 6 4; filter: drop-shadow(0 0 1px #000); }
.pd-gcp-measure-box {
    display: none; position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 6;
    max-width: calc(100vw - 32px); padding: 8px 12px; border-radius: 8px; background: rgba(20, 22, 28, .94);
    color: #fff; font: 13px/1.5 var(--pd-font); box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.pd-gcp-measure-box button { margin-left: 8px; padding: 1px 8px; }
.pd-measure-label {
    position: fixed; z-index: 4; transform: translate(-50%, 12px); pointer-events: none;
    padding: 4px 8px; border-radius: 6px; background: rgba(20, 22, 28, .85); color: #fff;
    font: 11px/1.4 var(--pd-font); white-space: nowrap; border-left: 3px solid var(--pd-yellow);
}
/* Verifica dei punti sui target (target-check.js) */
.pd-tc { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: none; align-items: center; justify-content: center; }
.pd-tc[style*="display: block"] { display: flex !important; }
.pd-tc-box { width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; background: #1b1e24; color: #eee;
    border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.6); font: 13px/1.5 var(--pd-font); }
.pd-tc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #2d323b; position: sticky; top: 0; background: #1b1e24; }
.pd-tc-head h3 { margin: 0; font-size: 16px; }
.pd-tc-close { background: none; border: 0; color: #ccc; font-size: 18px; cursor: pointer; }
.pd-tc-body { padding: 12px 16px 16px; }
.pd-tc-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 12px; }
.pd-tc-form select, .pd-tc-form input { margin-left: 4px; }
.pd-tc-summary { padding: 8px 10px; border-radius: 6px; background: #242932; margin-bottom: 10px; }
.pd-tc-summary button { margin-left: 8px; }
.pd-tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pd-tc-card { margin: 0; padding: 8px; border-radius: 8px; background: #242932; border-top: 3px solid #666; }
.pd-tc-card canvas { width: 100%; height: auto; image-rendering: pixelated; border-radius: 4px; display: block; }
.pd-tc-card figcaption { margin-top: 6px; font-size: 12px; }
.pd-tc-card small { display: block; color: #aab; }
.pd-tc--ok { border-top-color: #2e7d32; }
.pd-tc--verificare { border-top-color: #ef6c00; }
.pd-tc--nessuno, .pd-tc--fuori { border-top-color: #555; opacity: .8; }
.pd-cmp-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.pd-cmp-table th, .pd-cmp-table td { padding: 4px 6px; border-bottom: 1px solid #2d323b; text-align: right; }
.pd-cmp-table th:nth-child(-n+3), .pd-cmp-table td:nth-child(-n+3) { text-align: left; }

/* ===== Strumenti di misura e taglio in altezza (ADR-016, strumenti-misura.js) ===== */
.pd-toolbar-sep { display: block; height: 1px; margin: 2px 6px; background: var(--pd-line-dark); }
.pd-misura-tool[aria-pressed="true"] { background: var(--pd-yellow); border-color: var(--pd-yellow); color: var(--pd-ink); }
.pd-misura-tool.pd-misura-on { box-shadow: inset 0 -3px 0 var(--pd-yellow); }
#pd_lente {
  position: fixed; left: 0; top: 0; z-index: 30; width: 220px; height: 220px; pointer-events: none;
  border-radius: 50%; overflow: hidden; border: 3px solid var(--pd-yellow); box-shadow: 0 6px 24px rgba(0, 0, 0, .55); background: var(--pd-ink);
}
#pd_lente canvas { width: 100%; height: 100%; display: block; }
#pd_lente .pd-lente-zoom {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px;
  background: rgba(26, 32, 35, .8); color: var(--pd-yellow); font: 600 11px/1.4 var(--pd-font);
}
#pd_misura_fine {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30; padding: 8px 16px; border-radius: 999px;
  background: var(--pd-ink); color: var(--pd-yellow); border: 1px solid var(--pd-yellow); font: 600 13px/1.2 var(--pd-font); cursor: pointer;
}
/* barra verticale del taglio in altezza, accanto alla barra degli strumenti */
#pd_taglio {
  position: fixed; right: 60px; top: 50%; transform: translateY(-50%); z-index: 7; width: 52px; padding: 6px 0 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(26, 32, 35, .9); border: 1px solid var(--pd-line-dark); color: #e8ecea; font: 500 11px/1.2 var(--pd-font);
}
#pd_taglio[hidden] { display: none; }
#pd_taglio .pd-taglio-x { background: none; border: 0; color: #e8ecea; font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; }
#pd_taglio .pd-taglio-x:hover { color: var(--pd-yellow); }
#pd_taglio output { color: #fff; font-weight: 600; font-size: 10.5px; white-space: nowrap; }
#pd_taglio .pd-ds { position: relative; width: 28px; height: min(320px, 46vh); touch-action: none; cursor: pointer; }
#pd_taglio .pd-ds-in { position: absolute; top: 9px; bottom: 9px; left: 0; right: 0; }
#pd_taglio .pd-ds-track, #pd_taglio .pd-ds-fill { position: absolute; left: 12px; width: 4px; border-radius: 3px; }
#pd_taglio .pd-ds-track { top: 0; bottom: 0; background: rgba(127, 127, 127, .35); }
#pd_taglio .pd-ds-fill { background: var(--pd-yellow); }
#pd_taglio .pd-ds-th {
  position: absolute; left: 5px; margin-bottom: -9px; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  background: var(--pd-yellow); border: 2px solid var(--pd-ink); cursor: grab;
}
#pd_taglio .pd-ds-th:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#pd_taglio .pd-ds-th:disabled { opacity: .4; cursor: default; }
/* piani dei modelli BIM alla loro quota, a sinistra della barra */
#pd_taglio .pd-ds-piani { position: absolute; top: 0; bottom: 0; right: calc(100% + 18px); width: 0; }
#pd_taglio .pd-ds-piano {
  position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; padding: 2px 8px; border-radius: 999px;
  background: rgba(26, 32, 35, .9); border: 1px solid var(--pd-line-dark); color: #e8ecea; font: 500 11px/1.4 var(--pd-font); cursor: pointer;
}
#pd_taglio .pd-ds-piano::after { content: ""; position: absolute; left: 100%; top: 50%; width: 10px; border-top: 1px dashed var(--pd-line-dark); }
#pd_taglio .pd-ds-piano:hover, #pd_taglio .pd-ds-piano[aria-pressed="true"] { border-color: var(--pd-yellow); color: var(--pd-yellow); }
#pd_taglio .pd-taglio-tutto { background: none; border: 1px solid var(--pd-line-dark); color: #e8ecea; font: 500 10.5px/1.4 var(--pd-font); padding: 1px 6px; cursor: pointer; }
#pd_taglio .pd-taglio-tutto:disabled { opacity: .4; cursor: default; }
#pd_taglio .pd-taglio-msg { position: absolute; right: calc(100% + 8px); bottom: 0; width: 220px; margin: 0; padding: 6px 8px; background: rgba(26, 32, 35, .92); border: 1px solid var(--pd-line-dark); color: #e8892b; font: 400 11.5px/1.35 var(--pd-font); }
#pd_taglio .pd-taglio-msg:empty { display: none; }
@media (max-width: 640px) {
  #pd_lente { width: 150px; height: 150px; }
  #pd_taglio .pd-ds { height: min(240px, 40vh); }
}

/* ===== Misure di precisione (ADR-016, misure-precisione.js) ===== */
#pd_misura_badge {
  position: fixed; left: 0; top: 0; z-index: 31; pointer-events: none; padding: 3px 8px 3px 10px; white-space: nowrap;
  background: rgba(26, 32, 35, .92); color: #fff; border-left: 3px solid var(--ax, #ff6a3d); font: 500 12px/1.4 var(--pd-mono, ui-monospace, monospace);
}
#pd_misure_panel {
  position: fixed; top: 8px; right: 60px; z-index: 7; width: 300px; max-height: calc(100vh - 16px); overflow: auto; padding: 10px 12px 12px;
  background: rgba(26, 32, 35, .95); border: 1px solid var(--pd-line-dark); color: #e8ecea; font: 400 12.5px/1.45 var(--pd-font);
}
#pd_misure_panel[hidden] { display: none; }
#pd_misure_panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#pd_misure_panel header b { font: 600 11px/1 var(--pd-font); letter-spacing: .08em; text-transform: uppercase; color: var(--pd-text-on-dark, #a5abad); }
#pd_misure_panel .pd-mp-x { background: none; border: 0; color: #e8ecea; font-size: 17px; line-height: 1; cursor: pointer; }
#pd_misure_panel .pd-mp-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#pd_misure_panel .pd-mp-tools button, #pd_misure_panel .pd-mp-sidebar {
  padding: 7px 6px; background: none; border: 1px solid var(--pd-line-dark); color: #fff; font: 600 12px/1.2 var(--pd-font); cursor: pointer;
}
#pd_misure_panel .pd-mp-tools button:hover, #pd_misure_panel .pd-mp-sidebar:hover { border-color: var(--pd-yellow); }
#pd_misure_panel .pd-mp-lock[aria-pressed="true"] { background: var(--pd-yellow); border-color: var(--pd-yellow); color: var(--pd-ink); }
#pd_misure_panel .pd-mp-legend { display: flex; gap: 12px; margin: 8px 0 2px; font: 500 11.5px/1.4 var(--pd-mono, ui-monospace, monospace); }
#pd_misure_panel .pd-mp-legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; background: var(--c); }
#pd_misure_panel .pd-mp-ax { margin: 2px 0 6px; font: 500 11.5px/1.4 var(--pd-mono, ui-monospace, monospace); color: var(--pd-text-on-dark, #a5abad); }
#pd_misure_panel .pd-mp-hint { margin: 0 0 6px; color: var(--pd-text-on-dark, #a5abad); font-size: 11.5px; }
#pd_misure_panel .pd-mp-msg { margin: 0 0 6px; color: var(--pd-yellow); font-size: 11.5px; }
#pd_misure_panel .pd-mp-msg:empty { display: none; }
#pd_misure_panel .pd-mp-m { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px; margin-bottom: 6px; border: 1px solid var(--pd-line-dark); }
#pd_misure_panel .pd-mp-m.sel { border-color: var(--pd-yellow); }
#pd_misure_panel .pd-mp-d { font: 600 14px/1.3 var(--pd-mono, ui-monospace, monospace); color: #fff; }
#pd_misure_panel .pd-mp-acts { display: flex; gap: 4px; }
#pd_misure_panel .pd-mp-acts button { padding: 2px 8px; background: none; border: 1px solid var(--pd-line-dark); color: #fff; font: 600 11.5px/1.4 var(--pd-font); cursor: pointer; }
#pd_misure_panel .pd-mp-acts button:hover { border-color: var(--pd-yellow); }
#pd_misure_panel .pd-mp-n { grid-column: 1 / -1; color: var(--pd-text-on-dark, #a5abad); font-size: 11px; }
#pd_misure_panel .pd-mp-det { grid-column: 1 / -1; font: 400 11.5px/1.5 var(--pd-mono, ui-monospace, monospace); color: #cfd4d2; }
#pd_misure_panel .pd-mp-empty { color: var(--pd-text-on-dark, #a5abad); font-size: 12px; }
#pd_misure_panel .pd-mp-sidebar { width: 100%; margin-top: 4px; font-weight: 500; }
@media (max-width: 640px) { #pd_misure_panel { width: calc(100vw - 76px); } }

/* ===== Riquadro «Dal rilievo» (rilievo-panel.js) ===== */
.pd-ril dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 10px; font-size: 12.5px; }
.pd-ril dt { color: var(--pd-text-on-dark, #a5abad); }
.pd-ril dd { margin: 0; font: 500 12px/1.45 var(--pd-mono, ui-monospace, monospace); color: #e8ecea; word-break: break-word; }
.pd-ril dd a { color: var(--pd-yellow); }
.pd-ril-map { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border: 1px solid var(--pd-line-dark); background: #2f3638; cursor: pointer; }
.pd-ril-maprow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; }
.pd-ril-maprow label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.pd-ril-maprow a { color: var(--pd-yellow); text-decoration: none; margin-left: auto; }
.pd-ril-maprow a:hover { text-decoration: underline; }
.pd-ril-attr { font-size: 11px; color: var(--pd-text-on-dark, #a5abad); margin: 4px 0 0; }
.pd-ril-attr a { color: inherit; }
.pd-ril-empty { color: var(--pd-text-on-dark, #a5abad); font-size: 12px; }
.pd-ril-src { color: var(--pd-text-on-dark, #a5abad); font-family: var(--pd-font); }
/* ===== Sidebar compatta (brand-ui.js, 25/10/2026) ===== */
#menu_tools_panel .pd-hidden-tool { display: none !important; }
.pd-edit .pd-q-title { font: 600 11px/1 var(--pd-font); letter-spacing: .08em; text-transform: uppercase; color: var(--pd-text-on-dark, #a5abad); margin-bottom: 8px; }
.pd-edit .pd-edit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-edit .pd-edit-on { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin: 0; }
.pd-edit .pd-edit-row > div { display: flex; gap: 4px; }
.pd-edit .pd-btn { padding: 4px 8px; font-size: 12px; }
.pd-edit kbd { font: 500 10px/1 var(--pd-mono, ui-monospace, monospace); padding: 1px 4px; border: 1px solid var(--pd-line-dark); border-radius: 3px; opacity: .8; }
.pd-edit .pd-edit-hint { margin-top: 6px; font-size: 11.5px; color: var(--pd-text-on-dark, #a5abad); }
.pd-nav-potree { margin-top: 8px; }

/* ===== Bussola (bussola.js) ===== */
#pd_bussola {
  position: absolute; left: 12px; bottom: 34px; z-index: 5; width: 76px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
#pd_bussola svg { width: 72px; height: 72px; display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }
#pd_bussola .pd-bs-bg { fill: rgba(26, 32, 35, .85); stroke: var(--pd-line-dark, #3a4245); stroke-width: 1.5; }
#pd_bussola .pd-bs-tick { stroke: #a5abad; stroke-width: 1.2; }
#pd_bussola text { fill: #e8ecea; font: 700 15px var(--pd-font); text-anchor: middle; }
#pd_bussola .pd-bs-n { fill: #ff5a4f; font-size: 18px; }
#pd_bussola .pd-bs-ago { fill: var(--pd-yellow); }
#pd_bussola .pd-bs-gradi { padding: 1px 7px; background: rgba(26, 32, 35, .85); color: #fff; font: 600 11px/1.4 var(--pd-mono, ui-monospace, monospace); white-space: nowrap; }
#pd_bussola:hover .pd-bs-bg, #pd_bussola:focus-visible .pd-bs-bg { stroke: var(--pd-yellow); }
@media (max-width: 640px) { #pd_bussola svg { width: 52px; height: 52px; } }

/* riquadri nascosti per progetto (livelli.js, ADR-018 D15): via per chi guarda, sbiaditi in Modifica */
body:not(.pd-mode-edit) #pd_quick .pd-q-nascosto { display: none !important; }
body.pd-mode-edit #pd_quick .pd-q-nascosto { opacity: .45; outline: 1px dashed var(--pd-line-dark); }
body:not(.pd-mode-edit) #pd_quick > .pd-acc--vuota { display: none !important; }
