/* Mobile cabinet layout. Loaded only by non-console account pages. */

@media (max-width: 980px) {
  body[data-account-page]:not([data-account-page="console"]) .account-page {
    width: 100% !important;
    max-width: none !important;
    padding: 12px 12px 28px !important;
  }

  body[data-account-page]:not([data-account-page="console"]) .github-layout,
  body[data-account-page]:not([data-account-page="console"]) .bot-console-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  body[data-account-page]:not([data-account-page="console"]) .github-content,
  body[data-account-page]:not([data-account-page="console"]) .account-page-primary,
  body[data-account-page]:not([data-account-page="console"]) .bot-module-content,
  body[data-account-page]:not([data-account-page="console"]) .bot-module-panel,
  body[data-account-page]:not([data-account-page="console"]) .github-card,
  body[data-account-page]:not([data-account-page="console"]) form,
  body[data-account-page]:not([data-account-page="console"]) fieldset {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body[data-account-page]:not([data-account-page="console"]) :is(.page-heading,.card-title,.console-heading,.premium-card-heading,.statistics-header-actions-be3e9b057) {
    min-width: 0;
  }

  /* Bot workspace becomes a top navigation + one content column. */
  body[data-account-page="bots"] .bot-workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body[data-account-page="bots"] .bot-module-sidebar,
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="gamey"] .bot-module-sidebar {
    position: sticky !important;
    top: 6px !important;
    z-index: 80 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 6px !important;
    overflow: hidden !important;
    border-radius: 14px !important;
    backdrop-filter: blur(14px);
  }

  body[data-account-page="bots"] .bot-sidebar-top,
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="gamey"] .bot-sidebar-top {
    display: none !important;
  }

  body[data-account-page="bots"] .bot-module-menu,
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="gamey"] .bot-module-menu[data-bot-menu="gamey"] {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 1px 2px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  body[data-account-page="bots"] .bot-module-menu > button,
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="gamey"] .bot-module-menu[data-bot-menu="gamey"] > button {
    display: grid !important;
    grid-template-columns: 28px auto !important;
    place-items: center start !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    min-height: 44px !important;
    height: auto !important;
    gap: 7px !important;
    padding: 7px 10px !important;
    scroll-snap-align: start;
    box-shadow: none !important;
  }

  body[data-account-page="bots"] .bot-module-menu .module-icon,
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="gamey"] .bot-module-menu[data-bot-menu="gamey"] .module-icon {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
  }

  body[data-account-page="bots"] .bot-module-menu .module-label,
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="gamey"] .bot-module-menu[data-bot-menu="gamey"] .module-label {
    display: block !important;
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 12px !important;
  }

  body[data-account-page="bots"] .general-control-grid {
    grid-template-columns: minmax(0,1fr) !important;
    gap: 12px !important;
  }

  body[data-account-page="bots"] .remove-bot-server-card,
  body[data-account-page="bots"] .bot-install-card {
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* Medium-width cards and editors. */
  body[data-account-page="bots"] :is(
    .music-dashboard-grid,.music-settings-grid,.player-customization-grid,.player-customization-upload-grid,
    .tunetune-routing-grid,.routing-display-grid,.routing-events-grid,.radio-grid,.eq-chart-grid,
    .automod-mute-role-grid,.automod-response-free-grid,.automod-response-premium-grid,
    .log-customization-grid,.log-event-grid,.log-general-grid,.custom-delivery-grid,.cc-grid,.cm510-workspace,
    .welcome-control-grid,.welcome-channel-grid,.welcome-mode-grid,.welcome-color-grid,.welcome-accent-grid,
    .welcome-avatar-border-grid,.welcome-frame-colors-grid,.welcome-native-embed-grid,.welcome-native-embed-advanced-grid,
    .welcome-native-embed-option-grid,.rr-choice-grid,.rr-current-setting-grid,.rr-existing-source-grid-bde5628f76,
    .rr-rules-grid,.shieldy-other-grid,.shieldy-reaction-filter-grid,.shieldy-reaction-range-grid,
    .shieldy-reaction-summary-grid,.shieldy-reaction-toggle-grid,.timer-customization-grid-bd942bbf9,
    .timer-embed-grid-bd942bbf9,.ticket-workspace-fields-b90682276,.ticket-workspace-advanced-b001829e8,
    .game-choice-grid,.gamey-browser-card-list-b6262637c,.gamey-browser-fields-b6262637c,
    .gamey-browser-toggle-grid-b6262637c,.gamey-event-resource-grid-b7c74794f,.gamey-event-reward-grid-b2b0deb35,
    .gamey-event-toggle-grid-b2b0deb35,.gamey-integration-function-grid-bd184909d,.gamey-minigame-grid-b418bfbea,
    .gamey-profile-card-layout-b1dc52e3a,.gamey-economy-toggle-grid-b1dc52e3a,.gamey-economy-toggle-grid-b418bfbea,
    .source-grid-bd1861954,.rss-toggle-grid-bd1861954,.feature-toggle-grid
  ) {
    grid-template-columns: minmax(0,1fr) !important;
  }

  body[data-account-page="profile"] :is(.content-grid,.profile-grid,.joyjoy-experience-row),
  body[data-account-page="security"] .security-grid,
  body[data-account-page="subscriptions"] :is(.subscription-plan-grid-b560c7ed7,.subscription-checkout-grid-b560c7ed7) {
    grid-template-columns: minmax(0,1fr) !important;
  }

  body[data-account-page="subscriptions"] .subscription-bot-switcher-b560c7ed7 {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(190px, 42vw) !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 3px;
  }
  body[data-account-page="subscriptions"] .subscription-bot-option-b560c7ed7 {scroll-snap-align:start}

  /* Wide data remains readable with local horizontal scrolling instead of page overflow. */
  body[data-account-page]:not([data-account-page="console"]) :is(
    .ticket-dashboard-table-b76dc29ea,.gamey-stats-table-wrap-b418bfbea,.subscription-history-list,
    .unified-log-list,.bot-log-list-c9a73e41,.clone-history-list,.shieldy-bulk-roles-history-list-b0c023bb9
  ) {
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  body[data-account-page]:not([data-account-page="console"]) :is(.ticket-dashboard-table-b76dc29ea,.gamey-stats-table-b418bfbea) table,
  body[data-account-page]:not([data-account-page="console"]) table.gamey-stats-table-b418bfbea {
    min-width: 640px;
  }
}

@media (max-width: 720px) {
  body[data-account-page]:not([data-account-page="console"]) .account-page {
    padding: 8px 8px max(22px, env(safe-area-inset-bottom)) !important;
  }

  body[data-account-page]:not([data-account-page="console"]) .account-topbar {
    position: sticky;
    top: 4px;
    z-index: 120;
    min-height: 56px;
    margin-bottom: 10px !important;
    padding: 8px 9px !important;
    gap: 8px !important;
    border-radius: 13px !important;
  }

  body[data-account-page]:not([data-account-page="console"]) .account-brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    gap: 8px !important;
  }
  body[data-account-page]:not([data-account-page="console"]) .account-brand img {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }
  body[data-account-page]:not([data-account-page="console"]) .account-brand-copy {
    display: grid !important;
    min-width: 0 !important;
  }
  body[data-account-page]:not([data-account-page="console"]) .account-brand-copy strong {font-size:17px!important;line-height:1.05}
  body[data-account-page]:not([data-account-page="console"]) .account-brand-copy small {font-size:9px!important;line-height:1.1}

  body[data-account-page]:not([data-account-page="console"]) .topbar-tools {gap:5px!important;min-width:0!important}
  body[data-account-page]:not([data-account-page="console"]) .topbar-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 10px !important;
  }
  body[data-account-page]:not([data-account-page="console"]) .account-user-trigger {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 38px !important;
    padding: 4px !important;
    justify-content: center !important;
  }
  body[data-account-page]:not([data-account-page="console"]) .account-user-chevron {display:none!important}
  body[data-account-page]:not([data-account-page="console"]) .account-user-dropdown {
    position: fixed !important;
    top: 66px !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 78px) !important;
    overflow-y: auto !important;
    z-index: 1000 !important;
  }

  body[data-account-page]:not([data-account-page="console"]) .staff-control-strip {
    display: flex;
    align-items: stretch;
    gap: 7px;
    max-width: 100%;
    padding: 7px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  body[data-account-page]:not([data-account-page="console"]) .staff-control-strip > * {flex:0 0 auto}

  body[data-account-page]:not([data-account-page="console"]) .account-page-primary > .page-heading,
  body[data-account-page]:not([data-account-page="console"]) .page-heading {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    padding: 16px 14px !important;
    border-radius: 15px !important;
  }
  body[data-account-page]:not([data-account-page="console"]) .page-heading h1 {font-size:22px!important;overflow-wrap:anywhere}
  body[data-account-page]:not([data-account-page="console"]) .page-heading p:not(.eyebrow) {font-size:13px;line-height:1.45}
  body[data-account-page]:not([data-account-page="console"]) .status-pill {justify-self:start;margin:0!important}

  body[data-account-page]:not([data-account-page="console"]) .github-card,
  body[data-account-page]:not([data-account-page="console"]) .stat-card {
    padding: 14px !important;
    border-radius: 14px !important;
  }
  body[data-account-page]:not([data-account-page="console"]) .card-title,
  body[data-account-page]:not([data-account-page="console"]) .console-heading,
  body[data-account-page]:not([data-account-page="console"]) .profile-subscriptions-heading,
  body[data-account-page]:not([data-account-page="console"]) .joyjoy-experience-heading,
  body[data-account-page]:not([data-account-page="console"]) .ticket-center-heading-b76dc29ea {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  body[data-account-page]:not([data-account-page="console"]) :is(.primary,.primary-link,.secondary,.secondary-button,.danger-solid,.danger-outline,.inline-button) {
    min-height: 42px;
  }

  /* Profile */
  body[data-account-page="profile"] .profile-subscription-row {
    grid-template-columns: minmax(0,1fr) !important;
    gap: 12px !important;
    padding: 14px !important;
  }
  body[data-account-page="profile"] .profile-subscription-facts {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  body[data-account-page="profile"] .profile-subscription-action,
  body[data-account-page="profile"] .profile-subscriptions-main-action {width:100%!important;justify-content:center!important}
  body[data-account-page="profile"] .joyjoy-experience-row {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 10px !important;
  }
  body[data-account-page="profile"] .joyjoy-experience-row-controls {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  body[data-account-page="profile"] .joyjoy-experience-row-controls :is(select,button,.joyjoy-volume-control) {width:100%!important;max-width:none!important}
  body[data-account-page="profile"] .joyjoy-experience-heading-controls {width:100%;justify-content:space-between!important}
  body[data-account-page="profile"] .joyjoy-experience-actions {display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  body[data-account-page="profile"] .joyjoy-experience-actions .primary {width:100%!important}

  body[data-account-page]:not([data-account-page="console"]) :is(.details-list>div,.readonly-row,.linked-service-row,.security-row,.password-method-row,.security-lolka-row) {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    align-items: start !important;
    gap: 5px !important;
  }
  body[data-account-page]:not([data-account-page="console"]) .details-list dd {text-align:left!important}

  /* Security and promo forms. */
  body[data-account-page="security"] :is(.security-session-actions,.form-actions),
  body[data-account-page="promocode"] .promocode-input-row,
  body[data-account-page="promocode"] .form-actions {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 8px !important;
  }
  body[data-account-page="security"] :is(.security-session-actions,.form-actions) > *,
  body[data-account-page="promocode"] .promocode-input-row > *,
  body[data-account-page="promocode"] .form-actions > * {width:100%!important;max-width:none!important}

  /* Subscription page. */
  body[data-account-page="subscriptions"] .subscription-bot-switcher-b560c7ed7 {
    grid-auto-columns: minmax(180px, 78vw) !important;
  }
  body[data-account-page="subscriptions"] :is(.subscription-current-actions-b560c7ed7,.subscription-current-actions-b99adaf3b,.subscription-extra-actions-b99adaf3b,.subscription-primary-actions-b99adaf3b,.subscription-dialog-actions-bfb423603) {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 8px !important;
  }
  body[data-account-page="subscriptions"] :is(.subscription-current-actions-b560c7ed7,.subscription-current-actions-b99adaf3b,.subscription-extra-actions-b99adaf3b,.subscription-primary-actions-b99adaf3b,.subscription-dialog-actions-bfb423603) > * {width:100%!important}

  /* Bot chooser and common cards. */
  body[data-account-page="bots"] .bot-switcher {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    gap: 5px !important;
    padding: 5px !important;
  }
  body[data-account-page="bots"] .bot-switch-button {
    min-height: 54px !important;
    padding: 7px 5px !important;
    gap: 5px !important;
    border-radius: 11px !important;
  }
  body[data-account-page="bots"] .bot-switch-button img {width:30px!important;height:30px!important;border-radius:9px!important}
  body[data-account-page="bots"] .bot-switch-button span {font-size:11px!important;white-space:nowrap!important}
  body[data-account-page="bots"] .bot-community-outside-b9b0d696a {grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
  body[data-account-page="bots"] .bot-install-card {min-height:0!important;padding:13px!important}
  body[data-account-page="bots"] .bot-install-card .inline-button {width:100%!important}

  body[data-account-page="bots"] :is(.general-control-card,.unified-control-card) {padding:13px!important}
  body[data-account-page="bots"] .managed-server-trigger-be58d3f52 {min-height:46px!important;width:100%!important}
  body[data-account-page="bots"] .managed-server-menu-be58d3f52 {max-width:calc(100vw - 16px)!important}

  body[data-account-page="bots"] :is(.toggle-row,.routing-switch-row,.routing-event-item,.routing-display-item,.shieldy-tool-card-title,.gamey-browser-setting-row-b6262637c) {
    align-items: flex-start !important;
    gap: 10px !important;
  }

  body[data-account-page="bots"] :is(.prefix-control-row,.music-search-row,.music-voice-channel-row,.favorites-add-actions,.queue-footer-actions,.player-upload-actions,.player-customization-actions,.preview-card-actions,.welcome-section-actions,.welcome-upload-actions,.badwords-dictionary-actions,.reaction-role-management-actions,.shieldy-bulk-roles-actions-b0c023bb9,.shieldy-poll-actions,.ticket-auto-setup-actions-b001829e8,.gamey-browser-actions-b6262637c,.gamey-browser-game-actions-b6262637c,.gamey-event-editor-actions-b2b0deb35,.gamey-ai-actions-be13b1ea7,.gamey-stat-actions-b418bfbea) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  body[data-account-page="bots"] :is(.prefix-control-row,.music-search-row,.favorites-add-actions,.queue-footer-actions,.player-upload-actions,.player-customization-actions,.preview-card-actions,.welcome-section-actions,.welcome-upload-actions,.badwords-dictionary-actions,.reaction-role-management-actions,.shieldy-poll-actions,.ticket-auto-setup-actions-b001829e8,.gamey-browser-actions-b6262637c,.gamey-event-editor-actions-b2b0deb35) > :is(button,a,input,select) {
    flex: 1 1 150px !important;
    min-width: 0 !important;
  }

  /* Existing two-button save bars: server full row, buttons next row, state below. */
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672,
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672.has-save-feedback-b341eed40 {
    position: sticky !important;
    bottom: max(6px, env(safe-area-inset-bottom)) !important;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
    grid-template-rows: auto auto auto !important;
    gap: 7px !important;
    min-height: 0 !important;
    padding: 8px !important;
    border-radius: 13px !important;
  }
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672 > .joyjoy-save-server-picker-b04eeb672 {grid-column:1 / -1!important;grid-row:1!important;width:100%!important}
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672 > .primary {grid-column:1!important;grid-row:2!important;width:100%!important;min-width:0!important;min-height:44px!important}
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672 > .discard-unsaved-button {grid-column:2!important;grid-row:2!important;width:100%!important;min-width:0!important;min-height:44px!important}
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672 > :is(.joyjoy-save-feedback-b341eed40,.joyjoy-save-result-b04eeb672,.api-form-message,.prefix-save-status,.panel-save-message,.muted-status) {
    grid-column:1 / -1!important;
    grid-row:3!important;
    justify-self:start!important;
    max-width:100%!important;
    text-align:left!important;
  }

  body[data-account-page="bots"] .sticky-save-bar:not(.joyjoy-save-dock-b04eeb672),
  body[data-account-page="bots"] .form-actions:not(.joyjoy-save-dock-b04eeb672),
  body[data-account-page="bots"] .prefix-card-actions:not(.joyjoy-save-dock-b04eeb672) {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 7px !important;
    max-width: 100% !important;
  }
  body[data-account-page="bots"] .sticky-save-bar:not(.joyjoy-save-dock-b04eeb672) > :is(button,.primary,.discard-unsaved-button),
  body[data-account-page="bots"] .form-actions:not(.joyjoy-save-dock-b04eeb672) > :is(button,.primary,.discard-unsaved-button),
  body[data-account-page="bots"] .prefix-card-actions:not(.joyjoy-save-dock-b04eeb672) > :is(button,.primary,.discard-unsaved-button) {
    flex: 1 1 150px !important;
    min-width: 0 !important;
  }
  body[data-account-page="bots"] .sticky-save-bar:not(.joyjoy-save-dock-b04eeb672) > :is(.api-form-message,.muted-status),
  body[data-account-page="bots"] .form-actions:not(.joyjoy-save-dock-b04eeb672) > :is(.api-form-message,.muted-status) {
    flex: 1 0 100% !important;
    width: 100% !important;
  }

  /* Make form controls respect the viewport without touching switches/ranges. */
  body[data-account-page]:not([data-account-page="console"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea) {
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body[data-account-page]:not([data-account-page="console"]) textarea {resize:vertical}

  /* Dialogs and floating surfaces fit the visual viewport. */
  body[data-account-page]:not([data-account-page="console"]) :is(dialog,.modal,.dialog,.subscription-dialog-bfb423603) {
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 24px) !important;
  }
}

@media (max-width: 480px) {
  body[data-account-page]:not([data-account-page="console"]) .account-brand-copy small {display:none!important}
  body[data-account-page]:not([data-account-page="console"]) .account-brand-copy strong {font-size:16px!important}
  body[data-account-page]:not([data-account-page="console"]) .topbar-icon {width:36px!important;height:36px!important;min-width:36px!important}
  body[data-account-page]:not([data-account-page="console"]) .account-user-trigger {width:38px!important;min-width:38px!important;max-width:38px!important;height:36px!important}

  body[data-account-page]:not([data-account-page="console"]) .github-card,
  body[data-account-page]:not([data-account-page="console"]) .stat-card {padding:12px!important}

  body[data-account-page="profile"] .profile-subscription-facts {grid-template-columns:minmax(0,1fr)!important}
  body[data-account-page="subscriptions"] .subscription-bot-switcher-b560c7ed7 {grid-auto-columns:84vw!important}

  body[data-account-page="bots"] .bot-switch-button {min-height:50px!important;padding:6px 3px!important}
  body[data-account-page="bots"] .bot-switch-button img {width:27px!important;height:27px!important}
  body[data-account-page="bots"] .bot-switch-button span {font-size:10px!important}

  body[data-account-page="bots"] .bot-module-menu > button,
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="gamey"] .bot-module-menu[data-bot-menu="gamey"] > button {
    grid-template-columns: 26px auto !important;
    min-height: 42px !important;
    padding: 6px 9px !important;
  }
  body[data-account-page="bots"] .bot-module-menu .module-icon,
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="gamey"] .bot-module-menu[data-bot-menu="gamey"] .module-icon {
    width:26px!important;min-width:26px!important;height:26px!important;min-height:26px!important
  }

  body[data-account-page="bots"] :is(.stats-grid,.status-grid,.status-grid-secondary-b85fee62f,.ticket-metrics-grid-b76dc29ea,.shieldy-poll-stat-grid,.gamey-profile-card-metrics-b1dc52e3a,.gamey-browser-preview-stats-b6262637c) {
    grid-template-columns: minmax(0,1fr) !important;
  }

  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672,
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672.has-save-feedback-b341eed40 {
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto!important;
  }
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672 > * {grid-column:1!important;width:100%!important;min-width:0!important}
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672 > .joyjoy-save-server-picker-b04eeb672 {grid-row:1!important}
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672 > .primary {grid-row:2!important}
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672 > .discard-unsaved-button {grid-row:3!important}
  body[data-account-page="bots"] .joyjoy-save-dock-b04eeb672 > :is(.joyjoy-save-feedback-b341eed40,.joyjoy-save-result-b04eeb672,.api-form-message,.prefix-save-status,.panel-save-message,.muted-status) {grid-row:4!important}

  body[data-account-page]:not([data-account-page="console"]) :is(.card-title,.console-heading,.profile-subscriptions-heading,.joyjoy-experience-heading) > :is(button,a,.primary,.secondary,.secondary-button) {
    max-width:100%;
  }
}

@media (hover: none) and (pointer: coarse) {
  body[data-account-page]:not([data-account-page="console"]) :is(button,a,input,select,textarea,label) {
    -webkit-tap-highlight-color: transparent;
  }
  body[data-account-page]:not([data-account-page="console"]) button,
  body[data-account-page]:not([data-account-page="console"]) a[role="button"] {
    touch-action: manipulation;
  }
  body[data-account-page="bots"] .bot-module-menu > button:hover,
  body[data-account-page="bots"] .bot-switch-button:hover {transform:none!important}
}

/* Final phone layout hardening for bot pages. This block is presentation-only. */
@media (max-width: 760px) {
  body[data-account-page="bots"] #panel-bot-control,
  body[data-account-page="bots"] #panel-bot-control .bot-workspace,
  body[data-account-page="bots"] #panel-bot-control .bot-module-content,
  body[data-account-page="bots"] #panel-bot-control .bot-module-panel {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Keep all three bot selectors visible on a phone instead of inheriting the old horizontal flex rail. */
  body[data-account-page="bots"] .bot-switcher {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    gap: 6px !important;
    padding: 5px !important;
  }
  body[data-account-page="bots"] .bot-switch-button {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body[data-account-page="bots"] .bot-switch-button span {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* The module rail remains swipeable, but may not enlarge the page itself. */
  body[data-account-page="bots"] .bot-module-sidebar,
  body[data-account-page="bots"] .bot-module-menu {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body[data-account-page="bots"] .bot-module-menu {
    overscroll-behavior-x: contain !important;
  }

  /* Welcome/farewell editor: one real column, no clipped preview or fixed desktop height. */
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome :is(
    #shieldy-welcome-form,
    #shieldy-farewell-form,
    .welcome-event-card,
    .welcome-event-workspace,
    .welcome-dependent,
    .welcome-inline-preview,
    .welcome-preview-card,
    .welcome-subsection,
    .welcome-card-customization,
    .welcome-native-embed-editor,
    .welcome-native-embed-mode-card,
    .welcome-native-embed-advanced-body
  ) {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome :is(
    #shieldy-welcome-form,
    #shieldy-farewell-form
  ).b05cbcf65-welcome-preview-layout,
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome .welcome-event-workspace {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome .welcome-inline-preview {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome :is(
    .welcome-channel-grid,
    .welcome-control-grid,
    .welcome-mode-grid,
    .welcome-color-grid,
    .welcome-accent-grid,
    .welcome-avatar-border-grid,
    .welcome-frame-colors-grid,
    .welcome-native-embed-grid,
    .welcome-native-embed-advanced-grid,
    .welcome-native-embed-option-grid,
    .welcome-native-embed-field-row
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome :is(
    .automod-rule-head,
    .welcome-native-embed-mode-head,
    .welcome-premium-customization-head,
    .welcome-section-actions,
    .welcome-upload-actions
  ) {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome .welcome-event-card > .automod-rule-head {
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 13px !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome .welcome-event-card > .automod-rule-head > div {
    min-width: 0 !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome .welcome-event-card > .automod-rule-head p {
    overflow-wrap: anywhere !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    select,
    textarea
  ) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Shared save dock: server row, two equal actions, feedback below. */
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672,
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672.has-save-feedback-b341eed40 {
    position: sticky !important;
    bottom: max(7px, env(safe-area-inset-bottom)) !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto auto auto !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 14px 0 4px !important;
    padding: 9px !important;
    overflow: visible !important;
    border-radius: 14px !important;
  }
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > .joyjoy-save-server-picker-b04eeb672 {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > .joyjoy-save-server-picker-b04eeb672 .joyjoy-save-server-trigger-b04eeb672 {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 50px !important;
    height: auto !important;
  }
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > .primary,
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > .discard-unsaved-button {
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 46px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 9px 8px !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > .primary {grid-column:1!important}
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > .discard-unsaved-button {grid-column:2!important}
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > :is(
    .joyjoy-save-feedback-b341eed40,
    .joyjoy-save-result-b04eeb672,
    .api-form-message,
    .prefix-save-status,
    .panel-save-message,
    .muted-status
  ) {
    position: static !important;
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 2px 3px !important;
    text-align: left !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  /* Shieldy management dock follows the same visual order on phones. */
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd,
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd.is-workspace-aligned-b8636d10e {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto auto auto !important;
    gap: 8px !important;
    width: calc(100% - 16px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 14px auto 8px !important;
    padding: 9px !important;
    overflow: visible !important;
  }
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd .shieldy-management-dock-server-b553b1fbd {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd .shieldy-management-dock-actions-b553b1fbd {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd .shieldy-management-dock-actions-b553b1fbd button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 46px !important;
    white-space: normal !important;
  }
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd .shieldy-management-dock-state-b553b1fbd {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 2px 3px !important;
    text-align: left !important;
    justify-content: flex-start !important;
  }
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd .shieldy-management-dock-state-b553b1fbd span {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 520px) {
  /* On very narrow phones, message cards use all available width rather than keeping desktop avatar indentation. */
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome .shieldy-direct-message-preview-b53abbb03 :is(
    .shieldy-preview-plain-text,
    .welcome-mention-preview,
    [data-preview-primary-card-slot],
    [data-preview-secondary-card-slot]
  ) {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome .welcome-native-embed-copy-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body[data-account-page="bots"] #panel-bot-control[data-active-bot="shieldy"] #sh-interaction-view-welcome .welcome-native-embed-thumbnail {
    justify-self: start !important;
  }
}

@media (max-width: 340px) {
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672,
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672.has-save-feedback-b341eed40,
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd,
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd.is-workspace-aligned-b8636d10e {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > .primary {grid-column:1!important;grid-row:2!important}
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > .discard-unsaved-button {grid-column:1!important;grid-row:3!important}
  body[data-account-page="bots"] #panel-bot-control .joyjoy-save-dock-b04eeb672 > :is(
    .joyjoy-save-feedback-b341eed40,.joyjoy-save-result-b04eeb672,.api-form-message,.prefix-save-status,.panel-save-message,.muted-status
  ) {grid-column:1!important;grid-row:4!important}
  body[data-account-page="bots"] .shieldy-management-dock-b553b1fbd .shieldy-management-dock-actions-b553b1fbd {
    grid-template-columns:minmax(0,1fr)!important;
  }
}
