/* Shared mobile window controls. The panel's content scrolls below this row. */
@media (max-width: 768px) {
  .mobile-window-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 74px;
    align-items: center;
    flex: 0 0 44px;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
    padding: 3px 8px;
    border-bottom: 1px solid rgba(162,162,162, .22);
    border-radius: 14px 14px 0 0;
    background: #fff !important;
    color: #242424;
    font-family: var(--font-firago), sans-serif;
  }
  .mobile-window-bar-title {
    position: absolute;
    top: 50%;
    right: 74px;
    left: 74px;
    transform: translateY(-50%);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #404040;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    max-height: 32px;
    text-align: center;
    overflow-wrap: anywhere;
  }
  .mobile-window-bar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 8px;
    border: 0;
    border-radius: 12px;
    background: #f4f4f4;
    color: #404040;
    cursor: pointer;
    font: 500 12px var(--font-firago), sans-serif;
  }
  .mobile-window-bar button:focus-visible { outline: 2px solid var(--palette-ink,#292928); outline-offset: 2px; }
  .mobile-window-bar-back { grid-column: 1; justify-self: start; gap: 3px; }
  .mobile-window-bar-back[hidden] { visibility: hidden; display: inline-flex; }
  .mobile-window-bar-back span:first-child { font: 23px/1 Arial, sans-serif; }
  :is(#auth-modal, .mobile-window-has-bar).mobile-window-has-bar .mobile-window-bar-close {
    grid-column: 3;
    justify-self: end;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: #f4f4f4 !important;
    color: #404040 !important;
    font: 22px/1 Arial, sans-serif !important;
  }
  :is(#auth-modal, .mobile-window-has-bar).mobile-window-has-bar .mobile-window-original-close,
  :is(#auth-modal, .mobile-window-has-bar).mobile-window-has-bar .mobile-window-original-back,
  :is(#auth-modal, .mobile-window-has-bar).mobile-window-has-bar .mobile-window-source-header { display: none !important; }
  #auth-modal.mobile-window-has-bar .mobile-auth-shared-head { display: none !important; }
  #auth-modal.mobile-window-has-bar > .scanner-modal-content {
    padding: 0 !important;
    overflow: hidden !important;
  }
  #auth-modal.mobile-window-has-bar > .scanner-modal-content > .mobile-window-bar {
    position: relative;
    padding-right: 18px;
    padding-left: 18px;
  }
  #auth-modal.mobile-window-has-bar #drawer-view-auth {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 12px 18px 18px !important;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
  }
  #chat-list-modal.mobile-window-has-bar > .scanner-modal-content,
  #barrier-report-modal.mobile-window-has-bar > .scanner-modal-content,
  #mobile-missions-modal.mobile-window-has-bar > .mobile-missions-panel {
    padding-top: 0 !important;
  }
  #mobile-missions-modal.mobile-window-has-bar > .mobile-missions-panel { gap: 0 !important; }
  #mobile-missions-modal .mobile-missions-body { padding-top: 10px; }
  #mobile-missions-modal .cabinet-subfilter-nav {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    gap: 8px !important;
  }
  #mobile-missions-modal .cabinet-subfilter-nav button {
    flex: 0 0 auto !important;
    width: max-content !important;
    min-width: max-content !important;
    white-space: nowrap !important;
  }
  #reviews-list-modal > .vr-mobile-topbar,
  #place-details-overlay .place-details-top,
  #ai-chat-panel.mobile-ai-shared > .ai-chat-header {
    flex-shrink: 0;
    min-height: 44px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(162,162,162, .22);
    background: #fff;
  }
  #place-details-overlay .place-details-back,
  #place-details-overlay .place-details-close,
  #ai-chat-panel.mobile-ai-shared .ai-chat-close {
    min-height: 36px;
  }
  #reviews-list-modal .vr-mobile-topbar .scanner-close,
  #place-details-overlay .place-details-close,
  #ai-chat-panel.mobile-ai-shared .ai-chat-close {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    background: #f4f4f4 !important;
    color: #404040 !important;
    font-size: 22px !important;
  }
  body.dark-theme .mobile-window-bar {
    background: #1e1e1e !important;
    border-bottom-color: #424242;
    color: #f4f4f4;
  }
  body.dark-theme .mobile-window-bar-title { color: #e9e9e9; }
  body.dark-theme .mobile-window-bar button { background: #424242; color: #f4f4f4; }
  body.dark-theme #reviews-list-modal > .vr-mobile-topbar,
  body.dark-theme #place-details-overlay .place-details-top,
  body.dark-theme #ai-chat-panel.mobile-ai-shared > .ai-chat-header {
    background: #1e1e1e;
    border-bottom-color: #424242;
  }
}
@media (max-width: 768px) {
  #ai-chat-panel #drawer-view-assistant > .mobile-window-bar { display: none !important; }
}
@media (min-width: 769px) { .mobile-window-bar { display: none !important; } }
