/* Les outils du LiDAR en liste au téléphone (src/topo-outils-liste.js) : la colonne ne garde que Calques et Outils ; la feuille
   reprend le dessin d'une liste de réglages (nom en clair, interrupteur ou chevron à droite, lignes de 48 px) */
@media all /* la mise en page du téléphone, au bureau aussi (Henri, 30/10/2026 : « épure le lidar comme la version téléphonique ») */ {
  .tp .tpi-outils > :is(button, hr):not([data-tp-calques-bouton], [data-tp-plus]) { display: none !important; }
}
.tpo-fond { position: absolute; inset: 0; z-index: 40; display: flex; align-items: flex-end; background: rgba(0, 0, 0, .35); }
.tpo-fond[hidden] { display: none; }
.tpo-feuille { width: 100%; max-height: 78%; display: flex; flex-direction: column; margin: 0 8px calc(env(safe-area-inset-bottom) + 8px); border-radius: var(--r-panneau); background: rgb(var(--tp-n) / .98); color: var(--tp-encre); overflow: hidden; }
.tpo-tete { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 16px; }
.tpo-tete b { font-size: var(--t-17); font-weight: 600; }
.tpo-x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-bouton); background: none; color: rgb(var(--tp-v) / .6); }
.tpo-x svg { width: 15px; height: 15px; }
.tpo-corps { overflow-y: auto; padding: 0 12px 12px; -webkit-overflow-scrolling: touch; }
.tpo-groupe { margin: 14px 4px 6px; font-size: var(--t-12); font-weight: 500; color: rgb(var(--tp-v) / .5); }
.tpo-liste { margin: 0; padding: 0; list-style: none; border-radius: var(--r-carte); background: rgb(var(--tp-v) / .05); overflow: hidden; }
.tpo-liste li + li { border-top: 1px solid rgb(var(--tp-v) / .07); }
.tpo-ligne { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 12px; border: 0; background: none; color: inherit; font: inherit; font-size: var(--t-15); text-align: left; }
.tpo-ligne:active { background: rgb(var(--tp-v) / .06); }
.tpo-ic { display: grid; place-items: center; flex: none; width: 22px; color: rgb(var(--tp-v) / .72); }
.tpo-ic svg { width: 18px; height: 18px; }
.tpo-nom { flex: 1; min-width: 0; }
.tpo-nom small { display: block; margin-top: 1px; font-size: var(--t-12); color: rgb(var(--tp-v) / .5); }
.tpo-chev { display: grid; color: rgb(var(--tp-v) / .35); }
.tpo-chev svg { width: 14px; height: 14px; }
/* l'interrupteur des réglages de l'app (28 × 16, instrument.css), à la taille du doigt */
.tpo-inter { position: relative; flex: none; width: 44px; height: 26px; border-radius: var(--r-carte); background: rgb(var(--tp-v) / .16); transition: background .15s; }
.tpo-inter::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--tp-encre); transition: transform .15s; }
.tpo-ligne[aria-checked="true"] .tpo-inter { background: var(--tp-encre); }
.tpo-ligne[aria-checked="true"] .tpo-inter::after { transform: translateX(18px); background: var(--tp-sur-encre); }
@media (prefers-reduced-motion: reduce) { .tpo-inter, .tpo-inter::after { transition: none; } }

/* Plus de vue au téléphone (Henri, 29/10/2026 : « toujours pas assez de visibilité sur l'écran et la boîte 3D est beaucoup trop
   grande ») : mesuré sur iPhone 17, la feuille du bas prenait 253 px sur 714 et le cube 160 × 180. Le cube est réduit à ses
   faces (Vue d'ensemble et Perspective passent dans la liste Outils), la feuille garde le dénivelé sur une ligne, la jauge
   et les couleurs ; le compte de points et le détail de la jauge s'effacent (la jauge garde le nom du cran). */
