html, body { height: 100%; }
body { background: var(--surface); overflow: hidden; }
#fenetres { position: fixed; inset: 0; }
.ap-appli { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--surface); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.ap-barre { flex: none; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; background: var(--tete); border-bottom: 1px solid var(--trait); }
.ap-barre .logo { width: 15px; height: 22px; color: var(--texte); }
.ap-volet .ap-barre b { color: var(--texte); }
.ap-onglets { display: flex; gap: 2px; margin-left: 4px; }
.ap-onglets button { font: 400 19px/1 var(--titre); color: var(--leger); padding: 5px 9px; border-radius: 9px; transition: color .14s, background .14s; }
.ap-onglets button:hover { color: var(--texte); background: var(--survol); }
.ap-onglets button.sel { color: var(--texte); }
.ap-onglets button .i { display: none; }
.ap-appli[hidden] { display: none; }
.ap-menu { position: fixed; z-index: 60; min-width: 200px; max-height: 50vh; overflow: auto; padding: 5px; border-radius: 11px; background: var(--verre-fort); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); box-shadow: var(--ombre-fen-in); display: grid; }
.ap-menu button { padding: 7px 10px; border-radius: 7px; font-size: 13px; text-align: left; }
.ap-menu button:hover, .ap-menu button:focus-visible { background: var(--selection); }
.ap-demande { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--texte); box-shadow: var(--ombre-fen); width: min(380px, calc(100vw - 32px)); }
.ap-demande::backdrop { background: rgba(17,47,64,.28); }
.ap-demande form { padding: 18px 20px; display: grid; gap: 12px; }
.ap-demande h4 { margin: 0; font: 400 22px/1.1 var(--titre); }
.ap-demande label { display: grid; gap: 4px; font-size: 12px; font-weight: 650; color: var(--doux); }
.ap-demande .actions { display: flex; justify-content: flex-end; gap: 8px; }
.ap-barre .outils { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ap-boites { display: none; }
[data-o="enligne"], [data-avance], #ca-avance { display: none !important; }
.corps-appli { flex: 1; min-height: 0; display: flex; position: relative; }
.c-comptes .reg { max-width: none; }
.ap-volet { position: absolute; right: 24px; bottom: 24px; width: min(780px, calc(100vw - 48px)); height: min(620px, calc(100vh - 80px)); display: flex; flex-direction: column; border-radius: var(--r-fen); overflow: hidden; background: var(--surface); box-shadow: var(--ombre-fen); z-index: 20; }
.ap-volet .ap-barre .titre { font: 650 13.5px/1.2 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-volet .fermer { margin-left: auto; }
.ap-volet .ap-barre .outils { margin-left: 0; }
#toasts { position: fixed; top: 58px; right: 16px; z-index: 40; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--verre-fort); box-shadow: var(--ombre-fen-in); text-align: left; font-size: 12.5px; }
.toast b { display: block; }
.toast { -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); }
.btn { transition: background .14s, transform .14s var(--ease); }
.btn:active, .s-item:active { transform: scale(.965); }
.c-msg:active { transform: scale(.992); }
.ap-boot { position: fixed; z-index: 90; }
.ap-boot .halo-boot { left: 50%; top: 50%; translate: -50% -50%; }
.c-papier iframe { transition: none; }
.toast .ico-app { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(145deg, var(--a), var(--b)); }

@media (max-width: 760px) {
  .ap-boites { display: inline-flex; }
  .ap-barre { gap: 4px; padding: 0 8px; }
  .ap-barre .logo { display: none; }
  .ap-onglets { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); background: var(--verre-fort); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); border-top: 1px solid var(--trait); }
  .ap-onglets button { display: grid; justify-items: center; gap: 2px; padding: 6px 0 4px; border-radius: 12px; font: 600 10.5px/1 var(--ui); color: var(--leger); }
  .ap-onglets button .i { display: block; }
  .ap-onglets button.sel { color: var(--bleu); }
  .ap-onglets button:hover { background: none; }
  .ap-appli { padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
  .ap-appli:has(.c-accueil.carte) { padding-bottom: env(safe-area-inset-bottom); }
  .ap-barre { justify-content: space-between; }
  .ap-barre .logo { display: block; margin-left: 6px; }
  .ap-barre .outils .btn-p { font-size: 0; gap: 0; width: 34px; padding: 0; }
  .c-app { position: relative; overflow: hidden; }
  .c-side { position: absolute; inset: 0 auto 0 0; width: min(280px, 82vw); z-index: 5; transform: translateX(-102%); transition: transform .34s var(--ease); background: var(--surface-2); box-shadow: var(--ombre-fen-in); }
  .c-app.boites-ouvertes .c-side { transform: none; }
  .c-liste { width: 100%; border-right: 0; }
  .c-lecture { position: absolute; inset: 0; z-index: 3; transform: translateX(102%); transition: transform .36s var(--ease); }
  .c-app:has(.c-msg.sel) .c-lecture { transform: none; }
  .c-msg { padding-top: 13px; padding-bottom: 14px; }
  .ap-volet { inset: 0; width: 100%; height: 100%; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .r-champ input, .r-champ select, .c-cherche input { font-size: 16px; }
  .r-corps { font-size: 16px; }
  .c-actions { gap: 2px; }
  .c-actions .btn { width: 36px; padding: 0; }
  .c-actions .lib { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
.ap-appli:has(.c-accueil.carte) .ap-barre .outils, .ap-appli:has(.c-accueil.carte) .ap-onglets { visibility: hidden; }
