/* Page /toityo.php : panneau à gauche, carte à droite (s'appuie sur articles-page.css, home.css et contact.css) */
.ty-body { background: var(--paper, #faf8f4); }
.ty { --dark: #1d2230; --orange: #e8590c; }
.ty { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 0; max-width: none; padding: 0; margin: 0; }
.ty-panel { height: calc(100vh - 65px); overflow-y: auto; padding: 28px 24px 40px; border-right: 1px solid var(--line); background: var(--paper); }
.ty-panel h1 { font-family: var(--serif); font-size: 34px; font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; margin: 4px 0 10px; }
.ty-panel h1 em { font-style: italic; font-weight: 400; color: var(--orange, #e8590c); }
.ty-lede { margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.ty-bloc { margin-top: 22px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.ty-bloc h2 { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
.ty-quota { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.ty-quota i { color: var(--accent); margin-right: 4px; }

.ty-onglets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.ty-onglets button { padding: 9px 8px; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); background: none; border: 0; border-radius: 9px; cursor: pointer; }
.ty-onglets button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(29, 34, 48, .12); font-weight: 600; }
.ty-onglets i { color: var(--accent); margin-right: 4px; }

.ty-recherche { position: relative; }
.ty-recherche input, .ty-form input[type=text] { display: block; width: 100%; padding: 11px 13px; font: inherit; font-size: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.ty-recherche input:focus, .ty-form input[type=text]:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(80, 89, 156, .15); }
.ty-recherche ul { position: absolute; z-index: 1000; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px -12px rgba(29, 34, 48, .35); }
.ty-recherche li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: 14px; border-radius: 7px; cursor: pointer; }
.ty-recherche li:hover { background: var(--paper); }
.ty-recherche li small { color: var(--muted); }
.ty-recherche li.trop small { color: #c92a2a; }

.ty-aide { margin: 0 0 10px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.ty-outils { display: flex; flex-wrap: wrap; gap: 6px; }
.ty-outils .home-btn { padding: 7px 11px; font-size: 13px; }
.ty-form { margin-top: 14px; }
.ty-form .ct-field { margin-bottom: 14px; }
.ty-choix { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 14px; padding: 10px 12px; font-size: 14px; font-weight: 500; background: #fff4e6; border: 1px solid #ffd8a8; border-radius: 10px; }
.ty-surface { color: #2b8a3e; font-weight: 600; }
.ty-surface.trop { color: #c92a2a; }
.ty-lancer { width: 100%; justify-content: center; }
.ty-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.ty-ok { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; padding: 11px 14px; font-size: 14px; color: #2b8a3e; background: #ebfbee; border: 1px solid #b2f2bb; border-radius: 10px; }
.ty-alerte { display: flex; gap: 10px; align-items: baseline; padding: 12px 14px; font-size: 14px; line-height: 1.5; color: #7c2d12; background: #fff4e6; border: 1px solid #ffd8a8; border-radius: 12px; }
.ty-alerte i { color: #e8590c; }
.ty .ty-alerte a { color: #c2410c; font-weight: 600; text-decoration: underline; }

/* Liste des périmètres */
.ty-liste { display: grid; gap: 10px; }
.ty-vide { margin: 0; font-size: 14px; color: var(--muted); }
.ty-item { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.ty-item-tete { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding-right: 22px; }
.ty-item-tete b { font-size: 15px; }
.ty-badge { flex: none; padding: 2px 9px; font-size: 12px; font-weight: 600; color: #fff; background: #667; border-radius: 999px; }
.ty-termine .ty-badge { background: #2f9e44; }
.ty-calcul .ty-badge, .ty-preparation .ty-badge, .ty-export .ty-badge { background: #1f6feb; }
.ty-echec .ty-badge, .ty-annule .ty-badge { background: #c92a2a; }
.ty-item-info { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.ty-item-erreur { margin: 6px 0 0; font-size: 13px; color: #c92a2a; }
.ty-barre { height: 8px; margin-top: 10px; background: #e6e6f2; border-radius: 99px; overflow: hidden; }
.ty-barre span { display: block; height: 100%; background: #1f6feb; border-radius: 99px; transition: width .6s; }
.ty-item-actions { margin-top: 10px; }
.ty-item-actions .home-btn { padding: 8px 13px; font-size: 13px; }
.ty-fichiers { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.ty .ty-fichiers a { color: var(--accent); font-weight: 500; }
.ty-fichiers small { color: var(--muted); }
.ty-suppr { position: absolute; top: 10px; right: 10px; padding: 4px 6px; font-size: 12px; color: #c92a2a; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.ty-suppr:hover { background: #fff5f5; }

/* Carte */
.ty-carte-zone { position: relative; }
.ty-carte { height: calc(100vh - 65px); }
.ty-carte.ty-dessin { cursor: crosshair; }
.ty-legende { position: absolute; z-index: 500; left: 12px; bottom: 24px; padding: 10px 12px; font-size: 12.5px; background: rgba(255, 255, 255, .95); border-radius: 10px; box-shadow: 0 4px 14px rgba(29, 34, 48, .18); }
.ty-legende ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.ty-legende i { display: inline-block; width: 14px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: middle; }

@media (max-width: 860px) {
  .ty { grid-template-columns: 1fr; }
  .ty-panel { height: auto; overflow: visible; border-right: 0; order: 2; padding: 20px 16px 32px; }
  .ty-carte-zone { order: 1; }
  .ty-carte { height: 55vh; }
}

/* 3D, messages et lien Urbexplore */
.ty-bouton3d { width: 34px; height: 34px; padding: 0; font: 700 13px/34px "Inter", system-ui, sans-serif; color: #1d2230; background: #fff; border: 2px solid rgba(0, 0, 0, .2); border-radius: 4px; background-clip: padding-box; cursor: pointer; }
.ty-bouton3d:hover { background: #f4f4f4; }
.ty-carte-zone .ty-carte3d { position: absolute; inset: 0; z-index: 800; background: #dfe3e8; }  /* maplibre-gl.css impose position: relative */
/* en 3D, seul le bouton « 2D » de la carte à plat reste visible par-dessus */
.ty-carte-zone.en-3d .leaflet-control-zoom, .ty-carte-zone.en-3d .leaflet-control-layers { display: none; }
.ty-carte-zone.en-3d .ty-legende { z-index: 900; }
.ty-message { position: absolute; z-index: 950; left: 50%; top: 14px; transform: translateX(-50%); max-width: 90%; margin: 0; padding: 9px 14px; font-size: 13.5px; color: #fff; background: rgba(29, 34, 48, .92); border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.ty-item-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ty-urbex { display: flex; gap: 9px; margin: 12px 0 0; padding: 10px 12px; font-size: 13px; line-height: 1.5; color: #3b4152; background: #edf2ff; border: 1px solid #dbe4ff; border-radius: 10px; }
.ty-urbex > i { margin-top: 3px; color: var(--accent); }
.ty .ty-urbex a { display: inline-block; margin-top: 3px; color: var(--accent); font-weight: 600; }

/* Commune, ou zone dans une commune trop grande (carte_commune.js, aussi pour urbaxol.php) */
.ty-aide-commune { margin: 8px 0 0; font-size: 13px; }
#ty-zone { margin-top: 14px; }
#ty-zone .ty-outils { margin-top: 10px; }
.ty-solaire { display: flex; gap: 8px; align-items: baseline; margin: 0 0 14px; font-size: 14px; }
.ty-solaire input { margin: 0; }
.ty-solaire small { display: block; color: var(--muted); font-size: 12.5px; }

/* Légende repliable (choix retenu dans le navigateur) */
.ty-legende-bascule { float: right; margin: -4px -6px 0 8px; padding: 2px 6px; font: inherit; font-size: 12px; color: #667; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.ty-legende-bascule:hover { color: #1d2230; background: #f1f3f5; }
.ty-legende.is-repliee { padding: 4px 6px; }
.ty-legende.is-repliee > :not(.ty-legende-bascule) { display: none; }
.ty-legende.is-repliee .ty-legende-bascule { float: none; margin: 0; color: #1d2230; font-weight: 600; }
.ty-vues { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ty-vues button { padding: 4px 9px; font: inherit; font-size: 12px; font-weight: 500; color: var(--muted, #667); background: #f1f3f5; border: 0; border-radius: 999px; cursor: pointer; }
.ty-vues button.is-active { color: #fff; background: #1d2230; }
.ty-trop_grande .ty-badge { background: #e8590c; }

/* Démonstration publique (toityo_demo.php) */
.ty-demo { border-color: var(--accent, #e8590c); }
.ty-demo p { font-size: 14px; line-height: 1.55; }
.ty-demo .home-btn { margin-top: 14px; }
