/* TOUQUET / V2.3 — UI MOBILE (web et APK) : grille, respirations, couleur.
   Une règle par composant, regroupée par écran. Zone Android native séparée. */
@media(max-width:1000px) {
  body.touquet-v23 {
    --m-page:clamp(14px,4vw,22px);
    --m-card:clamp(17px,4.5vw,23px);
    --m-gap:16px;
    --m-head:64px;
    --m-nav:74px;
    --bg:var(--lt-bg);--surface:var(--lt-surface);
    --surface-2:var(--lt-raised);--text:var(--lt-ink);
    --muted:var(--lt-muted);--heading:var(--lt-ivory);
    --line:var(--lt-border);--v9-bg:var(--lt-bg);
    --v9-elevated:var(--lt-surface);--v9-border:var(--lt-border);
    --v9-accent:var(--lt-coast);--v9-ink:var(--lt-ink);
    --v9-muted:var(--lt-muted);
    background:var(--lt-bg);color:var(--lt-ink);
    overflow-x:clip;
  }
  body.touquet-v23 :is(.app-shell,.workspace,.main) {max-width:100%;min-width:0;}
  body.touquet-v23 .workspace {background:radial-gradient(ellipse at 75% 0%,#285e4c33,transparent 36%),var(--lt-bg)!important;}
  /* Header: la WebView est déjà placée sous la barre système via Android; ne pas doubler l'inset. */
  body.touquet-v23 .mobile-head {
    position:sticky!important;top:0!important;z-index:70!important;
    display:flex!important;align-items:center!important;justify-content:space-between!important;
    box-sizing:border-box!important;width:100%!important;
    height:var(--m-head)!important;min-height:var(--m-head)!important;
    padding:10px var(--m-page)!important;
    border-bottom:1px solid var(--lt-border)!important;
    background:#0d2c32!important;box-shadow:0 6px 20px #030e1426!important;
  }
  body.touquet-v23 .mobile-brand {min-width:0;flex:1;gap:11px!important;}
  body.touquet-v23 .mobile-brand > span:last-child {min-width:0;overflow:hidden;}
  body.touquet-v23 .mobile-brand b {display:block;color:var(--lt-ivory)!important;font-size:15px!important;font-weight:760;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  body.touquet-v23 .mobile-brand small {display:block;color:#a5c9bc!important;font-size:10px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  body.touquet-v23 .mobile-logo {width:39px!important;height:39px!important;flex:none;background:#27594b!important;border:1px solid #4a806a!important;border-radius:12px!important;}
  body.touquet-v23 .tp-mobile-version {display:none!important;}
  body.touquet-v23 .mobile-actions {flex:none;gap:8px!important;}
  body.touquet-v23 .mobile-icon-btn {width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;border-radius:12px!important;background:#1e4548!important;border:1px solid #416766!important;color:#e9f3e6!important;}
  body.touquet-v23 .no8-context-bar {display:none!important;}
  body.touquet-v23 .main {
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;
    min-width:0!important;overflow-x:clip!important;
    padding:22px var(--m-page) calc(var(--m-nav) + 36px + env(safe-area-inset-bottom,0px))!important;
  }
  body.touquet-v23.flow-page .main {padding-bottom:30px!important;}
  body.touquet-v23 :is(.v9-page-heading,.geo-headings,.formhead) h1 {font-size:clamp(28px,8.4vw,38px)!important;line-height:1.12!important;letter-spacing:-.035em!important;}
  body.touquet-v23 :is(.v9-kicker,.panel-kicker,.section-kicker,.eyebrow) {color:var(--lt-coast)!important;letter-spacing:.12em;}
  /* Surface unique pour cartes et formulaires, sans toucher aux cellules/tuiles de la carte Leaflet. */
  body.touquet-v23 :is(
    .panel,.v9-panel,.filter-panel,.premium-form,.detail-side-card,
    .detailblock,.detailhero.premium-hero,.gps-operation-panel,.assignment-card,
    .validation-card,.terrain-readonly,.journal-panel,.journal-compose-drawer,
    .report-filter-panel,.report-summary,.report-preview-list,.notification-row,
    .tp-timeline-card,.tp-journal-filters,.settings-card,.catalogue-item,
    .user-card,.vacation-item,.geo-list-panel,.mobile-empty-state,.ag-filters
  ) {
    box-sizing:border-box!important;min-width:0!important;max-width:100%!important;
    padding:var(--m-card)!important;border-radius:var(--lt-radius)!important;
    background:var(--lt-surface)!important;border:1px solid var(--lt-border)!important;
    box-shadow:0 9px 25px #03141d30!important;
    overflow-wrap:anywhere;
  }
  body.touquet-v23 :is(.detail-grid,.detail-stack,.report-grid,.settings-grid,.form-grid,.form-grid-2,.journal-stream,.journal-event-content,.intervention-grid,.users-grid,.geo-layout) {min-width:0;max-width:100%;gap:var(--m-gap)!important;}
  body.touquet-v23 :is(.panel,.detailblock,.journal-panel,.report-summary,.gps-operation-panel,.terrain-readonly,.assignment-card,.validation-card) {margin-bottom:var(--m-gap)!important;}
  body.touquet-v23 :is(.panel-head,.journal-head,.section-head,.filter-head,.notification-tools) {gap:12px!important;margin-bottom:17px!important;}
  body.touquet-v23 :is(.panel,.v9-panel,.detailblock,.journal-panel,.mobile-work-card,.notification-row,.tp-timeline-card) :is(h1,h2,h3,p,small,strong) {overflow-wrap:anywhere;}
  body.touquet-v23 :is(.panel,.detailblock,.journal-panel) > :first-child {margin-top:0;}
  body.touquet-v23 :is(.panel,.detailblock,.journal-panel) > :last-child {margin-bottom:0;}
  /* Navigation principale et compteur des alertes. */
  body.touquet-v23 .bottomnav {border-top:1px solid var(--lt-border)!important;background:#0c2a31!important;box-shadow:0 -8px 28px #06192360!important;}
  body.touquet-v23 .bottomnav .bottom-item {min-width:0!important;min-height:48px!important;border-radius:12px!important;gap:4px!important;font-size:10px!important;color:#b6cbc5!important;}
  body.touquet-v23 .bottomnav .bottom-item.active {background:#255849!important;color:#f6efe2!important;}
  body.touquet-v23 .bottomnav .bottom-item svg {width:21px;height:21px;flex:none;}
  body.touquet-v23 .native-unread-count {background:#ed9e79;color:#1c3233;border-radius:12px;border:2px solid #0d2c31;}
  /* Missions — espace vertical et cartes de consultation. */
  body.touquet-v23 .v9-mobile-missions {padding-top:2px!important;}
  body.touquet-v23 .v9-mobile-missions-top h1 {color:var(--lt-ivory)!important;font-size:clamp(30px,8.4vw,38px)!important;line-height:1.1!important;margin:10px 0 8px!important;}
  body.touquet-v23 .v9-mobile-missions-top p {color:var(--lt-muted)!important;font-size:13px!important;line-height:1.6!important;}
  body.touquet-v23 .v9-mission-overview {margin:19px 0!important;overflow:hidden;border:1px solid #477063!important;border-radius:17px!important;background:linear-gradient(120deg,#19493e,#11333b)!important;}
  body.touquet-v23 .v9-mission-overview > span {padding:19px 18px!important;}
  body.touquet-v23 .v9-mission-overview b {font-size:33px!important;color:#f3e5c8!important;}
  body.touquet-v23 .v9-mission-overview small {font-size:10px!important;color:#c2d9c7!important;letter-spacing:.07em;}
  body.touquet-v23 .v9-mobile-find {margin:17px 0 23px!important;padding:0 16px!important;border:1px solid #476b62!important;border-radius:13px!important;min-height:51px!important;background:#122f38!important;}
  body.touquet-v23 .v9-mobile-find input {background:transparent!important;border:0!important;box-shadow:none!important;padding:11px 4px!important;}
  body.touquet-v23 .mobile-view-tabs {top:var(--m-head)!important;z-index:29!important;margin:0 0 16px!important;gap:10px!important;padding:11px 0 12px!important;background:var(--lt-bg)!important;}
  body.touquet-v23 .mobile-view-tabs a {padding:11px 9px!important;min-height:49px!important;border-radius:12px!important;}
  body.touquet-v23 .mobile-section-title {margin:12px 1px 17px!important;gap:12px!important;}
  body.touquet-v23 .mobile-section-title h2 {font-size:20px!important;line-height:1.28!important;}
  body.touquet-v23 .v9-mobile-worklist {display:grid!important;gap:14px!important;}
  body.touquet-v23 .mobile-work-card {
    display:grid!important;grid-template-columns:44px minmax(0,1fr) 13px!important;
    align-items:start!important;gap:14px!important;
    min-height:0!important;margin:0!important;padding:19px!important;
    background:#12343c!important;border:1px solid #39645d!important;
    border-radius:16px!important;box-shadow:0 8px 22px #03131d36!important;
  }
  body.touquet-v23 .mobile-work-icon {width:44px!important;height:44px!important;border-radius:12px!important;}
  body.touquet-v23 .mobile-work-copy {min-width:0!important;gap:9px!important;}
  body.touquet-v23 .mobile-work-copy>div {display:flex;flex-wrap:wrap;gap:8px!important;}
  body.touquet-v23 .mobile-work-copy strong {font-size:15px!important;line-height:1.4!important;color:#f2f1e6!important;}
  body.touquet-v23 .mobile-work-copy p {font-size:13px!important;line-height:1.5!important;color:#b9d4cd!important;}
  body.touquet-v23 .mobile-work-copy small {font-size:11px!important;line-height:1.5!important;color:#a2c0b9!important;}
  body.touquet-v23 .mobile-work-arrow {color:#e0c58f!important;}
  body.touquet-v23 .mobile-empty-state {padding:32px 20px!important;text-align:center;}
  /* Fiches, suivi, notifications et main courante. */
  body.touquet-v23 .v9-detail-header {padding:24px var(--m-card)!important;border-radius:17px!important;background:linear-gradient(115deg,#17483f,#0f303b)!important;border:1px solid #477465!important;}
  body.touquet-v23 .v9-detail-header h1 {color:var(--lt-ivory)!important;font-size:clamp(29px,8vw,38px)!important;line-height:1.13!important;overflow-wrap:anywhere;}
  body.touquet-v23 .v9-detail-head-content {gap:14px!important;}
  body.touquet-v23 .v9-quick-actions {display:flex;flex-wrap:wrap;gap:9px!important;margin:16px 0 20px!important;}
  body.touquet-v23 .v9-quick-actions a {min-height:43px;padding:10px 13px;border-radius:11px!important;}
  body.touquet-v23 .mobile-detail-tabs {gap:8px!important;margin:19px 0!important;padding:5px!important;border-radius:14px!important;}
  body.touquet-v23 .mobile-detail-tabs button {min-height:43px!important;padding:10px 9px!important;}
  body.touquet-v23 .detailblock :is(p,small),body.touquet-v23 .journal-event p {line-height:1.6!important;}
  body.touquet-v23 .journal-event,body.touquet-v23 .tp-timeline-card {padding:17px!important;border-radius:14px!important;}
  body.touquet-v23 .journal-stream,body.touquet-v23 .tp-global-timeline {gap:13px!important;}
  body.touquet-v23 .notification-row {margin-bottom:13px!important;gap:12px!important;background:#12353e!important;}
  body.touquet-v23 .notification-row.notification-new {border-left:4px solid var(--lt-coast)!important;}
  body.touquet-v23 .notification-row :is(strong,h3) {color:var(--lt-ivory)!important;}
  body.touquet-v23 .notification-row p {line-height:1.6!important;color:#cbddd5!important;}
  body.touquet-v23 .notification-row-actions {display:flex;gap:9px!important;flex-wrap:wrap;}
  body.touquet-v23 .notification-row-actions form {flex:1;min-width:0;}
  body.touquet-v23 .v9-field-create {
    background:var(--lt-sand)!important;color:#193c37!important;
    border:1px solid #ecddc0!important;border-radius:13px!important;
    padding:15px 19px!important;min-height:52px!important;
    box-sizing:border-box!important;box-shadow:0 6px 18px #010e182a!important;
  }
  body.touquet-v23 .v9-mobile-find input {
    border:0!important;background:transparent!important;min-height:45px!important;
    padding:11px 3px!important;box-shadow:none!important;
  }
  body.touquet-v23 .native-alert-hero {margin:0 0 17px!important;padding:4px 2px 14px!important;background:transparent!important;border:0!important;box-shadow:none!important;}
  body.touquet-v23 .native-alert-hero h1 {font-size:30px!important;color:var(--lt-ivory)!important;}
  body.touquet-v23 .notifications-panel {background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;}
  /* Formulaires : ne pas régler la taille des checkbox/radio, conserver les touches. */
  body.touquet-v23 :is(.main,.authmain) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range]):not([type=color]):not([type=button]):not([type=submit]),select,textarea) {
    box-sizing:border-box!important;max-width:100%!important;min-width:0!important;
    min-height:46px!important;padding:12px 14px!important;
    border:1px solid #476b67!important;border-radius:12px!important;
    background:#102a34!important;color:#f2f4eb!important;
    font-size:16px!important;line-height:1.4!important;
  }
  body.touquet-v23 :is(input,select,textarea)::placeholder {color:#9aafa9!important;}
  body.touquet-v23 :is(.premium-form,.filter-grid,.form-grid-2,.journal-composer,.tp-filter-form,.ag-filter-grid) {gap:15px!important;}
  body.touquet-v23 :is(label,.form-label) {line-height:1.45;}
  body.touquet-v23 :is(.btn,.v9-btn,button[type=submit],a.btn) {min-height:44px;border-radius:11px;}
  body.touquet-v23 :is(.btn.primary,.v9-btn-primary,.takeover-button) {background:#eadfc6!important;color:#153c35!important;border-color:#eadfc6!important;font-weight:790!important;}
  body.touquet-v23 :is(.detail-actions,.journal-row-actions,.report-quick-action,.journal-composer-bottom) {gap:10px!important;flex-wrap:wrap!important;}
  body.touquet-v23 :is(.geo-map-panel,.map-container,.leaflet-container,.geo-layout,.ltv2-map-frame) {min-width:0;max-width:100%;}
  body.touquet-v23 :is(.table-wrap,.table-responsive,.ag-table-wrap) {max-width:100%;overflow-x:auto;}
  /* Galerie photo : images contenues, colonnes fluides et actions tactiles. */
  body.touquet-v23 .ag-hero {padding:24px var(--m-card)!important;border-radius:18px!important;background:linear-gradient(115deg,#194b41,#0f303c)!important;}
  body.touquet-v23 .ag-grid {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px!important;}
  body.touquet-v23 .ag-item {min-width:0!important;border:1px solid #3e615c!important;border-radius:14px!important;background:var(--lt-surface)!important;overflow:hidden!important;}
  body.touquet-v23 .ag-item img {max-width:100%;object-fit:cover;}
  body.touquet-v23 .ag-filters {margin:18px 0!important;}
}
@media(max-width:370px) {
  body.touquet-v23 {--m-page:12px;--m-card:15px;--m-gap:12px;}
  body.touquet-v23 .mobile-work-card {grid-template-columns:38px minmax(0,1fr) 10px!important;padding:15px!important;gap:11px!important;}
  body.touquet-v23 .mobile-work-icon {width:38px!important;height:38px!important;}
  body.touquet-v23 .mobile-brand b {font-size:13px!important;}
}
/* Mode clair mobile : contraste conservé sur la navigation et les interventions. */
@media(max-width:1000px) {
  :root[data-theme="light"] body.touquet-v23:not(.native-android) {
    --lt-bg:#f2f4ef;--lt-surface:#fffdf8;--lt-raised:#e6efe9;
    --lt-border:#c9dcd3;--lt-ink:#204540;--lt-muted:#607d76;
    --lt-ivory:#234b43;--lt-coast:#2d7560;
  }
  :root[data-theme="light"] body.touquet-v23:not(.native-android) .workspace {background:#f2f4ef!important;}
  :root[data-theme="light"] body.touquet-v23:not(.native-android) :is(.panel,.v9-panel,.filter-panel,.premium-form,.detailblock,.notification-row,.tp-timeline-card) {background:#fffdf8!important;color:#204540!important;}
  :root[data-theme="light"] body.touquet-v23:not(.native-android) :is(.main,.authmain) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range]):not([type=color]):not([type=button]):not([type=submit]),textarea,select) {background:#fffdf8!important;color:#1a443b!important;}
}
