/* ============================================
   RESET E STILI BASE
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   SFONDO DESKTOP
   ============================================ */

.sfondo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('img/sfondo_desktop_montagna.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* ============================================
   BARRA SUPERIORE (TOP BAR)
   ============================================ */

.barra-superiore {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 9999;
}

.barra-sinistra {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.logo-apple {
  font-size: 10px;
  width: 15px;
  height: 15px;
}

.icona-barra {
  height: 14px;
  width: auto;
  object-fit: contain;
}

.icona-wifi {
  width: 18px;
  height: 18px;
}

.icona-batteria {
  width: 20px;
  height: 15px;
}

.barra-destra {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 12px;
}

.ora {
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================
   AREA PRINCIPALE
   ============================================ */

.area-principale {
  position: fixed;
  top: 40px;
  left: 0;
  right: 0;
  bottom: 100px;
  overflow-y: auto;
  padding: 40px;
  z-index: 1;
}

.area-principale::-webkit-scrollbar {
  width: 8px;
}

.area-principale::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* ============================================
   GRIGLIA ICONE DESKTOP
   ============================================ */

.griglia-icone {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ============================================
   TITOLO CENTRALE DESKTOP
   ============================================ */

.titolo-desktop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.titolo-desktop-sopra {
  margin: 0 0 4px;
  font-size: clamp(1.1rem, 3vw, 2rem);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4);
}

.titolo-desktop-testo {
  margin: 0;
  line-height: 0.95;
  font-size: clamp(3.5rem, 13vw, 9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
  cursor: default;
}

/* ogni lettera generata da JS — tutte stessa dimensione */
.titolo-desktop-testo .lettera {
  display: inline-block;
  white-space: pre;
  cursor: default;
  will-change: transform, opacity;
  pointer-events: auto;
}

.titolo-desktop-hint {
  margin: 18px 0 0;
  font-size: clamp(0.8rem, 2vw, 1rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
  opacity: 1;
}

.icona {
  position: absolute;
  width: 100px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 12px;
  border-radius: 12px;
  transition: background 0.2s, transform 0.2s;
  user-select: none;
  pointer-events: auto;
}

/* Colonna sinistra */
.icona[data-cartella="branding"]  { top:  60px;  left: 50px; }
.icona[data-cartella="uiux"]      { top: 260px;  left: 120px; }
.icona[data-cartella="rebranding"]{ top: 460px;  left: 40px; }

/* Colonna centro-destra */
.icona[data-cartella="chi-sono"]  { top:  50px;  right: 320px; }

/* Colonna destra */
.icona[data-cartella="progetti"]  { top:  50px;  right: 60px; }
.icona[data-cartella="contatti"]  { top: 250px;  right: 60px; }

/* Siti web tra chi_sono.txt e Altri progetti, leggermente più in alto */
.icona[data-cartella="sitiweb"]   { top:  20px;  right: 190px; }
.icona-foto { top: 470px; right: 250px; }
.icona-logo { top: 460px; right: 70px; }

/* il logo non deve avere angoli arrotondati */
.icona-logo .immagine-icona {
  border-radius: 0;
}

.icona:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.icona[draggable="true"] {
  cursor: grab;
}

.icona[draggable="true"]:active {
  cursor: grabbing;
}

.icona.dragging {
  opacity: 0.6;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.immagine-icona {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  border-radius: 16px;
  box-shadow: none;
  transition: all 0.2s;
  object-fit: contain;
  object-position: center;
}

.etichetta-icona {
  font-size: 12px;
  text-align: center;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.7);
  font-weight: 600;
}

/* ============================================
   CONTENITORE FINESTRE
   ============================================ */

.contenitore-finestre {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
}

/* ============================================
   FINESTRE
   ============================================ */

.finestra {
  position: absolute;
  width: 700px;
  height: 550px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  visibility: hidden;
  transition: all 0.3s ease;
}

.finestra.aperta {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  visibility: visible;
}

/* Posizionamenti predefiniti */
#fin-progetti   { top: 80px;  left: 200px; }
#fin-info       { top: 80px;  left: 450px; }
#fin-chi-sono   { top: 80px;  left: 300px; }
#fin-contatti   { top: 100px; left: 150px; }
#fin-admin      { top: 100px; left: 500px; }
#fin-branding   { top: 80px;  left: 250px; }
#fin-uiux       { top: 80px;  left: 280px; }
#fin-rebranding { top: 80px;  left: 260px; }
#fin-sitiweb    { top: 80px;  left: 270px; }

#fin-note {
  top: calc(50% - 275px);
  left: calc(50% - 350px);
}


/* ============================================
   BARRA TITOLO FINESTRA
   ============================================ */

.barra-finestra {
  background: linear-gradient(to bottom, #f5f5f7, #e5e5e7);
  border-bottom: 1px solid #d5d5d7;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  border-radius: 12px 12px 0 0;
  cursor: grab;
  user-select: none;
}

.barra-finestra:active {
  cursor: grabbing;
}

.pulsanti-finestra {
  display: flex;
  gap: 8px;
}

.pulsante {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  /* per centrare il simbolo */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
}

/* simbolo dentro ogni pulsante */
.pulsante::before {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: rgba(0, 0, 0, 0.55);
  opacity: 1;
}

.pulsante.chiudi {
  background: #ed6158;
}
.pulsante.chiudi::before {
  content: "\00D7"; /* × */
  font-size: 11px;
}
.pulsante.chiudi:hover {
  background: #f25056;
}

.pulsante.minimizza {
  background: #fcc02e;
}
.pulsante.minimizza::before {
  content: "\2212"; /* − */
}
.pulsante.minimizza:hover {
  background: #ffce3b;
}

.pulsante.ingrandisci {
  background: #5fc038;
}
.pulsante.ingrandisci::before {
  content: "\002B"; /* + */
}
.pulsante.ingrandisci:hover {
  background: #67c946;
}

.titolo-finestra {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  flex: 1;
  text-align: center;
  margin: 0;
}

/* ============================================
   CONTENUTO FINESTRA
   ============================================ */

.contenuto-finestra {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.contenuto-finestra.con-sidebar {
  flex-direction: row;
  padding: 0;
}

/* --- Foglio di testo stile Word/TextEdit --- */
.finestra-testo .contenuto-finestra {
  background: #d9d9dc;
  padding: 24px;
  overflow-y: auto;
  align-items: flex-start;
}

.foglio-testo {
  background: #ffffff;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 56px 64px;
  border-radius: 2px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  font-family: Georgia, "Times New Roman", serif;
  color: #1d1d1f;
  line-height: 1.7;
  font-size: 16px;
}

.foglio-testo p {
  margin: 0 0 18px;
  text-align: justify;
}

.foglio-testo p:last-child {
  margin-bottom: 0;
}

/* --- Finder: griglia cartelle --- */
.griglia-cartelle-finder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 24px 12px;
  padding: 28px;
  overflow-y: auto;
  align-content: start;
}

.cartella-finder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 6px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.cartella-finder:hover {
  background: rgba(0, 0, 0, 0.05);
}

.cartella-finder:active {
  background: rgba(0, 0, 0, 0.1);
}

.cartella-finder img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.cartella-finder span {
  font-size: 13px;
  color: #1d1d1f;
  text-align: center;
  font-weight: 500;
}

.barra-laterale {
  width: 200px;
  background: #f5f5f7;
  border-right: 1px solid #d5d5d7;
  overflow-y: auto;
  padding: 16px 0;
}

.barra-laterale::-webkit-scrollbar {
  width: 8px;
}

.barra-laterale::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sezione-menu {
  padding: 12px 0;
}

.sezione-menu h4 {
  font-size: 11px;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 14px 4px;
  margin: 0;
}

.lista-menu {
  list-style: none;
  margin: 0;
  padding: 2px 6px;
}

.lista-menu li {
  padding: 5px 8px;
  color: #1c1c1e;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
  border-left: none;
  border-radius: 6px;
  margin: 1px 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.lista-menu li:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1c1c1e;
}

.lista-menu li.attivo {
  background: #0071e3;
  color: white;
  font-weight: 500;
  border-left-color: transparent;
}

.lista-menu li.attivo:hover {
  background: #0077ed;
}

.sidebar-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.75;
}

.lista-menu li.attivo .sidebar-icon {
  opacity: 1;
}

.corpo-principale {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.corpo-principale::-webkit-scrollbar {
  width: 8px;
}

.corpo-principale::-webkit-scrollbar-thumb {
  background: #d5d5d7;
  border-radius: 4px;
}

/* ============================================
   TESTO NELLA FINESTRA
   ============================================ */

.corpo-principale h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #333;
}

.corpo-principale h4 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-top: 20px;
  margin-bottom: 10px;
}

.corpo-principale p {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
}

.lista-competenze {
  margin-left: 18px;
  font-size: 13px;
  color: #666;
  line-height: 1.8;
}

/* ============================================
   GRIGLIA PROGETTI
   ============================================ */

.griglia-progetti {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.carta-progetto-immagine {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.carta-progetto-immagine:hover {
  transform: scale(1.02);
}

.carta-progetto-immagine .immagine-progetto {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid #d5d5d7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.carta-progetto-immagine .immagine-progetto:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carta-progetto-immagine .nome-progetto {
  font-size: 9px;
  font-weight: 500;
  color: #666;
  text-align: center;
  word-break: break-word;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ============================================
   PULSANTE AZIONE
   ============================================ */

.pulsante-accedi {
  background: #0071e3;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
  margin-top: 20px;
}

.pulsante-accedi:hover {
  background: #0a66d2;
}

/* ============================================
   DOCK INFERIORE
   ============================================ */

.dock {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 8px 16px;
  display: flex;
  gap: 12px;
  z-index: 9998;
  filter: drop-shadow(none);
}

.icona-dock {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  border-radius: 10px;
  object-fit: contain;
  object-position: center;
  transition: transform 0.35s cubic-bezier(.34, 1.56, .64, 1),
              background 0.2s ease;
  transform-origin: bottom center;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(none);
}

.icona-dock:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-16px) scale(1.45);
}

/* ============================================
   EDITOR NOTE
   ============================================ */

.lista-note {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.elemento-nota {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e7;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.elemento-nota:hover {
  background: #f5f5f7;
}

.elemento-nota.attivo {
  background: #e74c3c;
  color: white;
}

.elemento-nota.attivo .titolo-elemento-nota,
.elemento-nota.attivo .data-nota,
.elemento-nota.attivo .anteprima-nota {
  color: white;
}

.titolo-elemento-nota {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin: 0 0 4px 0;
}

.data-nota {
  font-size: 11px;
  color: #999;
  margin: 0 0 4px 0;
}

.elemento-nota.attivo .data-nota {
  color: rgba(255, 255, 255, 0.7);
}

.anteprima-nota {
  font-size: 12px;
  color: #666;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elemento-nota.attivo .anteprima-nota {
  color: rgba(255, 255, 255, 0.8);
}

.contenitore-nota {
  padding: 24px;
  overflow-y: auto;
  height: 100%;
}

.contenitore-nota h2 {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin: 0 0 16px 0;
}

.contenitore-nota h4 {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin: 16px 0 8px 0;
}

.contenitore-nota p {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.contenitore-nota ul {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  margin-left: 20px;
  margin-bottom: 15px;
}

.contenitore-nota ul:last-child { margin-bottom: 0; }

.contenitore-nota ul li {
  margin-bottom: 6px;
}

/* Blocco progetto nelle note */
.progetto-nota { margin-bottom: 20px; }

.link-progetto-nota {
  display: inline-block;
  margin-top: 4px;
  color: #d6006e;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
}

.link-progetto-nota:hover {
  text-decoration: underline;
}

/* ============================================
   BOOTSTRAP MODAL — override stile macOS
   Tutte e tre le modal (immagini, PDF, video)
   usano bootstrap.Modal JS + queste classi CSS.
   ============================================ */

/* Animazione di entrata quicklook */
@keyframes quicklook-in {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

/* Override animazione Bootstrap per le modal macOS */
.modal-mac.fade .modal-dialog {
  transform: scale(0.88);
  transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
              opacity  0.22s ease;
  opacity: 0;
}
.modal-mac.show .modal-dialog {
  transform: scale(1);
  opacity: 1;
}

/* Dimensioni dialog */
.modal-mac-lg { max-width: 800px; }
.modal-mac-xl { max-width: 820px; }

/* Stile macOS: nessun bordo Bootstrap, bordo-raggio custom */
.modal-mac-content {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f7;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

/* Altezza fissa per PDF e Video (88% viewport) */
.modal-mac-tall { height: 88vh; }

/* Header macOS — sovrascrive padding/bordo e layout Bootstrap */
.modal-mac-header.modal-header {
  background: linear-gradient(to bottom, #f5f5f7, #e5e5e7);
  border-bottom: 1px solid #d5d5d7;
  border-radius: 0;
  padding: 0 16px;
  height: 44px;
  min-height: 44px;
  gap: 12px;
  flex-shrink: 0;
  justify-content: flex-start;
}

/* Pulsanti semaforo */
.modal-preview-buttons {
  display: flex;
  gap: 8px;
}

.modal-preview-btn {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-preview-btn.close    { background: #ed6158; }
.modal-preview-btn.close:hover { background: #f25056; }
.modal-preview-btn.minimize    { background: #fcc02e; }
.modal-preview-btn.minimize:hover { background: #ffce3b; }
.modal-preview-btn.fullscreen  { background: #5fc038; }
.modal-preview-btn.fullscreen:hover { background: #67c946; }

/* Titolo centrato — margin-left: -40px compensa l'offset dei pulsanti semaforo */
.modal-mac-header .modal-title.modal-preview-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  flex: 1;
  text-align: center;
  margin-left: -40px;
}

/* Body immagini: sfondo chiaro, immagine centrata */
.modal-preview-body.modal-body {
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 1;
  height: 540px;
}

#modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 20px;
}

/* Body PDF/Video: padding zero e sfondo scuro */
.modal-mac-body.modal-body {
  padding: 0;
  flex: 1;
  overflow: hidden;
  background: #404040;
}

/* ============================================
   RESPONSIVE — ADATTAMENTO MOBILE
   ============================================ */

@media (max-width: 900px) {
  .finestra {
    width: 90vw;
    height: auto;
    max-height: 80vh;
  }

  .griglia-icone {
    grid-template-columns: repeat(auto-fill, 90px);
    gap: 30px;
  }

  .griglia-progetti {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .area-principale {
    padding: 20px;
  }

  .titolo-desktop {
    top: 38%;
  }

  .titolo-desktop-testo {
    font-size: clamp(2.8rem, 18vw, 4.5rem);
  }

  .griglia-icone {
    grid-template-columns: repeat(auto-fill, 70px);
    gap: 20px;
  }

  .finestra {
    width: 95vw;
    max-height: 85vh;
  }

  .immagine-icona {
    width: 70px;
    height: 70px;
    font-size: 50px;
  }

  .etichetta-icona {
    font-size: 10px;
  }
}

/* ============================================
   CONTROL CENTER — macOS style
   ============================================ */

/* --- trigger nella menubar --- */
.cc-trigger {
  cursor: default;
  padding: 0 6px;
  border-radius: 4px;
  transition: background .1s;
  display: flex; align-items: center; gap: 4px;
  font-size: 12px;
  color: white;
  white-space: nowrap;
}
.cc-trigger:hover { background: rgba(255,255,255,0.15); }

/* --- overlay per chiudere cliccando fuori --- */
#cc-overlay {
  position: fixed; inset: 0;
  z-index: 8998;
  display: none;
}

/* --- pannello principale --- */
#cc-panel {
  position: fixed;
  top: 30px; right: 8px;
  width: 320px;
  background: rgba(235,233,228,0.94);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 16px;
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow:
    0 8px 40px rgba(0,0,0,0.22),
    0 0 0 0.5px rgba(0,0,0,0.1);
  z-index: 8999;
  transform-origin: top right;
}

/* --- griglia righe --- */
.cc-row   { display: grid; gap: 8px; }
.cc-row-2 { grid-template-columns: 1fr 1fr; }
.cc-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* --- tile base --- */
.cc-tile {
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
  padding: 11px 13px;
  cursor: default;
  transition: filter .12s;
}
.cc-tile:hover  { filter: brightness(0.96); }
.cc-tile:active { filter: brightness(0.90); }

/* --- tile connettività (Wi-Fi / BT / AirDrop) --- */
.cc-tile-conn { padding: 0; overflow: hidden; }
.cc-conn-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px;
  border-bottom: 0.5px solid rgba(0,0,0,0.07);
}
.cc-conn-row:last-child { border-bottom: none; }
.cc-conn-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: #0a84ff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cc-conn-dot svg,
.cc-conn-dot-icon { width: 15px; height: 15px; object-fit: contain; }
.cc-conn-info { flex: 1; }
.cc-conn-info b   { display: block; font-size: 13px; font-weight: 600; color: #1c1c1e; }
.cc-conn-info span{ display: block; font-size: 11px; color: #6e6e73; }
.cc-conn-chevron  { font-size: 11px; color: #aeaeb2; }

/* --- tile toggle (Light/Dark Mode) --- */
.cc-tile-toggle {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px;
}
.cc-toggle-icon  { font-size: 16px; flex-shrink: 0; }
.cc-toggle-label { font-size: 13px; font-weight: 500; color: #1c1c1e; flex: 1; }

/* --- tile icona piccola --- */
.cc-tile-sm {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; min-height: 64px;
  text-align: center;
}
.cc-tile-sm .cc-sm-icon  { font-size: 20px; }
.cc-tile-sm .cc-sm-label { font-size: 11px; font-weight: 500; color: #3c3c43; line-height: 1.3; }

/* --- tile slider (Display / Sound) --- */
.cc-tile-slider { display: flex; flex-direction: column; gap: 8px; }
.cc-slider-title { font-size: 12px; font-weight: 500; color: #6e6e73; }
.cc-slider-row   { display: flex; align-items: center; gap: 8px; }
.cc-slider-icon  { font-size: 13px; color: #6e6e73; width: 16px; text-align: center; flex-shrink: 0; }

/* pill track */
.cc-slider-track {
  flex: 1;
  height: 28px;
  background: #d1d1d6;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  cursor: default;
}
/* fill che scorre dentro */
.cc-slider-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: #888888;
  border-radius: 14px;
  pointer-events: none;
  transition: width .04s linear;
}
/* cerchio bianco */
.cc-slider-thumb {
  position: absolute;
  top: 50%;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.30);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left .04s linear;
}
/* input range trasparente sopra, cattura interazione */
input[type="range"].cc-hidden-range {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: default;
  margin: 0; padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* --- tile musica --- */
.cc-tile-music { display: flex; align-items: center; gap: 10px; }
.cc-music-art {
  width: 40px; height: 40px; border-radius: 8px;
  background: #1c1c1e;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cc-music-disc {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #e8304a, #8e1c2a);
  display: flex; align-items: center; justify-content: center;
}
.cc-music-disc::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #1c1c1e;
}
.cc-music-info { flex: 1; }
.cc-music-info b    { display: block; font-size: 13px; font-weight: 600; color: #1c1c1e; }
.cc-music-info span { display: block; font-size: 11px; color: #6e6e73; }
.cc-play-btn {
  width: 28px; height: 28px;
  border-radius: 50%; border: none;
  background: transparent; cursor: default;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s;
}
.cc-play-btn:hover { background: rgba(0,0,0,0.06); }
.cc-play-btn svg { width: 14px; height: 14px; fill: #1c1c1e; }

/* --- animazione apertura --- */
@keyframes cc-in {
  from { opacity: 0; transform: scale(0.92) translateY(-6px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
@keyframes cc-out {
  from { opacity: 1; transform: scale(1)    translateY(0); }
  to   { opacity: 0; transform: scale(0.92) translateY(-6px); }
}
#cc-panel.cc-opening { animation: cc-in  .2s cubic-bezier(0.34,1.2,0.64,1) forwards; }
#cc-panel.cc-closing { animation: cc-out .15s ease-in forwards; }

/* ============================================
   PHOTOSHOP & ILLUSTRATOR — FINESTRE APP
   ============================================ */

#fin-photoshop,
#fin-illustrator {
  top: 60px;
  left: 160px;
  width: 880px;
  height: 580px;
}

#brightness-overlay {
  position: fixed;
  inset: 0;
  background: black;
  opacity: 0;
  pointer-events: none;
  z-index: 1500;
  transition: opacity 0.05s linear;
}

#ps-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#ps-loading-overlay.aperto {
  display: flex;
}

#ps-loading-img {
  max-width: 580px;
  max-height: 75vh;
  object-fit: contain;
  transition: opacity 0.4s ease;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ps-contenuto {
  padding: 0;
  overflow: hidden;
  border-radius: 0 0 12px 12px;
}

.ps-schermata.ps-app {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0 0 12px 12px;
}

#fin-cestino { top: 110px; left: 250px; }

.cestino-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 16px;
  background: #f5f5f7;
  border-bottom: 1px solid #d5d5d7;
  flex-shrink: 0;
}

.cestino-conteggio {
  font-size: 12px;
  color: #888;
}

.cestino-svuota-btn {
  background: none;
  border: none;
  color: #0071e3;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.cestino-svuota-btn:hover { text-decoration: underline; }

.griglia-cestino {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  padding: 20px;
}

.file-cestino {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
  cursor: default;
  transition: background 0.15s;
}

.file-cestino:hover { background: rgba(0,113,227,0.08); }

.icona-file {
  width: 54px;
  height: 62px;
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  position: relative;
}

.icona-file::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  background: inherit;
  filter: brightness(0.85);
  clip-path: polygon(0 0, 100% 100%, 100% 0);
  border-radius: 0 6px 0 0;
}

.ext-file {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 1;
}

.nome-file {
  font-size: 11px;
  color: #333;
  text-align: center;
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
  max-width: 96px;
}

.data-elim {
  font-size: 10px;
  color: #aaa;
  margin: 0;
  text-align: center;
}

.icona-file-img {
  width: 54px;
  height: 62px;
  object-fit: contain;
}

body.dark-mode .cestino-toolbar  { background: #2c2c2e; border-bottom-color: #3a3a3c; }
body.dark-mode .cestino-conteggio { color: #636366; }
body.dark-mode .nome-file         { color: #e5e5e7; }
body.dark-mode .file-cestino:hover { background: rgba(255,255,255,0.07); }

/* ============================================
   LAUNCHPAD
   ============================================ */

#launchpad {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 38, 0.86);
  backdrop-filter: blur(60px) saturate(1.8);
  -webkit-backdrop-filter: blur(60px) saturate(1.8);
  z-index: 9997;
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 64px;
  gap: 36px;
}

#launchpad.aperto {
  display: flex;
  animation: animazione-launchpad 0.28s cubic-bezier(0.34, 1.1, 0.64, 1) forwards;
}

@keyframes animazione-launchpad {
  from { opacity: 0; transform: scale(1.07); }
  to   { opacity: 1; transform: scale(1); }
}

.area-ricerca-launchpad { display: flex; justify-content: center; }

.box-ricerca-launchpad {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  padding: 6px 14px;
  width: 240px;
}

.box-ricerca-launchpad svg {
  width: 13px;
  height: 13px;
  color: rgba(255,255,255,0.55);
  flex-shrink: 0;
}

#ricerca-launchpad {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: white;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: text;
  -webkit-user-select: text;
}

#ricerca-launchpad::placeholder { color: rgba(255,255,255,0.45); }

.griglia-launchpad {
  display: grid;
  grid-template-columns: repeat(7, 90px);
  gap: 28px 12px;
  justify-content: center;
}

.app-launchpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: transform 0.15s;
}

.app-launchpad:hover { transform: scale(1.1); }
.app-launchpad:active { transform: scale(0.95); }

.icona-launchpad {
  width: 74px;
  height: 74px;
  border-radius: 17px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.45));
}

.app-launchpad span {
  font-size: 12px;
  color: white;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  font-weight: 500;
  max-width: 82px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

.app-launchpad.nascosta { display: none; }

/* ============================================
   FINESTRA SAFARI
   ============================================ */

#fin-safari {
  top: 70px;
  left: 100px;
  width: 800px;
  height: 555px;
}

.safari-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #f0f0f2;
  border-bottom: 1px solid #d5d5d7;
  height: 40px;
  flex-shrink: 0;
}

.safari-nav-group,
.safari-action-group {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.safari-nav-btn {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: background 0.15s;
}

.safari-nav-btn:hover { background: rgba(0,0,0,0.07); }

.safari-nav-btn svg {
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.safari-url-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.95);
  border: 1px solid #c8c8ca;
  border-radius: 7px;
  padding: 0 8px;
  height: 26px;
  max-width: 440px;
  margin: 0 auto;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.safari-url-wrap:focus-within {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
}

.safari-lock-icon {
  width: 10px;
  height: 13px;
  color: #888;
  flex-shrink: 0;
}

.safari-url-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 12px;
  color: #333;
  background: transparent;
  text-align: center;
  user-select: text;
  -webkit-user-select: text;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.safari-url-input::placeholder { color: #aaa; }
.safari-url-input:focus { text-align: left; }

.safari-body {
  flex: 1;
  overflow: hidden;
  background: #ebebed;
  display: flex;
  flex-direction: column;
  border-radius: 0 0 12px 12px;
  min-height: 0;
}

.safari-startpage {
  padding: 30px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  flex: 1;
}

.safari-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 14px;
}

.safari-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.safari-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s;
  width: 72px;
}

.safari-item:hover { transform: scale(1.06); }

.safari-icon-box {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.safari-item > span {
  font-size: 11px;
  color: #333;
  text-align: center;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
}

.safari-grid-sm { gap: 14px; }

.safari-iframe {
  width: 100%;
  flex: 1;
  border: none;
  display: block;
}

.safari-item-sm { width: 60px; }

.safari-icon-sm {
  width: 50px;
  height: 50px;
  border-radius: 11px;
}

/* ============================================
   DOCK — WRAPPER E DOT
   ============================================ */

.dock-app {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.dock-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.dock-app.aperta .dock-dot,
.dock-app.minimizzata .dock-dot {
  opacity: 1;
}

/* ============================================
   FILE FINDER (icone file nelle finestre)
   ============================================ */

.griglia-file-finder {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 18px;
}

.file-finder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: default;
  transition: background 0.15s;
  width: 110px;
}

.file-finder:hover { background: rgba(0, 113, 227, 0.08); }

.icona-file-finder {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.nome-file-finder {
  font-size: 11px;
  color: #333;
  text-align: center;
  margin: 0;
  line-height: 1.35;
  word-break: break-word;
  max-width: 106px;
}

/* ============================================
   CARD VIDEO nella griglia progetti
   ============================================ */

.carta-video {
  cursor: pointer;
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #1c1c1e;
  border: 1px solid #d5d5d7;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s;
}

.video-thumb svg {
  width: 50px;
  height: 50px;
}

.carta-video:hover .video-thumb {
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Sfondo nero per il modal video */
.modal-video-body { background: #000; }
.modal-video-body video { width: 100%; height: 100%; display: block; }

#modal-pdf-iframe { width: 100%; height: 100%; border: none; display: block; }

/* --- Modal PDF su mobile: adatta alla larghezza schermo --- */
@media (max-width: 768px) {
  #modal-pdf .modal-dialog,
  #modal-pdf.modal-mac .modal-dialog {
    max-width: 100%;
    width: calc(100% - 20px);
    margin: 10px auto;
  }

  #modal-pdf .modal-mac-content {
    width: 100%;
    height: 90vh;
  }

  #modal-pdf .modal-body {
    padding: 0;
    overflow: hidden;
  }

  #modal-pdf-iframe {
    width: 100%;
    height: 100%;
  }
}

/* Dark mode — modal */
body.dark-mode .modal-mac-content { background: #2c2c2e; }
body.dark-mode .modal-mac-header.modal-header {
  background: linear-gradient(to bottom, #3a3a3c, #2c2c2e);
  border-bottom-color: #48484a;
}
body.dark-mode .modal-mac-header .modal-title { color: #f5f5f7; }

@media (max-width: 768px) {
  .modal-mac-lg,
  .modal-mac-xl { max-width: 100%; }
  .modal-mac-content { border-radius: 0; }
  .modal-mac-tall { height: 100%; }
}

/* ============================================
   DARK MODE
   ============================================ */

/* sfondo dark mode gestito via JS (swap immagine) */

body.dark-mode .barra-superiore {
  background: rgba(0, 0, 0, 0.75);
}

body.dark-mode .immagine-icona {
  filter: brightness(1.15) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

body.dark-mode .etichetta-icona {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

body.dark-mode .finestra {
  background: #1c1c1e;
}

body.dark-mode .barra-finestra {
  background: linear-gradient(to bottom, #3a3a3c, #2c2c2e);
  border-bottom-color: #48484a;
}

body.dark-mode .titolo-finestra { color: #f5f5f7; }

body.dark-mode .barra-laterale {
  background: #2c2c2e;
  border-right-color: #3a3a3c;
}

body.dark-mode .sezione-menu h4 { color: #636366; }

body.dark-mode .lista-menu li { color: #e5e5e7; }

body.dark-mode .lista-menu li:hover {
  background: rgba(255,255,255,0.08);
  color: #f5f5f7;
}

body.dark-mode .corpo-principale h3,
body.dark-mode .corpo-principale h4 { color: #f5f5f7; }

body.dark-mode .corpo-principale p,
body.dark-mode .lista-competenze { color: #aeaeb2; }

body.dark-mode .elemento-nota {
  background: #2c2c2e;
  border-bottom-color: #3a3a3c;
}

body.dark-mode .elemento-nota:hover { background: #3a3a3c; }

body.dark-mode .titolo-elemento-nota { color: #f5f5f7; }

body.dark-mode .contenitore-nota h2,
body.dark-mode .contenitore-nota h4 { color: #f5f5f7; }

body.dark-mode .contenitore-nota p,
body.dark-mode .contenitore-nota ul { color: #aeaeb2; }


body.dark-mode .safari-toolbar {
  background: #2c2c2e;
  border-bottom-color: #3a3a3c;
}

body.dark-mode .safari-url-wrap {
  background: rgba(58,58,60,0.9);
  border-color: #48484a;
}

body.dark-mode .safari-url-input { color: #f5f5f7; }
body.dark-mode .safari-url-input::placeholder { color: #636366; }
body.dark-mode .safari-lock-icon { color: #636366; }

body.dark-mode .safari-nav-btn { color: #aeaeb2; }
body.dark-mode .safari-nav-btn:hover { background: rgba(255,255,255,0.08); }

body.dark-mode .safari-body { background: #2c2c2e; }
body.dark-mode .safari-startpage { background: #2c2c2e; }
body.dark-mode .safari-section-title { color: #f5f5f7; }
body.dark-mode .safari-item > span { color: #aeaeb2; }

body.dark-mode .modal-content-preview { background: #2c2c2e; }
body.dark-mode .modal-preview-header {
  background: linear-gradient(to bottom, #3a3a3c, #2c2c2e);
  border-bottom-color: #48484a;
}
body.dark-mode .modal-preview-title { color: #f5f5f7; }

/* --- Control Center dark --- */
body.dark-mode #cc-panel {
  background: rgba(30, 30, 32, 0.97);
  box-shadow: 0 8px 40px rgba(0,0,0,0.55), 0 0 0 0.5px rgba(255,255,255,0.06);
}

body.dark-mode .cc-tile {
  background: rgba(58, 58, 60, 0.92);
}

body.dark-mode .cc-conn-row {
  border-bottom-color: rgba(255,255,255,0.07);
}

body.dark-mode .cc-conn-info b    { color: #f5f5f7; }
body.dark-mode .cc-conn-info span { color: #8e8e93; }
body.dark-mode .cc-conn-chevron   { color: #48484a; }

body.dark-mode .cc-toggle-label { color: #f5f5f7; }
body.dark-mode .cc-sm-label     { color: #aeaeb2; }

body.dark-mode .cc-slider-title { color: #8e8e93; }
body.dark-mode .cc-slider-icon  { color: #8e8e93; }
body.dark-mode .cc-slider-track { background: #3a3a3c; }
body.dark-mode .cc-slider-fill  { background: #636366; }

body.dark-mode .cc-music-art    { background: #3a3a3c; }
body.dark-mode .cc-music-info b    { color: #f5f5f7; }
body.dark-mode .cc-music-info span { color: #8e8e93; }
body.dark-mode .cc-play-btn svg    { fill: #f5f5f7; }
body.dark-mode .cc-play-btn:hover  { background: rgba(255,255,255,0.1); }

body.dark-mode .nome-file-finder { color: #e5e5e7; }
body.dark-mode .file-finder:hover { background: rgba(255, 255, 255, 0.07); }

/* ============================================
   SCHERMATA IPHONE — layout mobile (max 768px)
   ============================================ */

/* ============================================
   POPUP TELEFONO
   ============================================ */

#popup-telefono {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

#popup-telefono.aperto { display: flex; }

.popup-tel-scheda {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 32px 28px 24px;
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: popup-entra 0.25s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

@keyframes popup-entra {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.popup-tel-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.popup-tel-nome {
  font-size: 18px;
  font-weight: 600;
  color: #1c1c1e;
  margin: 0;
}

.popup-tel-numero {
  font-size: 14px;
  color: #6e6e73;
  margin: 0 0 16px;
  letter-spacing: 0.3px;
}

.popup-tel-azioni {
  display: flex;
  gap: 12px;
  width: 100%;
}

.popup-tel-annulla,
.popup-tel-chiama {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.popup-tel-annulla {
  background: #e5e5ea;
  color: #1c1c1e;
}

.popup-tel-chiama {
  background: #34c759;
  color: white;
}

.popup-tel-annulla:hover,
.popup-tel-chiama:hover { opacity: 0.85; }

/* Nascosta su desktop */
#schermata-iphone { display: none; }

/* Pulsante indietro Note — nascosto su desktop */
.torna-lista-note { display: none; }

@media (max-width: 768px) {

  /* Nasconde tutti gli elementi macOS */
  .sfondo,
  .barra-superiore,
  .area-principale,
  .dock,
  #launchpad,
  #cc-panel,
  #cc-overlay,
  #ps-loading-overlay,
  #brightness-overlay {
    display: none !important;
  }

  /* Mostra la schermata iPhone */
  #schermata-iphone {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background-image: url('img/sfondo_desktop_montagna.jpg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
  }

  /* --- Barra stato --- */
  .status-bar-iphone {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px 6px;
    flex-shrink: 0;
  }

  #ora-iphone {
    font-size: 17px;
    font-weight: 600;
    color: white;
    letter-spacing: -0.3px;
  }

  .icone-status-iphone {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* --- Titolo portfolio iphone (centrato tra app e dock) --- */
  .titolo-iphone {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 6px 20px;
    cursor: pointer;
  }

  .titolo-iphone-sopra {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-transform: lowercase;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
  }

  .titolo-iphone-testo {
    margin: 0;
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-transform: lowercase;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
  }

  .titolo-iphone-hint {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
  }

  /* --- Griglia home screen --- */
  .griglia-home-iphone {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 12px;
    padding: 32px 20px 16px;
    align-content: start;
  }

  .icona-iphone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }

  .icona-iphone:active { opacity: 0.7; }

  .img-icona-iphone {
    width: 62px;
    height: 62px;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: none;
  }

  .img-icona-logo {
    border-radius: 0;
    object-fit: contain;
    box-shadow: none;
  }

  .icona-iphone span,
  .icona-dock-iphone span {
    font-size: 10px;
    color: white;
    text-align: center;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
    max-width: 64px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  /* --- Dock iPhone --- */
  .dock-iphone {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0 16px 28px;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
  }

  .icona-dock-iphone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
  }

  .icona-dock-iphone:active { opacity: 0.7; }

  /* Nel dock le icone sono leggermente più grandi */
  .dock-iphone .img-icona-iphone {
    width: 66px;
    height: 66px;
  }

  /* --- Finestre a tutto schermo su mobile --- */
  .finestra.aperta {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    transform: none !important;
    z-index: 99990 !important;
  }

  /* Barra finestra più alta per il notch */
  .barra-finestra {
    padding-top: 20px;
    height: 56px;
  }

  /* Sidebar nascosta su mobile — solo il contenuto principale */
  .barra-laterale { display: none; }

  .contenuto-finestra.con-sidebar {
    flex-direction: column;
  }

  /* --- Note su mobile: lista → dettaglio stile iOS --- */

  /* Mostra la lista note a tutto schermo (override hide generale) */
  #fin-note .barra-laterale {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    border-right: none;
    padding: 0;
    overflow-y: auto;
  }

  #fin-note .lista-note { width: 100%; }

  /* Le card delle note più grandi e touch-friendly */
  #fin-note .elemento-nota {
    padding: 14px 18px;
    border-bottom: 0.5px solid #e5e5e7;
  }

  #fin-note .titolo-elemento-nota { font-size: 15px; }
  #fin-note .anteprima-nota { white-space: normal; -webkit-line-clamp: 2; line-clamp: 2; }

  /* Contenuto nota nascosto finché non si seleziona */
  #fin-note .corpo-principale {
    display: none !important;
    flex-direction: column;
    overflow: hidden;
  }

  /* Quando una nota è aperta su mobile */
  #fin-note.nota-aperta-mobile .barra-laterale {
    display: none !important;
  }

  #fin-note.nota-aperta-mobile .corpo-principale {
    display: flex !important;
    flex: 1;
  }

  #fin-note.nota-aperta-mobile .contenitore-nota {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
  }

  /* Pulsante ‹ Note */
  .torna-lista-note {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 500;
    color: #e74c3c;
    background: white;
    border-bottom: 0.5px solid #e5e5e7;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
  }

  body.dark-mode .torna-lista-note {
    background: #1c1c1e;
    border-bottom-color: #3a3a3c;
    color: #ff6b6b;
  }

  /* --- Chi sono: scroll e margini su mobile --- */
  .chisono-doc {
    padding: 16px 14px;
  }

  .chisono-foglio {
    padding: 28px 22px;
    max-width: 100%;
  }

  /* Overlay caricamento PS/Illustrator visibile su mobile */
  #ps-loading-overlay.aperto {
    display: flex !important;
    z-index: 99999;
  }

  /* Immagine di caricamento adattata al telefono */
  #ps-loading-img {
    max-width: 88vw;
    max-height: 60vh;
    border-radius: 12px;
  }

  /* Schermata app PS/Illustrator a tutto schermo */
  .ps-contenuto {
    flex: 1;
    min-height: 0;
    border-radius: 0;
  }

  .ps-schermata.ps-app {
    object-fit: cover;
    border-radius: 0;
  }

}

/* ============================================
   UTILITY
   ============================================ */

/* Nasconde un elemento — alternativa alle inline style="display:none" */
.nascosto { display: none; }

/* ============================================
   CONTROL CENTER — layout tile destra
   ============================================ */

/* Colonna destra: Light Mode in alto + griglia 2 colonne sotto */
.cc-col-destra {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Griglia 2 colonne per Keyboard Brightness e Fullscreen */
.cc-griglia-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Tile compatta (altezza ridotta) */
.cc-tile-toggle { flex: 1; }

.cc-tile-sm-mini {
  min-height: 52px;
  padding: 8px 6px;
}

.cc-tile-sm-mini .cc-sm-icon  { font-size: 16px; }
.cc-tile-sm-mini .cc-sm-label { font-size: 10px; }

/* Cursore pointer sugli elementi file-finder che aprono un PDF */
.file-finder[data-pdf] { cursor: pointer; }

/* ============================================
   FINESTRA CHI SONO — foglio A4 su sfondo grigio
   ============================================ */

.chisono-doc {
  background: #d9d9dc;
  padding: 28px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-height: 0;
}

.chisono-foglio {
  background: #ffffff;
  width: 100%;
  max-width: 600px;
  padding: 52px 60px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color: #1d1d1f;
  line-height: 1.65;
}

.chisono-foglio h2 {
  font-size: 26px;
  font-weight: 700;
  color: #1d1d1f;
  margin: 0 0 20px;
}

.chisono-foglio h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1d1d1f;
  margin: 32px 0 12px;
}

.chisono-foglio h4 {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 16px 0 6px;
}

.chisono-foglio p {
  font-size: 14px;
  color: #1d1d1f;
  margin: 0 0 14px;
}

.chisono-foglio ul {
  font-size: 14px;
  color: #1d1d1f;
  margin: 0 0 14px 22px;
  line-height: 1.85;
}

.chisono-foglio ul li {
  margin-bottom: 3px;
}

/* Dark mode */
body.dark-mode .chisono-doc { background: #1c1c1e; }
body.dark-mode .chisono-foglio {
  background: #2c2c2e;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  color: #f5f5f7;
}
body.dark-mode .chisono-foglio h2,
body.dark-mode .chisono-foglio h3,
body.dark-mode .chisono-foglio h4,
body.dark-mode .chisono-foglio p,
body.dark-mode .chisono-foglio ul { color: #e5e5e7; }

/* Form barra URL Safari */
#safari-url-form {
  flex: 1;
  display: flex;
}

/* Margine sinistro pulsante barra laterale Safari */
.safari-nav-btn-sidebar { margin-left: 4px; }

/* Griglia-progetti in chi-sono ha margine superiore maggiore */
.corpo-principale .griglia-progetti { margin-top: 20px; }

