/* ============================================================
   PICTUP - Importer ma photo (18 octobre 2026)
   Popup de traitement d'une photo en silhouette ou contour,
   entierement dans le navigateur. Reprend les jetons de la page
   (accent violet, pcard, sub-box, pill, btn).
   ============================================================ */
.ph-fond {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(26, 24, 22, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px; overflow-y: auto;
}
.ph-fond[hidden], .ph-fond [hidden] { display: none !important; }
body.ph-ouvert { overflow: hidden; }

.ph-modal {
  width: 100%; max-width: 1120px;
  background: var(--color-white, #fff);
  border-radius: var(--radius-card, 20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
  font-family: 'Sora', sans-serif; color: var(--color-ink);
  display: flex; flex-direction: column;
}
.ph-entete {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 28px 18px; border-bottom: 1.5px solid var(--color-line);
}
.ph-entete .pcard-title { flex: 1; }
.ph-fermer {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--color-border); background: #fff; color: var(--color-sub);
  font-size: 18px; line-height: 1; cursor: pointer; transition: all .15s;
}
.ph-fermer:hover { border-color: var(--accent); color: var(--accent); }

.ph-corps { padding: 20px 28px; display: flex; flex-direction: column; gap: 16px; }

.ph-consigne {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--accent-lt); border-radius: 14px; padding: 12px 16px;
  font-size: 13px; line-height: 1.5; color: var(--color-ink);
}
.ph-consigne svg { flex-shrink: 0; margin-top: 2px; }
.ph-consigne b { font-weight: 600; }

/* Etat vide : choisir une photo */
.ph-vide {
  border: 2px dashed var(--color-border); border-radius: 16px;
  padding: 44px 20px; text-align: center; background: var(--color-bg);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: border-color .15s, background .15s;
}
.ph-vide.survol { border-color: var(--accent); background: var(--accent-lt); }
.ph-vide .ph-vide-titre { font-size: 15px; font-weight: 600; }
.ph-vide .ph-vide-sous { font-size: 12px; color: var(--color-sub); }
.ph-erreur { font-size: 13px; color: var(--color-red); font-weight: 600; }

/* Deux apercus */
.ph-vues { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ph-vue { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ph-vue-titre { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.ph-vue-titre .param-label { margin: 0; }
.ph-scene {
  background: var(--color-bg); border: 1.5px solid var(--color-border); border-radius: 16px;
  padding: 10px; display: flex; align-items: center; justify-content: center; min-height: 260px;
}
.ph-scene canvas { display: block; max-width: 100%; max-height: 52vh; height: auto; border-radius: 10px; touch-action: none; background: #fff; }
#ph-src { cursor: crosshair; }
#ph-out.peindre { cursor: crosshair; }
.ph-vue-aide { font-size: 10px; color: var(--color-hint); text-align: center; }
.ph-petites { padding: 4px 11px; font-size: 12px; }

.ph-bilan {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
  font-size: 12px; color: var(--color-sub);
}
.ph-bilan b { color: var(--color-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ph-pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; background: var(--color-orange); }

/* Reglages : trois sub-box */
.ph-reglages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.ph-reglages .sub-box { margin-top: 0; }
.ph-reglages .param-group:last-child { margin-bottom: 0; }
.ph-aide { font-size: 11px; color: var(--color-sub); line-height: 1.4; margin-top: 6px; }
.ph-taille { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--color-sub); }
.ph-taille .num-input { width: 80px; }
.ph-fins summary {
  cursor: pointer; font-size: 11px; font-weight: 600; color: var(--color-sub);
  text-transform: uppercase; letter-spacing: .06em; list-style: revert;
}
.ph-fins[open] summary { margin-bottom: 12px; }
.ph-auto { margin-left: 6px; }

.ph-pied {
  border-top: 1.5px solid var(--color-line); padding: 16px 28px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.ph-pied .ph-note { font-size: 11px; color: var(--color-sub); max-width: 520px; line-height: 1.4; }
.ph-pied .ph-actions { display: flex; gap: 10px; }
.ph-pied .btn:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 900px) {
  .ph-vues, .ph-reglages { grid-template-columns: 1fr; }
  .ph-entete, .ph-corps, .ph-pied { padding-left: 16px; padding-right: 16px; }
}

/* Bouton d'ouverture, a cote de « Importer mon image » (button.import-label herite sinon la police du corps) */
#btn-photo { font-size: 13px; }

/* Fonction en test, comme le braille : pastille et note */
.ph-test { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--color-orange-lt); color: #8a5a00; font-size: 10px; font-weight: 600; vertical-align: 1px; }
.ph-test-note { font-size: 12px; line-height: 1.4; color: var(--color-sub); margin: -6px 0 0; }
#btn-photo .ph-test { margin-left: 2px; }
