/* THE VOID — Mobile layout correction, 2026-11-20.
   Loaded AFTER all other styles. Presentation only: no database/auth changes. */
@media (max-width: 760px) {
  html, body { width: 100%; max-width: 100%; overflow-x: clip; }
  body { padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
  main, main > section, .section, .account-surface, .account-hub,
  .account-pane, .account-publishing, .account-composer,
  .account-management, .account-role-tools, .account-team-workspace,
  .appearance-workspace, .role-studio, .surface,
  .stack, .event-fields-grid, .event-form, .shop-form-grid,
  .private-profile-form, .release-modal, .event-detail-view,
  .community-grid, .event-grid, .post-feed, .shop-grid,
  #accountPublishing, #accountComposer, #submissionForm, #mySubmissions,
  #releaseContentList, #accountPublishedPostList, #postApprovalList,
  #unifiedPermissionList, #accountRoleTools, #hostEventList,
  #accountMeetingWorkspace, #accountChatPanel, .team-chat,
  .role-studio form, .appearance-workspace form {
    min-width: 0 !important;
    max-width: 100%;
  }
  main { width: 100%; }
  .section { padding-left: 12px; padding-right: 12px; }
  /* Account has several nested panels; avoid wasting mobile width on frames. */
  #account > .account-surface { width: 100%; max-width: 100%; padding: 12px; }
  .account-pane { width: 100%; min-width: 0; }
  #accountComposer, #accountPostApprovalBlock, #releaseContentPanel,
  .account-pane > .surface, .account-role-tools > .surface,
  .role-studio, .appearance-workspace {
    width: 100%; padding: 12px !important; margin-inline: 0;
    border-radius: 13px;
  }
  .account-tabs { width: 100%; max-width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .account-tab { flex: 0 0 auto; white-space: nowrap; }
  #submissionForm, #clubHostEventForm, #armyMeetingForm, #leaderMeetingForm,
  #privateProfileForm, #shopForm, #siteForm, #eventForm, #authForm,
  #coverHomeForm, #coverLoginForm, #coverClubForm,
  .stack { width: 100%; grid-template-columns: minmax(0, 1fr); }
  .event-fields-grid, .shop-form-grid, .form-grid, .two-col,
  .split-section { display: grid; grid-template-columns: minmax(0,1fr) !important; }
  .stack label, .surface label, .auth-card label, .event-fields-grid label,
  .shop-form-grid label { min-width: 0; max-width: 100%; }
  /* Text fields must not escape narrow cards. Leave checkboxes/sliders alone. */
  #account input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  #account textarea, #account select,
  #authDialog input:not([type="checkbox"]):not([type="radio"]),
  .role-studio input:not([type="checkbox"]):not([type="range"]),
  .role-studio textarea, .role-studio select {
    display: block; box-sizing: border-box; width: 100% !important;
    min-width: 0 !important; max-width: 100% !important;
    font-size: 16px; border-radius: 10px;
  }
  input[type="file"] { overflow: hidden; min-width: 0; max-width: 100%;
    font-size: 13px !important; }
  input[type="file"]::file-selector-button { max-width: 100%;
    padding: 10px 12px; border: 1px solid #5d5438; border-radius: 9px;
    background: #292821; color: #fff6dc; margin-right: 9px; }
  /* Rich text editor: readable writing area and horizontally scrolling tools. */
  #submissionForm > div, #submissionToolbar, #submissionEditor { min-width: 0; max-width: 100%; }
  #submissionToolbar.editor-toolbar { display: flex !important; flex-wrap: nowrap !important;
    align-items: center; gap: 7px; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; padding: 9px 6px;
    scrollbar-width: thin; max-width: 100%; }
  #submissionToolbar > * { flex: 0 0 auto; width: auto !important;
    min-width: 40px; max-width: 140px; }
  #submissionToolbar select { flex: 0 0 auto; min-width: 90px !important; }
  #submissionToolbar input[type="color"] { width: 44px !important; height: 42px; padding: 4px; }
  #submissionToolbar button { min-height: 42px; min-width: 42px; padding: 7px; }
  #submissionEditor.rich-editor { width: 100%; box-sizing: border-box;
    min-height: 220px; max-height: 50dvh; overflow: auto;
    overflow-wrap: anywhere; word-break: normal;
    padding: 14px; font-size: 16px; line-height: 1.65;
    -webkit-overflow-scrolling: touch; }
  #submissionEditor img, #submissionEditor video { max-width: 100%; height: auto; }
  #submissionSend, #releasePreviewButton { width: 100%; min-height: 50px; }
  /* Form rows and administrative actions remain tappable. */
  .row-between, .account-profile-head, .button-row { min-width: 0; flex-wrap: wrap; }
  .row-between > *, .button-row > * { min-width: 0; }
  #account .gold-btn, #account .outline-btn, #account button,
  #authDialog button { max-width: 100%; overflow-wrap: anywhere; }
  #account .gold-btn, #account .outline-btn { min-height: 44px; }
  .cms-post, .event-card, .community-card, .shop-card,
  .permission-card, .meeting-card, .location-edit { min-width: 0; max-width: 100%; }
  .cms-body, .event-body, .community-card, .permission-card,
  .meeting-card, .notice-item { overflow-wrap: anywhere; }
  /* Permission matrices may be wider than a phone: scroll inside them, not the whole page. */
  #unifiedPermissionList, #accountPublishedPostList, #releaseContentList,
  #postApprovalList, #releaseArchivedNews { overflow-x: auto;
    -webkit-overflow-scrolling: touch; }
  #account table, #adminDashboard table { display: block; max-width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #account .cover-crop-stage, #coverLoginStage { max-width: 100%; }
  .team-chat-form { display: flex; gap: 7px; min-width: 0; }
  .team-chat-form input { min-width: 0; flex: 1 1 auto; }
  .team-chat-form button { flex: 0 0 auto; }
  dialog { max-width: calc(100vw - 20px); max-height: calc(100dvh - 24px);
    overflow-y: auto; }
  .auth-card, .release-modal { max-width: 100%; }
  .bottom-nav { padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 380px) {
  .section { padding-left: 9px; padding-right: 9px; }
  #account > .account-surface { padding: 9px; }
  #accountComposer, #accountPostApprovalBlock, .account-pane > .surface,
  .role-studio, .appearance-workspace { padding: 10px !important; }
}
