/* CLC V399 — On small screens, float buttons must never cover inputs, submits or galleries.
   The existing accessibility/chat widgets are kept intact and moved into normal flow by JS.
   Does not touch content access, event data, CSP, or desktop behavior. */
@media (max-width: 600px) {
  body > footer {
    margin-bottom: 0 !important; /* V398 reserved space for old fixed widgets */
  }
  body > .clc-v399-mobile-tools {
    position: relative !important;
    isolation: isolate;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 10px;
    width: calc(100% - 24px);
    max-width: 440px;
    min-width: 0;
    padding: 12px 10px max(15px,env(safe-area-inset-bottom,0px));
    margin: 0 auto 10px;
    border: 1px solid #72583b;
    border-radius: 12px;
    background: #151616;
    box-sizing: border-box;
    z-index: 2;
  }
  body > .clc-v399-mobile-tools > .clc-v399-inline-widget,
  body > .clc-v399-mobile-tools > .clc-v399-inline-widget.clc-mc {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    float: none !important;
    flex: 1 1 120px !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  body > .clc-v399-mobile-tools > .clc-v399-inline-widget:is(button,a,[role=button]),
  body > .clc-v399-mobile-tools > .clc-v399-inline-widget > :is(button,a,[role=button]),
  body > .clc-v399-mobile-tools #clc-mc-launch {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    margin: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    z-index: auto !important;
  }
  /* Chat may still open as a deliberate modal; only the launcher remains in document flow. */
  body > .clc-v399-mobile-tools #clc-mc-panel:not([hidden]) {
    position: fixed !important;
    top: auto !important;
    left: 10px !important;
    right: 10px !important;
    bottom: max(10px, env(safe-area-inset-bottom,0px)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 20px) !important;
    box-sizing: border-box !important;
    overflow: auto !important;
    z-index: 10100 !important;
  }
  body > .clc-v399-mobile-tools #clc-mc-panel[hidden] {display:none !important;}
}
