/* ===== Stage 9 preserved source: assets/css/account-mobile-foundation-v2.css ===== */
/*
 * TuneTune / JoyJoy Cabinet — Mobile Foundation V2
 * Stage 2: additive mobile layout hardening.
 *
 * Safety contract:
 * - CSS only; no API/WebSocket/auth logic.
 * - Loaded last on active account pages.
 * - Existing DOM ids/classes/data-* remain unchanged.
 * - Desktop >= 981px is intentionally left untouched.
 */

@media (max-width: 980px) {
  html {
    min-width: 0;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body[data-account-page] {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
    overscroll-behavior-x: none;
  }

  body[data-account-page] .account-page,
  body[data-account-page] .account-page-primary,
  body[data-account-page] .github-layout,
  body[data-account-page] .github-content,
  body[data-account-page] .bot-console-layout,
  body[data-account-page] .bot-workspace,
  body[data-account-page] .bot-module-content,
  body[data-account-page] .bot-module-panel,
  body[data-account-page] .github-card,
  body[data-account-page] .console-card,
  body[data-account-page] .stat-card,
  body[data-account-page] main,
  body[data-account-page] section,
  body[data-account-page] form,
  body[data-account-page] fieldset {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  body[data-account-page] :is(
    h1,h2,h3,h4,h5,h6,p,span,label,strong,small,
    .page-heading,.card-title,.console-heading,.eyebrow,
    .account-brand-copy,.module-label,.account-menu-text
  ) {
    min-width: 0;
  }

  body[data-account-page] :is(
    img,video,canvas,iframe
  ) {
    max-width: 100%;
  }

  body[data-account-page] :is(
    pre,.code-block,.json-preview,.log-output,.console-output
  ) {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  body[data-account-page] :is(
    .admin-table-wrap,
    .admin-premium-table-wrap-b2bb5ff2d,
    .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%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  body[data-account-page] :is(
    .admin-table-wrap,
    .admin-premium-table-wrap-b2bb5ff2d,
    .ticket-dashboard-table-b76dc29ea,
    .gamey-stats-table-wrap-b418bfbea
  ) > table,
  body[data-account-page] table.admin-table,
  body[data-account-page] table.gamey-stats-table-b418bfbea {
    width: max-content;
    min-width: 640px;
    max-width: none;
  }
}

@media (max-width: 820px) {
  body[data-account-page] {
    --mobile-edge: max(10px, env(safe-area-inset-left));
    --mobile-edge-right: max(10px, env(safe-area-inset-right));
    --mobile-bottom: max(10px, env(safe-area-inset-bottom));
    --mobile-top: max(4px, env(safe-area-inset-top));
  }

  body[data-account-page] .account-page {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-left: var(--mobile-edge);
    padding-right: var(--mobile-edge-right);
    padding-bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  }

  body[data-account-page] .account-topbar {
    position: sticky;
    top: var(--mobile-top);
    z-index: 600;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    isolation: isolate;
  }

  body[data-account-page] .account-brand,
  body[data-account-page] .topbar-tools,
  body[data-account-page] .account-user-menu {
    min-width: 0;
  }

  body[data-account-page] .account-brand {
    flex: 1 1 auto;
    overflow: hidden;
  }

  body[data-account-page] .account-brand-copy {
    overflow: hidden;
  }

  body[data-account-page] .account-brand-copy :is(strong,small) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-account-page] .account-user-dropdown {
    max-width: calc(100vw - var(--mobile-edge) - var(--mobile-edge-right));
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 82px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Horizontal navigation remains usable instead of compressing text. */
  body[data-account-page] :is(
    .profile-center-nav,
    .subscription-jump-nav-b99adaf3b,
    .subscription-bot-switcher-b560c7ed7,
    .music-tabs,
    .automod-message-tabs,
    .ticket-center-tabs-b76dc29ea,
    .rr-preview-tabs,
    .shieldy-interaction-tabs,
    .cm510-channel-tabs,
    .gamey-games-tabs-b0c49efd0,
    .gamey-games-tabs-b33ba4c5a,
    .admin-bot-tabs-b1a8139d2,
    .custom-workspace-tabs
  ) {
    display: flex;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
  }

  body[data-account-page] :is(
    .profile-center-tab,
    .subscription-bot-option-b560c7ed7,
    .automod-message-tab,
    .shieldy-interaction-tab,
    .custom-workspace-tab
  ) {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  /* Bot module sidebar becomes a predictable horizontal rail. */
  body[data-account-page="bots"] .bot-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-account-page="bots"] .bot-module-sidebar {
    position: sticky;
    top: calc(var(--mobile-top) + 64px);
    z-index: 520;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  body[data-account-page="bots"] .bot-module-menu {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
  }

  body[data-account-page="bots"] .bot-module-menu > button {
    flex: 0 0 auto;
    min-height: 44px;
    scroll-snap-align: start;
  }

  /* Forms: keep a single readable column on phones/tablets. */
  body[data-account-page] :is(
    .two-fields,
    .console-fields,
    .content-grid,
    .profile-grid,
    .security-grid,
    .admin-form-grid,
    .feature-toggle-grid,
    .music-dashboard-grid,
    .music-settings-grid,
    .player-customization-grid,
    .tunetune-routing-grid,
    .welcome-control-grid,
    .welcome-channel-grid,
    .welcome-mode-grid,
    .welcome-color-grid,
    .rr-choice-grid,
    .rr-rules-grid,
    .shieldy-other-grid,
    .game-choice-grid,
    .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,
    .source-grid-bd1861954,
    .rss-toggle-grid-bd1861954
  ) {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  body[data-account-page] :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea
  ) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Prevent iOS focus zoom without changing desktop typography. */
  body[data-account-page] :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea
  ) {
    font-size: max(16px, 1em);
  }

  /* Core interactive targets. */
  body[data-account-page] :is(
    button,
    [role="button"],
    [role="tab"],
    .topbar-icon,
    .account-user-trigger,
    a.primary,
    a.secondary,
    button.primary,
    button.secondary,
    .compact-button,
    .primary-button,
    .secondary-button,
    .text-button,
    .profile-center-tab,
    .subscription-bot-option-b560c7ed7
  ) {
    min-height: 44px;
  }

  body[data-account-page] :is(
    .topbar-icon,
    .account-user-trigger,
    .subscription-dialog-close-bfb423603
  ) {
    min-width: 44px;
  }

  /* Fixed/sticky save actions must respect the phone safe area. */
  body[data-account-page] :is(
    .sticky-save-bar,
    .general-settings-save-bar-be3e9b057,
    .universal-save-bar-b42a7df9b,
    .equalizer-save-bar-b42a7df9b,
    .journal-save-bar-b8b0485e3,
    .tunetune-player-savebar-v702,
    .tunetune-music-unified-save-b79469c02,
    .welcome-save-bar,
    .cc-savebar,
    .cm510-savebar,
    .shieldy-server-save-bar,
    .ticket-center-savebar-b76dc29ea,
    .gamey-b418bfbea-save-bar,
    .gamey-events-savebar-b2b0deb35,
    .gamey-rss-save-bar-bd1861954,
    .gamey-streamer-savebar-c2f9a76d4
  ) {
    left: var(--mobile-edge);
    right: var(--mobile-edge-right);
    bottom: var(--mobile-bottom);
    width: auto;
    max-width: calc(100vw - var(--mobile-edge) - var(--mobile-edge-right));
    min-width: 0;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 8px;
  }

  body[data-account-page] :is(
    .ttcb-server-dock,
    .shieldy-custom-bot-server-dock,
    .gamey-custom-bot-server-dock
  ) {
    max-width: calc(100vw - var(--mobile-edge) - var(--mobile-edge-right));
    box-sizing: border-box;
  }

  body[data-account-page] :is(
    [role="dialog"],
    .subscription-dialog-bfb423603,
    .subscription-dialog-compact-b9c42816b,
    .timer-datepicker-popover
  ) {
    max-width: calc(100vw - var(--mobile-edge) - var(--mobile-edge-right));
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body[data-account-page] :is(
    .subscription-dialog-actions-bfb423603,
    .queue-footer-actions,
    .bot-log-footer-c9a73e41,
    .admin-announcement-footer-b394850fe,
    .player-preview-footer,
    .welcome-preview-footer,
    .log-preview-footer,
    .rr-preview-footer,
    .shieldy-community-preview-footer
  ) {
    flex-wrap: wrap;
    min-width: 0;
    gap: 8px;
  }

  body[data-account-page] :is(
    .field,
    .toggle-row,
    .normalized-switch,
    .console-heading,
    .card-title,
    .page-heading,
    .bot-log-toolbar-c9a73e41,
    .gamey-inventory-toolbar-bc8b09e88,
    .shieldy-info-toolbar,
    .shieldy-reaction-toolbar
  ) {
    min-width: 0;
  }

  body[data-account-page] :is(
    .field,
    .card-title,
    .console-heading,
    .page-heading,
    .toggle-row
  ) {
    overflow-wrap: anywhere;
  }

  body[data-account-page] :is(
    .site-footer__compact-main,
    .site-footer__compact-nav
  ) {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  body[data-account-page] {
    --mobile-edge: max(8px, env(safe-area-inset-left));
    --mobile-edge-right: max(8px, env(safe-area-inset-right));
  }

  body[data-account-page] .account-page {
    padding-top: max(6px, env(safe-area-inset-top));
  }

  body[data-account-page] .account-topbar {
    min-height: 56px;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 13px;
  }

  body[data-account-page] .account-brand img {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  body[data-account-page] .account-brand-copy small {
    display: none;
  }

  body[data-account-page] .topbar-tools {
    gap: 4px;
  }

  body[data-account-page] .account-user-dropdown {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 66px);
    left: var(--mobile-edge);
    right: var(--mobile-edge-right);
    width: auto;
  }

  body[data-account-page] .page-heading {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page] .page-heading h1 {
    font-size: clamp(20px, 6.5vw, 25px);
    line-height: 1.12;
  }

  body[data-account-page] :is(
    .github-card,
    .console-card,
    .stat-card
  ) {
    max-width: 100%;
    min-width: 0;
    padding-left: max(12px, min(4vw, 16px));
    padding-right: max(12px, min(4vw, 16px));
    box-sizing: border-box;
  }

  body[data-account-page] :is(
    .profile-center-nav,
    .subscription-jump-nav-b99adaf3b,
    .subscription-bot-switcher-b560c7ed7
  ) {
    scroll-padding-inline: 4px;
  }

  body[data-account-page] .subscription-bot-switcher-b560c7ed7 > * {
    flex: 0 0 min(82vw, 320px);
  }

  body[data-account-page] .profile-center-tab {
    min-width: max-content;
  }

  body[data-account-page="bots"] .bot-module-sidebar {
    top: calc(var(--mobile-top) + 60px);
  }

  body[data-account-page="bots"] .bot-module-menu > button {
    min-width: max-content;
  }

  body[data-account-page] :is(
    .subscription-dialog-actions-bfb423603,
    .queue-footer-actions
  ) > :is(button,a) {
    flex: 1 1 140px;
  }

  body[data-account-page] :is(
    .sticky-save-bar,
    .general-settings-save-bar-be3e9b057,
    .universal-save-bar-b42a7df9b,
    .equalizer-save-bar-b42a7df9b,
    .journal-save-bar-b8b0485e3,
    .tunetune-player-savebar-v702,
    .tunetune-music-unified-save-b79469c02,
    .welcome-save-bar,
    .cc-savebar,
    .cm510-savebar,
    .shieldy-server-save-bar,
    .ticket-center-savebar-b76dc29ea,
    .gamey-b418bfbea-save-bar,
    .gamey-events-savebar-b2b0deb35,
    .gamey-rss-save-bar-bd1861954,
    .gamey-streamer-savebar-c2f9a76d4
  ) > :is(button,a) {
    min-width: 0;
    flex: 1 1 132px;
  }

  body[data-account-page] :is(
    .admin-table-wrap,
    .admin-premium-table-wrap-b2bb5ff2d,
    .ticket-dashboard-table-b76dc29ea,
    .gamey-stats-table-wrap-b418bfbea
  ) {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 380px) {
  body[data-account-page] .account-brand-copy strong {
    font-size: 15px;
  }

  body[data-account-page] .account-topbar {
    padding-left: 6px;
    padding-right: 6px;
  }

  body[data-account-page] :is(
    .topbar-icon,
    .account-user-trigger
  ) {
    width: 44px;
    max-width: 44px;
    padding-left: 4px;
    padding-right: 4px;
  }

  body[data-account-page] .page-heading {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Accessibility / motion safety. */
@media (prefers-reduced-motion: reduce) {
  body[data-account-page] *,
  body[data-account-page] *::before,
  body[data-account-page] *::after {
    scroll-behavior: auto !important;
  }
}

/* ===== Stage 9 preserved source: assets/css/account-mobile-components-v3.css ===== */
/*
 * TuneTune / JoyJoy Cabinet — Mobile Components V3
 * Stage 3: additive common-component hardening.
 * Network/runtime contract: CSS only. No API/WebSocket/auth behavior.
 */

@media (max-width: 820px) {
  body[data-account-page] {
    --mobile-control-h: 44px;
    --mobile-control-radius: 10px;
    --mobile-control-gap: 8px;
  }

  /* Top bar: reliable thumb-sized controls without changing actions. */
  body[data-account-page] .account-brand {
    min-height: var(--mobile-control-h) !important;
    display: flex !important;
    align-items: center !important;
  }

  body[data-account-page] :is(.topbar-icon, .account-user-trigger) {
    width: var(--mobile-control-h) !important;
    min-width: var(--mobile-control-h) !important;
    height: var(--mobile-control-h) !important;
    min-height: var(--mobile-control-h) !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    flex: 0 0 var(--mobile-control-h) !important;
    touch-action: manipulation;
  }

  body[data-account-page] .account-user-dropdown [role="menuitem"] {
    min-height: var(--mobile-control-h) !important;
    padding-block: 10px !important;
    align-items: center !important;
  }

  /* Shared action controls. The list is intentionally explicit. */
  body[data-account-page] :is(
    button.primary,
    button.secondary,
    a.primary,
    a.secondary,
    .primary-button,
    .secondary-button,
    .compact-button,
    .inline-button,
    .danger-solid,
    .danger-outline,
    .service-action,
    .discard-unsaved-button,
    .prefix-save-button,
    .statistics-refresh-button-be3e9b057,
    .subscription-cancel-button,
    .profile-subscriptions-main-action,
    .profile-subscription-action,
    .player-media-default,
    .equalizer-reset-button
  ) {
    min-height: var(--mobile-control-h) !important;
    height: auto !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px;
    line-height: 1.2 !important;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    touch-action: manipulation;
  }

  body[data-account-page] .profile-edit-icon {
    width: var(--mobile-control-h) !important;
    height: var(--mobile-control-h) !important;
    min-width: var(--mobile-control-h) !important;
    min-height: var(--mobile-control-h) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Inputs keep their existing visuals but get a consistent hit area. */
  body[data-account-page] :is(
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
    select
  ) {
    min-height: var(--mobile-control-h) !important;
    height: auto !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    line-height: 1.3 !important;
  }

  body[data-account-page] textarea {
    min-height: 92px !important;
    height: auto;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    line-height: 1.4 !important;
  }

  /* Standard toggle: 30px visual switch inside a 44px tap target. */
  body[data-account-page] .normalized-switch {
    position: relative !important;
    width: 52px !important;
    min-width: 52px !important;
    height: var(--mobile-control-h) !important;
    min-height: var(--mobile-control-h) !important;
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 52px !important;
  }

  body[data-account-page] .normalized-switch > input[type="checkbox"] {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
  }

  body[data-account-page] .normalized-switch > i {
    top: 7px !important;
    bottom: 7px !important;
    left: 0 !important;
    right: 0 !important;
  }

  /* Plain consent checkboxes retain native semantics and get a larger target. */
  body[data-account-page] :is(
    .checkout-terms,
    .subscription-autorenew-b560c7ed7
  ) {
    min-height: var(--mobile-control-h) !important;
    padding-block: 8px !important;
    gap: 10px !important;
    align-items: flex-start !important;
    cursor: pointer;
  }

  body[data-account-page] :is(
    .checkout-terms,
    .subscription-autorenew-b560c7ed7
  ) > input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    margin-top: 1px !important;
    flex: 0 0 22px !important;
  }

  body[data-account-page] .profile-notification-option {
    min-height: 58px !important;
    padding-block: 7px !important;
  }

  /* Subscription navigation / choices. */
  body[data-account-page="subscriptions"] .subscription-jump-nav-b99adaf3b > a {
    min-height: var(--mobile-control-h) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-block: 8px !important;
    touch-action: manipulation;
  }

  body[data-account-page="subscriptions"] .subscription-bot-option-b560c7ed7 {
    min-height: 72px !important;
    height: auto !important;
    padding-block: 10px !important;
    touch-action: manipulation;
  }

  body[data-account-page="subscriptions"] .subscription-periods-b560c7ed7 > button {
    min-height: 62px !important;
    height: auto !important;
    padding-block: 9px !important;
    touch-action: manipulation;
  }

  body[data-account-page="subscriptions"] .subscription-plan-b560c7ed7 {
    touch-action: manipulation;
  }

  body[data-account-page="subscriptions"] :is(
    .subscription-dialog-close-bfb423603,
    .subscription-dialog-actions-bfb423603 > button
  ) {
    min-height: var(--mobile-control-h) !important;
    touch-action: manipulation;
  }

  /* Bot area common chrome. Feature-specific panels remain for later stages. */
  body[data-account-page="bots"] .bot-switch-button {
    min-height: 52px !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    touch-action: manipulation;
  }

  body[data-account-page="bots"] .bot-sidebar-collapse {
    width: var(--mobile-control-h) !important;
    min-width: var(--mobile-control-h) !important;
    height: var(--mobile-control-h) !important;
    min-height: var(--mobile-control-h) !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation;
  }

  body[data-account-page="bots"] :is(
    .managed-server-trigger-be58d3f52,
    .joyjoy-save-server-trigger-b04eeb672,
    .bot-module-menu > button
  ) {
    min-height: var(--mobile-control-h) !important;
    height: auto !important;
    touch-action: manipulation;
  }

  body[data-account-page="bots"] .bot-prefix-input {
    min-height: var(--mobile-control-h) !important;
    height: auto !important;
  }

  body[data-account-page="bots"] :is(
    .bot-switcher,
    .bot-header-actions,
    .statistics-header-actions-be3e9b057,
    .prefix-card-actions,
    .queue-footer-actions,
    .player-upload-actions,
    .bot-log-actions-c9a73e41,
    .equalizer-actions
  ) {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap !important;
    gap: var(--mobile-control-gap) !important;
  }

  /* Footer links are navigation controls too; make them thumb-friendly. */
  body[data-account-page] .site-footer__brand {
    min-height: var(--mobile-control-h) !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  body[data-account-page] .site-footer__compact-nav > a {
    min-height: var(--mobile-control-h) !important;
    display: inline-flex !important;
    align-items: center !important;
    padding-block: 8px !important;
    touch-action: manipulation;
  }

  /* Shared focus visibility for keyboard / accessibility. */
  body[data-account-page] :is(
    button,
    a[href],
    input,
    select,
    textarea,
    [role="button"],
    [role="tab"]
  ):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--account-accent, #2f81f7) 34%, transparent) !important;
    outline-offset: 2px !important;
  }
}

@media (max-width: 560px) {
  body[data-account-page] :is(
    .form-actions,
    .joyjoy-experience-actions,
    .subscription-primary-actions-b99adaf3b,
    .subscription-payment-method-actions-v28,
    .subscription-dialog-actions-bfb423603
  ) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  body[data-account-page] :is(
    .form-actions,
    .joyjoy-experience-actions,
    .subscription-primary-actions-b99adaf3b,
    .subscription-payment-method-actions-v28,
    .subscription-dialog-actions-bfb423603
  ) > :is(button, a) {
    flex: 1 1 150px;
    min-width: 0 !important;
  }

  body[data-account-page="subscriptions"] .subscription-periods-b560c7ed7 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body[data-account-page="subscriptions"] .subscription-periods-b560c7ed7 > button {
    min-width: 0 !important;
    width: 100% !important;
  }

  body[data-account-page] .site-footer__compact-nav {
    width: 100%;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 2px !important;
  }

  body[data-account-page] .site-footer__compact-nav > a {
    width: 100%;
  }
}

@media (max-width: 360px) {
  body[data-account-page="subscriptions"] .subscription-periods-b560c7ed7 {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Specificity bridges for legacy component bundles with !important dimensions. */
@media (max-width: 820px) {
  body[data-account-page] .account-page .account-topbar :is(.topbar-icon, .account-user-trigger) {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    flex-basis: 44px !important;
  }

  body[data-account-page="profile"] .account-page .normalized-switch,
  body[data-account-page="bots"] .account-page #panel-bot-control .normalized-switch {
    width: 52px !important;
    min-width: 52px !important;
    height: 44px !important;
    min-height: 44px !important;
    flex-basis: 52px !important;
  }

  body[data-account-page="profile"] .account-page .normalized-switch > input[type="checkbox"],
  body[data-account-page="bots"] .account-page #panel-bot-control .normalized-switch > input[type="checkbox"] {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
  }

  body[data-account-page="profile"] .account-page .normalized-switch > i,
  body[data-account-page="bots"] .account-page #panel-bot-control .normalized-switch > i {
    top: 7px !important;
    bottom: 7px !important;
    left: 0 !important;
    right: 0 !important;
  }

  body[data-account-page="profile"] .quick-actions > a {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    padding-block: 9px !important;
    touch-action: manipulation;
  }

  body[data-account-page="subscriptions"] .subscription-jump-nav-b99adaf3b > a {
    min-width: 44px !important;
  }

  body[data-account-page="subscriptions"] .subscription-terms-b560c7ed7 a {
    position: relative;
    text-underline-offset: 3px;
  }

  body[data-account-page="subscriptions"] .subscription-terms-b560c7ed7 a::after {
    content: "";
    position: absolute;
    inset: -8px -4px;
  }
}

@media (max-width: 560px) {
  body[data-account-page="subscriptions"] .subscription-current-actions-b99adaf3b .subscription-primary-actions-b99adaf3b {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
  }

  body[data-account-page="subscriptions"] .subscription-current-actions-b99adaf3b .subscription-primary-actions-b99adaf3b > button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 44px !important;
    height: auto !important;
  }
}

@media (max-width: 820px) {
  /* A late desktop rule in the legacy subscription bundle reopens two columns.
     Close it again on mobile so the current-subscription card cannot collapse. */
  body[data-account-page="subscriptions"] .account-page .subscription-overview-b560c7ed7 {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ===== Stage 9 preserved source: assets/css/account-mobile-shieldy-v5.css ===== */
/*
 * TuneTune / JoyJoy Cabinet — Mobile Shieldy V5
 * Stage 5: Shieldy-specific mobile hardening.
 *
 * SAFETY CONTRACT
 * - Additive CSS only.
 * - No existing JS, API, auth, WebSocket, reconnect or backend routing changes.
 * - No existing ids/classes/data-* are renamed or removed.
 * - Desktop above 820px is intentionally untouched.
 */

@media (max-width: 820px) {
  body[data-account-page="bots"] [data-module-panel^="sh-"] {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="bots"] [data-module-panel^="sh-"] :is(
    .github-card,.console-card,.field,.console-fields,.feature-settings-body,
    .automod-module,.automod-module-body,.welcome-event-workspace,
    .reaction-role-layout,.reaction-role-editor-column,.reaction-role-preview-column,
    .ticket-center-b76dc29ea,.ticket-tab-panel-b76dc29ea,
    .shieldy-report-layout,.shieldy-message-timer-layout,
    .log-customization-layout,.cc-layout,.cm510-workspace
  ) {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Real switch stays visually 52x30, while its label gets a 44px finger target. */
  body[data-account-page="bots"] [data-module-panel^="sh-"] :is(
    label.mini-switch,label.switch,label.normalized-switch,label.ui-switch-control
  ) {
    position: relative;
    min-height: 44px !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    touch-action: manipulation;
  }

  /* Common Shieldy-only compact actions that escape the general Stage 3 rules. */
  body[data-account-page="bots"] [data-module-panel^="sh-"] :is(
    .compact-button,.inline-button,.text-button,
    .shieldy-interaction-tab,.custom-workspace-tab,
    .automod-message-tab,.ticket-center-tabs-b76dc29ea button,
    .cm510-channel-tabs button,.rr-preview-tabs button,
    .preview-toggle-button
  ) {
    min-height: 44px !important;
    touch-action: manipulation;
  }

  /* ---------- Automod ---------- */
  body[data-account-page="bots"] [data-module-panel="sh-automod"] .automod-module-summary {
    min-height: 56px;
    touch-action: manipulation;
  }

  body[data-account-page="bots"] [data-module-panel="sh-automod"] .automod-response-variables button {
    min-height: 44px !important;
    padding: 8px 11px !important;
    touch-action: manipulation;
  }

  body[data-account-page="bots"] [data-module-panel="sh-automod"] :is(
    .automod-response-upload button,
    .badwords-dictionary-actions button,
    .badwords-dictionary-buttons button,
    .automod-mute-role-actions button,
    .automod-add-rule,
    .automod-rule-head button
  ) {
    min-height: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-automod"] :is(
    .automod-response-free-grid,.automod-response-premium-grid,
    .automod-response-premium-fields,.automod-mute-role-grid,
    .automod-escalation-rules
  ) {
    min-width: 0;
    max-width: 100%;
  }

  /* ---------- Welcome / goodbye / reaction roles ---------- */
  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .shieldy-interaction-tabs {
    scroll-padding-inline: 4px;
    overscroll-behavior-inline: contain;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .shieldy-interaction-tab {
    flex: 0 0 auto !important;
    min-height: 52px !important;
    scroll-snap-align: start;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] :is(
    .welcome-section-actions button,.welcome-upload-actions button,
    .welcome-embed-variable-row button,.compact-variable-chips button,
    .rr-banner-upload-tools button,.reaction-role-management-actions button,
    .rr-row-actions button,.rr-order-button,.rr-remove,
    .preview-card-actions button
  ) {
    min-height: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] :is(
    .rr-row-actions .rr-order-button,.rr-row-actions .rr-remove,
    .preview-toggle-button.icon-only-toggle
  ) {
    min-width: 44px !important;
    width: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] :is(
    .welcome-inline-preview,.welcome-preview-card,.reaction-role-preview-card,
    .rr-bottom-preview-card,.lolka-preview-window,.welcome-embed-preview,
    .rr-mini-preview-card,.rr-message-preview
  ) {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] :is(
    .welcome-preview-message-block,.welcome-message-author,
    .shieldy-preview-plain-text,.rr-preview-content,.lolka-preview-message
  ) {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .reaction-role-list-card {
    max-width: 100%;
    overflow: hidden;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .reaction-role-item-row {
    max-width: 100%;
    min-width: 0;
  }

  /* ---------- Logs / punishments ---------- */
  body[data-account-page="bots"] [data-module-panel="sh-punishments"] :is(
    .log-thumbnail-upload-actions button,.bot-log-actions-c9a73e41 button,
    .bot-log-toolbar-c9a73e41 input,.bot-log-toolbar-c9a73e41 select
  ) {
    min-height: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-punishments"] :is(
    .unified-log-list,.bot-log-list-c9a73e41,.log-customization-preview,
    .log-preview-embed
  ) {
    min-width: 0;
    max-width: 100%;
  }

  /* ---------- Timers, reports, polls, utility tools ---------- */
  body[data-account-page="bots"] [data-module-panel="sh-other"] :is(
    .shieldy-report-actions button,
    #custom-timer-banner-upload,#custom-timer-banner-clear,
    #shieldy-poll-banner-upload,#shieldy-poll-banner-clear,
    .timer-datepicker-trigger,.timer-datepicker-nav,
    .timer-datepicker-shortcut,.timer-datepicker-apply,
    .shieldy-banner-control-bd942bbf9 button,
    .poll-actions button
  ) {
    min-height: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-other"] :is(
    .timer-datepicker-nav,.timer-datepicker-apply
  ) {
    min-width: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-other"] a[href*="premium"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-block: 8px;
  }

  body[data-account-page="bots"] [data-module-panel="sh-other"] :is(
    .shieldy-report-preview-wrap,.shieldy-report-preview-stage,
    .shieldy-message-timer-preview,.jj-b05cbcf65-message-preview,
    .timer-datepicker-popover
  ) {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ---------- Tickets ---------- */
  body[data-account-page="bots"] [data-module-panel="sh-tickets"] .ticket-center-tabs-b76dc29ea {
    scroll-snap-type: x proximity;
    scroll-padding-inline: 4px;
    overscroll-behavior-inline: contain;
  }

  body[data-account-page="bots"] [data-module-panel="sh-tickets"] .ticket-center-tabs-b76dc29ea button {
    min-height: 44px !important;
    scroll-snap-align: start;
  }

  body[data-account-page="bots"] [data-module-panel="sh-tickets"] :is(
    .ticket-auto-setup-actions-b001829e8 button,
    .ticket-builder-card-b76dc29ea button,
    .ticket-question-list-b76dc29ea button,
    .ticket-rating-preview-buttons-v723 button,
    .ticket-banner-upload-b90682276 button,
    .ticket-section-head-b76dc29ea button
  ) {
    min-height: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-tickets"] :is(
    .ticket-message-preview-b76dc29ea,.ticket-preview-embed-b76dc29ea,
    .ticket-dashboard-table-b76dc29ea,.ticket-question-list-b76dc29ea
  ) {
    min-width: 0;
    max-width: 100%;
  }

  /* ---------- Custom commands/messages ---------- */
  body[data-account-page="bots"] [data-module-panel="sh-custom-builder"] :is(
    .custom-workspace-switch,.cm510-channel-tabs
  ) {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-builder"] :is(
    .custom-workspace-tab,.cm510-channel-tabs button
  ) {
    flex: 0 0 auto;
    min-height: 44px !important;
    scroll-snap-align: start;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-builder"] :is(
    .cm510-preview-card,.cm510-preview-stage,.cc-preview-card,.cc-preview-stage,
    .cc-command-list,.cm510-message-list
  ) {
    min-width: 0;
    max-width: 100%;
  }

  /* ---------- Custom Shieldy bot ---------- */
  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] :is(
    .shieldy-custom-bots-developer-link,.shieldy-custom-bots-guide-toggle,
    .shieldy-custom-bot-create-actions button,.shieldy-custom-bot-token-row button,
    .shieldy-custom-bot-server-trigger,.shieldy-custom-bot-server-dock-actions button
  ) {
    min-height: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] .shieldy-custom-bots-developer-link {
    display: inline-flex;
    align-items: center;
    padding-block: 10px;
    touch-action: manipulation;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] :is(
    .shieldy-custom-bot-grid,.shieldy-custom-bot-token-row,
    .shieldy-custom-bot-status-text-row,.shieldy-custom-bots-list
  ) {
    min-width: 0;
    max-width: 100%;
  }

  /* ---------- Commands and premium ---------- */
  body[data-account-page="bots"] [data-module-panel="sh-commands"] :is(
    .command-list-pro,.shieldy-command-grid,.command-catalog-grid
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="bots"] [data-module-panel="sh-premium"] :is(
    .bot-plan-select-bf9561c17,.bot-premium-plan-bf9561c17 .primary,
    .bot-premium-plan-bf9561c17 .secondary
  ) {
    min-height: 44px !important;
  }
}

@media (max-width: 620px) {
  /* Welcome banner templates become a short swipe gallery, avoiding a long stack. */
  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .welcome-banner-presets {
    display: grid !important;
    grid-template-columns: none !important;
    grid-auto-flow: column !important;
    grid-auto-columns: min(78vw, 260px) !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 7px;
    gap: 9px !important;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: thin;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .welcome-banner-presets label {
    min-width: 0;
    min-height: 96px;
    scroll-snap-align: start;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .rr-preview-tabs {
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .rr-preview-tabs button {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    min-height: 44px !important;
    scroll-snap-align: start;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .reaction-role-item-row {
    grid-template-columns: 44px minmax(0,1fr) !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .rr-action-buttons {
    grid-template-columns: repeat(3,44px) !important;
    gap: 6px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .rr-row-actions :is(.rr-order-button,.rr-remove) {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
  }

  /* Automod chips remain compact, but no longer 30px-high. */
  body[data-account-page="bots"] [data-module-panel="sh-automod"] .automod-response-variables {
    flex-wrap: nowrap !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1px 1px 5px;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  body[data-account-page="bots"] [data-module-panel="sh-automod"] .automod-response-variables button {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  /* Ticket nav is a swipe rail; dense dashboard remains locally scrollable. */
  body[data-account-page="bots"] [data-module-panel="sh-tickets"] .ticket-center-tabs-b76dc29ea {
    width: 100%;
    max-width: 100%;
  }

  body[data-account-page="bots"] [data-module-panel="sh-tickets"] .ticket-dashboard-table-b76dc29ea {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Timer editor and report preview use one readable column. */
  body[data-account-page="bots"] [data-module-panel="sh-other"] :is(
    .shieldy-report-layout,.shieldy-message-timer-layout
  ) {
    grid-template-columns: minmax(0,1fr) !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-other"] .timer-datepicker-shortcuts {
    display: flex;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  body[data-account-page="bots"] [data-module-panel="sh-other"] .timer-datepicker-shortcut {
    flex: 0 0 auto;
  }

  /* Logs / preview customization stack on phones. */
  body[data-account-page="bots"] [data-module-panel="sh-punishments"] .log-customization-layout {
    grid-template-columns: minmax(0,1fr) !important;
  }

  /* Shieldy custom-bot fixed dock becomes a compact vertical card. */
  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] {
    padding-bottom: max(225px, calc(195px + env(safe-area-inset-bottom))) !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] .shieldy-custom-bot-server-dock {
    width: calc(100vw - max(16px,env(safe-area-inset-left)) - max(16px,env(safe-area-inset-right))) !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 8px !important;
    bottom: max(8px,env(safe-area-inset-bottom)) !important;
    padding: 10px !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] :is(
    .shieldy-custom-bot-server-picker,.shieldy-custom-bot-server-dock-actions,
    .shieldy-custom-bot-server-dock-state
  ) {
    grid-column: 1 !important;
    width: 100%;
    min-width: 0;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] .shieldy-custom-bot-server-picker {
    grid-row: 1 !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] .shieldy-custom-bot-server-dock-actions {
    grid-row: 2 !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] .shieldy-custom-bot-server-dock-actions button {
    width: 100%;
    min-width: 0 !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-custom-bots"] .shieldy-custom-bot-server-dock-state {
    grid-row: 3 !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }

  /* Premium cards become one vertical reading flow. */
  body[data-account-page="bots"] [data-module-panel="sh-premium"] :is(
    .bot-premium-plans,.bot-premium-plans-bf9561c17
  ) {
    grid-template-columns: minmax(0,1fr) !important;
  }
}

@media (max-width: 380px) {
  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .welcome-banner-presets {
    grid-auto-columns: min(82vw, 245px) !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .rr-action-buttons {
    grid-template-columns: repeat(3,44px) !important;
  }

  body[data-account-page="bots"] [data-module-panel="sh-other"] .timer-datepicker-popover {
    padding-inline: 8px !important;
  }
}


/* Stage 5 specificity guards against legacy Shieldy !important rules. */
@media (max-width: 820px) {
  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel^="sh-"] label:is(
    .mini-switch,.switch,.normalized-switch,.ui-switch-control
  ) {
    min-height: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  body[data-account-page="bots"] #panel-bot-control #shieldy-settings-form .automod-response-variables button {
    min-height: 44px !important;
    height: auto !important;
    padding: 8px 11px !important;
  }

  body[data-account-page="bots"] #panel-bot-control #shieldy-settings-form :is(
    .automod-response-upload .compact-button,
    .badwords-dictionary-actions button,
    .badwords-dictionary-buttons button,
    .automod-mute-role-actions button,
    .automod-add-rule
  ) {
    min-height: 44px !important;
    height: auto !important;
  }

  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-welcome"] .reaction-role-item-row :is(
    .rr-drag-handle,.rr-order-button,.rr-remove
  ) {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
  }

  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-welcome"] .rr-action-buttons {
    grid-template-columns: repeat(3,44px) !important;
  }

  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-other"] :is(
    #custom-timer-banner-upload,#custom-timer-banner-clear,
    #shieldy-poll-banner-upload,#shieldy-poll-banner-clear
  ) {
    min-height: 44px !important;
    height: 44px !important;
  }

  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-other"] a[href*="premium"] {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding-block: 8px !important;
  }
}


/* Stage 5 narrow-screen structural guards found by the deep render pass. */
@media (max-width: 820px) {
  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-other"] a[href*="account-subscriptions"] {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding-block: 8px !important;
  }

  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-punishments"] .muted-status {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
  }
}

@media (max-width: 620px) {
  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-custom-builder"] .cc-layout {
    grid-template-columns: minmax(0,1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-custom-builder"] :is(
    .cc-list-card,.cc-editor-card,.cc-preview-card
  ) {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

@media (max-width: 380px) {
  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-welcome"] .reaction-role-item-row {
    grid-template-columns: minmax(0,1fr) !important;
    align-items: stretch !important;
  }

  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-welcome"] .reaction-role-item-row :is(
    .rr-order-control,.rr-field,.rr-row-actions
  ) {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-welcome"] .reaction-role-item-row .rr-field input {
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-welcome"] .rr-order-control {
    display: flex !important;
    justify-content: flex-start !important;
  }
}

@media (max-width:620px){body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-custom-builder"] .cc-shell{grid-template-columns:minmax(0,1fr)!important;width:100%!important;max-width:100%!important}body[data-account-page="bots"] .account-page #panel-bot-control [data-module-panel="sh-custom-builder"] .cc-layout{grid-column:1!important;grid-row:auto!important;width:100%!important;max-width:100%!important}}
