/* V204 — couche responsive finale, chargée après tous les anciens styles. */
html { max-width: 100%; overflow-x: clip; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body { max-width: 100%; overflow-x: clip; }
html body *, html body *::before, html body *::after { box-sizing: border-box; }
html body img, html body svg, html body video, html body canvas, html body iframe { max-width: 100%; height: auto; }
html body input, html body select, html body textarea { max-width: 100%; }
.lca-site-shell, .lca-header-inner, .lca-member-shell, .lca-member-content, .lca-member-main,
.lca-profile-page, .lca-account-panel, .lca-member-card, .lca-forum-main { min-width: 0; }
.lca-member-card, .lca-v193-settings-card, .lca-account-space, .lca-forum-main { overflow-wrap: anywhere; }

@media (max-width: 1180px) {
  html body .lca-header-inner, html body .lca-site-shell { width: 100% !important; max-width: 100% !important; padding-inline: clamp(14px, 3vw, 28px) !important; }
  html body .lca-main-nav { display: none !important; }
  html body .lca-menu-toggle-v179 { display: inline-flex !important; align-items: center; justify-content: center; }
  html body .lca-member-shell, html body .lca-member-layout, html body .lca-profile-layout,
  html body .lca-forum-grid { grid-template-columns: minmax(0, 1fr) !important; width: 100% !important; }
  html body .lca-member-sidebar:not(.lca-member-topnav) { position: static !important; width: 100% !important; max-width: none !important; }
  html body .lca-member-topnav, html body .lca-member-header-subnav { width: 100% !important; max-width: 100% !important; overflow: hidden !important; }
  html body .lca-member-nav-list, html body .lca-member-header-subnav-scroll {
    display: flex !important; flex-wrap: nowrap !important; gap: 8px !important; overflow-x: auto !important;
    overscroll-behavior-inline: contain; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  html body .lca-member-nav-list::-webkit-scrollbar, html body .lca-member-header-subnav-scroll::-webkit-scrollbar { display: none; }
  html body .lca-member-nav-item, html body .lca-member-header-subnav a { flex: 0 0 auto !important; white-space: nowrap !important; scroll-snap-align: start; }
  html body .lca-v193-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body .lca-v193-settings-card { width: auto !important; min-width: 0 !important; }
  html body .lca-forum-side { position: static !important; width: 100% !important; }
}

@media (max-width: 920px) {
  html body { --lca-mobile-gutter: clamp(12px, 3.5vw, 22px); }
  html body .lca-topbar-inner, html body .lca-header-inner, html body .lca-site-shell,
  html body .lca-member-content, html body .lca-member-main, html body .lca-profile-page {
    width: 100% !important; max-width: 100% !important; padding-inline: var(--lca-mobile-gutter) !important;
  }
  html body .lca-header-inner { min-height: 64px !important; gap: 10px !important; }
  html body .lca-site-logo img, html body .lca-header-logo img { max-height: 48px !important; width: auto !important; }
  html body .lca-menu-toggle-v179, html body .lca-modal-close, html body .lca-search-close,
  html body .lca-notifications-close { min-width: 44px !important; min-height: 44px !important; }

  html body .lca-mobile-drawer-v179 { align-items: flex-end !important; padding: 0 !important; }
  html body .lca-mobile-drawer-card-v179 {
    width: 100% !important; max-width: none !important; max-height: 100dvh !important; overflow-y: auto !important;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-radius: 24px 24px 0 0 !important;
    padding: 18px var(--lca-mobile-gutter) calc(18px + env(safe-area-inset-bottom)) !important;
  }
  html body .lca-mobile-drawer-grid-v179 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  html body .lca-mobile-drawer-grid-v179 a, html body .lca-mobile-drawer-grid-v179 button { min-height: 48px !important; }

  html body .lca-auth-overlay, html body .lca-search-overlay, html body .lca-notifications-panel {
    position: fixed !important; inset: 0 !important; width: 100% !important; height: 100dvh !important;
    align-items: center !important; justify-content: center !important; padding: max(10px, env(safe-area-inset-top)) var(--lca-mobile-gutter) max(10px, env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
  }
  html body .lca-auth-box, html body .lca-search-box, html body .lca-notifications-box {
    width: 100% !important; max-width: 680px !important; max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    margin: 0 !important; padding: clamp(18px, 4vw, 28px) !important;
  }
  html body .lca-live-search-form, html body .lca-notif-actions, html body .lca-account-actions,
  html body .lca-v186-account-head { flex-wrap: wrap !important; }
  html body .lca-live-search-form input { min-width: 0 !important; flex: 1 1 180px !important; }
  html body .lca-live-results { max-height: 52dvh !important; overflow-y: auto !important; }

  html body .lca-v193-settings-grid, html body .lca-member-field-grid, html body .lca-v193-color-fields,
  html body .lca-v193-cross-grid, html body .lca-account-space-grid, html body .lca-2fa-enroll,
  html body .lca-security-sessions, html body .lca-profile-grid, html body .lca-directory-grid,
  html body .lca-calendar-grid { grid-template-columns: minmax(0, 1fr) !important; }
  html body .lca-v193-settings-card, html body .lca-member-card { padding: clamp(16px, 3.8vw, 24px) !important; }
  html body .lca-v186-account-head { align-items: flex-start !important; gap: 12px !important; }
  html body .lca-v186-settings-save { min-height: 48px !important; }
  html body .lca-2fa-qr { display: block !important; width: min(230px, 100%) !important; height: auto !important; margin-inline: auto !important; }
  html body .lca-2fa-recovery { overflow-wrap: anywhere !important; user-select: all; }
  html body .lca-security-session-status { white-space: normal !important; }

  html body .lca-profile-header, html body .lca-account-id { flex-wrap: wrap !important; align-items: flex-start !important; }
  html body .lca-profile-avatar, html body .lca-account-avatar { flex: 0 0 auto !important; }
  html body .lca-forum-topic-row, html body .lca-forum-post { grid-template-columns: minmax(0, 1fr) !important; }
  html body .lca-forum-topic-row > *, html body .lca-forum-post > * { min-width: 0 !important; }
  html body .lca-member-content table, html body .lca-profile-page table, html body .lca-forum-main table {
    display: block !important; width: 100% !important; max-width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch;
  }

  html body .lca-chat-widget { right: var(--lca-mobile-gutter) !important; bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
  html body .lca-chat-panel { width: calc(100vw - (2 * var(--lca-mobile-gutter))) !important; max-width: 460px !important; max-height: min(78dvh, 680px) !important; }
}

@media (max-width: 600px) {
  html body h1 { font-size: clamp(1.65rem, 8vw, 2.25rem) !important; line-height: 1.08 !important; }
  html body h2 { font-size: clamp(1.3rem, 6.2vw, 1.75rem) !important; line-height: 1.15 !important; }
  html body input:not([type="checkbox"]):not([type="radio"]), html body select, html body textarea {
    width: 100% !important; min-height: 48px !important; font-size: 16px !important;
  }
  html body textarea { min-height: 120px !important; }
  html body .lca-auth-overlay, html body .lca-search-overlay, html body .lca-notifications-panel { align-items: flex-end !important; padding: 0 !important; }
  html body .lca-auth-box, html body .lca-search-box, html body .lca-notifications-box {
    max-width: none !important; max-height: 100dvh !important; border-radius: 24px 24px 0 0 !important;
    padding: max(18px, env(safe-area-inset-top)) var(--lca-mobile-gutter) calc(20px + env(safe-area-inset-bottom)) !important;
  }
  html body .lca-auth-tabs { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  html body .lca-auth-tabs > :nth-child(3) { grid-column: 1 / -1; }
  html body .lca-auth-tabs button, html body .lca-auth-tabs a { min-height: 44px !important; white-space: normal !important; }
  html body .lca-auth-form button[type="submit"], html body .lca-v186-settings-save,
  html body .lca-account-actions > *, html body .lca-notif-actions > *, html body .lca-2fa-settings button {
    width: 100% !important; justify-content: center !important; min-height: 48px !important;
  }
  html body .lca-account-space-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body .lca-v193-color-presets, html body .lca-v193-cross-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body .lca-member-topnav, html body .lca-member-header-subnav-inner { padding-inline: var(--lca-mobile-gutter) !important; }
  html body .lca-member-nav-item, html body .lca-member-header-subnav a { min-height: 44px !important; display: inline-flex !important; align-items: center !important; }
  html body .lca-profile-header { text-align: center !important; justify-content: center !important; }
  html body .lca-profile-header > * { max-width: 100% !important; }
  html body .lca-profile-actions { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; width: 100% !important; }
  html body .lca-profile-actions > * { width: 100% !important; min-height: 46px !important; }
  html body .lca-mobile-drawer-grid-v179 { grid-template-columns: minmax(0, 1fr) !important; }
  html body .lca-chat-widget { left: var(--lca-mobile-gutter) !important; right: var(--lca-mobile-gutter) !important; }
  html body .lca-chat-panel { width: 100% !important; max-width: none !important; }
}

@media (max-width: 380px) {
  html body { --lca-mobile-gutter: 10px; }
  html body .lca-account-space-grid, html body .lca-v193-color-presets, html body .lca-v193-cross-grid { grid-template-columns: minmax(0, 1fr) !important; }
  html body .lca-auth-tabs { grid-template-columns: minmax(0, 1fr) !important; }
  html body .lca-auth-tabs > :nth-child(3) { grid-column: auto; }
}

@media (pointer: coarse) {
  html body a.lca-btn, html body button, html body [role="button"], html body .lca-member-nav-item { min-height: 44px; }
}

@media (max-height: 540px) and (orientation: landscape) {
  html body .lca-auth-overlay, html body .lca-search-overlay, html body .lca-notifications-panel { align-items: stretch !important; }
  html body .lca-auth-box, html body .lca-search-box, html body .lca-notifications-box,
  html body .lca-mobile-drawer-card-v179 { max-height: 100dvh !important; border-radius: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  html body *, html body *::before, html body *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