@media all {
  .tp .tc { padding: 2px; border-radius: var(--r-carte); transform: scale(.62); transform-origin: top left; }
  .tp .tc :is(.tc-bas, .tc-nom) { display: none; }
  .tp .tp-plus-points { display: none !important; }
  .tp .tp-alti { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; }
  .tp .tp-alti .tpi-lib { flex: 1 0 100%; }
  .tp .tp-alti .tpi-gros { font-size: var(--t-22); font-weight: 500; line-height: 1.2; }
  .tp .tp-alti .tp-chiffres { margin: 0 0 0 auto; }
  .tp .tdf-effet, .tp .tdf-crans { display: none; }
  .tp .tdf-curseur { height: 32px; }
  .tp .tdf-tete { margin-bottom: 0; }
  .tp .tdf-dans-tp { padding: 0 2px; }
  .tp .tpi-feuille { padding: 6px 12px 10px; }
  .tp .tpi-feuille .tpi-poignee { margin-bottom: 4px; }
  .tp .tpi-feuille .tpi-bas { margin-top: 4px; }
  .tp .tp-alti .tpi-lib { flex: 0 0 auto; }
  /* la jauge sur une ligne : le curseur, puis le nom du cran et « ⋯ » */
  .tp .tdf-jauge { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
  .tp .tdf-curseur { grid-column: 1; grid-row: 1; }
  .tp .tdf-tete { grid-column: 2; grid-row: 1; }
  .tp .tdf-tete > span { display: none; }
  .tp .tdf-tete b { margin-left: 0; }
  .tp .tp-alti .tp-chiffres { display: flex; align-items: baseline; gap: 8px; }
  .tp .tp-alti .tp-chiffres > * { margin: 0; }
}

/* les couleurs du nuage sous un bouton (téléphone) : le bouton à droite de la jauge, la liste au-dessus */
.tpo-couleur, .tpo-menu { display: none; }
@media all {
  .tp .tpi-bas:has(.tpo-couleur) { display: flex; align-items: center; gap: 8px; position: relative; left: auto; right: auto; bottom: auto; transform: none; }
  .tp .tpi-bas .tdf-dans-tp { flex: 1; min-width: 0; }
  .tp .tpi-bas :is(.tp-couleurs.tpo-cache-tel, .tpi-sep) { display: none !important; }
  .tp .tpo-couleur { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 44px; padding: 0 10px 0 12px; border: 0; border-radius: var(--r-bouton); background: rgb(var(--tp-v) / .08); color: var(--tp-encre); font: inherit; font-size: var(--t-13); font-weight: 500; }
  .tp .tpo-couleur svg { width: 12px; height: 12px; opacity: .6; transform: rotate(90deg); transition: transform .2s ease; }
  .tp .tpo-couleur[aria-expanded="true"] svg { transform: rotate(-90deg); }
  .tp .tpo-menu:not([hidden]) { display: block; position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 10; width: 240px; padding: 6px; border-radius: var(--r-carte); background: rgb(var(--tp-n) / .98); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 0 0 1px rgb(var(--tp-v) / .07); animation: tpo-surgir .16s ease-out; }
  .tp .tpo-menu-t { margin: 4px 8px 6px; font-size: var(--t-12); color: rgb(var(--tp-v) / .5); }
  .tp .tpo-menu button { position: relative; display: block; width: 100%; min-height: 44px; padding: 6px 10px 6px 30px; border: 0; border-radius: var(--r-bouton); background: none; color: var(--tp-encre); font: inherit; font-size: var(--t-14); text-align: left; }
  .tp .tpo-menu button small { display: block; font-size: var(--t-11); color: rgb(var(--tp-v) / .45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tp .tpo-menu button:active { background: rgb(var(--tp-v) / .08); }
  .tp .tpo-menu button[aria-checked="true"]::before { content: ""; position: absolute; left: 11px; top: 50%; width: 9px; height: 5px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-70%) rotate(-45deg); }
}
@keyframes tpo-surgir { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
/* au bureau : la feuille des outils devient un panneau à droite, sous les boutons, sans voile sur la vue */
@media (min-width: 900px) {
  .tpo-fond { align-items: flex-start; justify-content: flex-end; background: none; pointer-events: none; }
  .tpo-feuille { width: 420px; max-height: calc(100% - 84px); margin: 72px 64px 0 0; pointer-events: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
}
