/* ===== 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-gamey-system-v6.css ===== */
/*
 * JoyJoy Cabinet — Mobile Gamey + System V6
 * Stage 6: additive, UI-only mobile hardening.
 *
 * Safety contract:
 * - no JavaScript changes;
 * - no API / auth / WebSocket / reconnect changes;
 * - no .htaccess or backend changes;
 * - no existing IDs/classes/data-* changed;
 * - desktop > 820px intentionally untouched.
 */

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

  body[data-account-page="bots"] [data-module-panel^="gm-"] :is(
    .gamey-games-tabs-b0c49efd0,
    .gamey-games-tabs-b33ba4c5a
  ) {
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: thin;
  }

  body[data-account-page="bots"] [data-module-panel^="gm-"] :is(
    .gamey-games-tabs-b0c49efd0,
    .gamey-games-tabs-b33ba4c5a
  ) > button {
    flex: 0 0 auto;
    min-height: 44px !important;
    scroll-snap-align: start;
    touch-action: manipulation;
  }

  /* AI package stepper is 38px in the current bundle. */
  body[data-account-page="bots"] [data-module-panel="gm-ai"] .gamey-ai-package-stepper-v1 {
    grid-template-columns: 44px minmax(68px, 78px) 44px !important;
    min-width: 0;
  }

  body[data-account-page="bots"] [data-module-panel="gm-ai"] .gamey-ai-package-stepper-v1 :is(button,input) {
    height: 44px !important;
    min-height: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="gm-ai"] .gamey-ai-package-stepper-v1 button {
    width: 44px !important;
    min-width: 44px !important;
    padding-inline: 0 !important;
    touch-action: manipulation;
  }

  body[data-account-page="bots"] [data-module-panel="gm-ai"] :is(
    .gamey-ai-package-v1,
    .gamey-ai-purchase-v1,
    .gamey-ai-dashboard-main-v1,
    .gamey-ai-persona-be13b1ea7
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="bots"] [data-module-panel="gm-ai"] :is(
    .gamey-ai-buy-v1,
    .gamey-ai-actions-be13b1ea7 button
  ) {
    min-height: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="gm-ai"] .gamey-ai-purchase-consents-v1 label {
    min-height: 44px;
    padding-block: 5px;
    box-sizing: border-box;
    align-items: flex-start;
  }

  body[data-account-page="bots"] [data-module-panel="gm-ai"] .gamey-ai-purchase-consents-v1 a {
    display: inline;
    padding-block: 5px;
    margin-block: -5px;
    touch-action: manipulation;
  }

  /* Existing dynamic rows and toolbars. */
  body[data-account-page="bots"] [data-module-panel^="gm-"] :is(
    .gamey-event-editor-actions-b2b0deb35 button,
    .gamey-event-upload-button-b2b0deb35,
    .gamey-streamer-toolbar-c2f9a76d4 button,
    .gamey-streamer-remove-c2f9a76d4,
    .rss-feed-toolbar-bd1861954 button,
    .rss-feed-remove-bd1861954,
    .gamey-browser-actions-b6262637c button,
    .gamey-browser-game-actions-b6262637c button,
    .gamey-b418bfbea-save-bar button,
    .gamey-events-savebar-b2b0deb35 button,
    .gamey-rss-save-bar-bd1861954 button,
    .gamey-streamer-savebar-c2f9a76d4 button,
    .bot-log-actions-c9a73e41 button
  ) {
    min-height: 44px !important;
    touch-action: manipulation;
  }

  body[data-account-page="bots"] [data-module-panel="gm-custom-bots"] .gamey-custom-bots-developer-link {
    display: inline-flex;
    min-height: 44px !important;
    align-items: center;
    padding-block: 10px;
    touch-action: manipulation;
  }

  body[data-account-page="bots"] [data-module-panel="gm-custom-bots"] :is(
    .gamey-custom-bots-guide-toggle,
    .gamey-custom-bot-create-actions button,
    .gamey-custom-bot-token-row button,
    .gamey-custom-bot-server-trigger,
    .gamey-custom-bot-server-dock-actions button
  ) {
    min-height: 44px !important;
  }

  body[data-account-page="bots"] [data-module-panel="gm-custom-bots"] .gamey-custom-bot-server-trigger {
    min-width: 0;
    max-width: 100%;
  }

  /* Wide Gamey data stays local; never expands the entire cabinet. */
  body[data-account-page="bots"] [data-module-panel^="gm-"] :is(
    .gamey-stats-table-wrap-b418bfbea,
    .gamey-inventory-table-wrap-bc8b09e88,
    .gamey-browser-card-list-b6262637c,
    .gamey-events-list-b2b0deb35,
    .bot-log-list-c9a73e41
  ) {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  body[data-account-page="bots"] [data-module-panel^="gm-"] :is(
    .gamey-events-layout-b2b0deb35,
    .gamey-event-editor-b2b0deb35,
    .gamey-event-preview-b2b0deb35,
    .gamey-profile-card-layout-b1dc52e3a,
    .gamey-streamer-list-card-c2f9a76d4,
    .gamey-rss-summary-card,
    .gamey-custom-bot-create,
    .gamey-custom-bots-list
  ) {
    min-width: 0;
    max-width: 100%;
  }

  /* Save docks follow the handset safe-area. */
  body[data-account-page="bots"] [data-module-panel^="gm-"] :is(
    .gamey-b418bfbea-save-bar,
    .gamey-events-savebar-b2b0deb35,
    .gamey-rss-save-bar-bd1861954,
    .gamey-streamer-savebar-c2f9a76d4
  ) {
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: calc(100vw - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right))) !important;
    box-sizing: border-box;
  }
}

@media (max-width: 620px) {
  body[data-account-page="bots"] [data-module-panel^="gm-"] :is(
    .game-choice-grid,
    .gamey-stats-grid-v720,
    .gamey-minigame-grid-b418bfbea,
    .gamey-browser-toggle-grid-b6262637c,
    .gamey-browser-fields-b6262637c,
    .gamey-economy-toggle-grid-b418bfbea,
    .gamey-economy-toggle-grid-b1dc52e3a,
    .gamey-economy-layout-b1dc52e3a,
    .gamey-level-notification-fields-b1dc52e3a,
    .gamey-profile-card-layout-b1dc52e3a,
    .gamey-event-resource-grid-b7c74794f,
    .gamey-event-toggle-grid-b2b0deb35,
    .gamey-event-reward-grid-b2b0deb35,
    .gamey-event-access-fields-b7c74794f,
    .gamey-streamer-platform-grid-c2f9a76d4,
    .gamey-streamer-row-fields-c2f9a76d4,
    .rss-toggle-grid-bd1861954,
    .source-grid-bd1861954,
    .rss-feed-fields-bd1861954,
    .gamey-custom-bot-grid,
    .command-catalog-grid,
    .bot-premium-plans,
    .bot-premium-plans-bf9561c17
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0;
  }

  body[data-account-page="bots"] [data-module-panel="gm-events"] .gamey-events-layout-b2b0deb35 {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body[data-account-page="bots"] [data-module-panel="gm-events"] :is(
    .gamey-event-editor-actions-b2b0deb35,
    .gamey-event-preview-meta-b2b0deb35,
    .gamey-event-preview-rewards-b2b0deb35
  ) {
    flex-wrap: wrap;
    min-width: 0;
    gap: 8px;
  }

  body[data-account-page="bots"] [data-module-panel="gm-streamer"] :is(
    .gamey-streamer-toolbar-c2f9a76d4,
    .gamey-streamer-row-head-c2f9a76d4
  ),
  body[data-account-page="bots"] [data-module-panel="gm-rss"] .rss-feed-row-head-bd1861954 {
    align-items: stretch !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  body[data-account-page="bots"] [data-module-panel="gm-streamer"] .gamey-streamer-toolbar-c2f9a76d4 > *,
  body[data-account-page="bots"] [data-module-panel="gm-rss"] .rss-feed-toolbar-bd1861954 > * {
    min-width: 0;
  }

  body[data-account-page="bots"] [data-module-panel="gm-economy"] :is(
    .gamey-profile-card-main-b1dc52e3a,
    .gamey-profile-inventory-b1dc52e3a,
    .gamey-profile-inventory-items-bc8b09e88
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="bots"] [data-module-panel="gm-custom-bots"] {
    padding-bottom: max(205px, calc(180px + env(safe-area-inset-bottom))) !important;
  }

  body[data-account-page="bots"] [data-module-panel="gm-custom-bots"] .gamey-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;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    box-sizing: border-box;
  }

  body[data-account-page="bots"] [data-module-panel="gm-custom-bots"] :is(
    .gamey-custom-bot-create-actions,
    .gamey-custom-bot-server-dock-actions
  ) {
    flex-wrap: wrap;
    gap: 8px;
  }

  body[data-account-page="bots"] [data-module-panel="gm-custom-bots"] :is(
    .gamey-custom-bot-create-actions,
    .gamey-custom-bot-server-dock-actions
  ) > button {
    flex: 1 1 132px;
  }

  body[data-account-page="bots"] [data-module-panel="gm-ai"] :is(
    .gamey-ai-purchase-v1,
    .gamey-ai-package-v1,
    .gamey-ai-package-total-v1
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="bots"] [data-module-panel="gm-ai"] .gamey-ai-package-v1 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-account-page="bots"] [data-module-panel="gm-logs"] .bot-log-toolbar-c9a73e41 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-account-page="bots"] [data-module-panel="gm-logs"] .bot-log-toolbar-c9a73e41 :is(input,select) {
    min-height: 44px !important;
    height: 44px !important;
  }
}

/* =========================================================
   PROFILE + SECURITY
   ========================================================= */
@media (max-width: 820px) {
  body[data-account-page="profile"] :is(
    .profile-center-stage,
    .profile-security-layout,
    .profile-security-grid,
    .profile-session-list,
    .profile-security-history,
    .profile-subscriptions-list,
    .joyjoy-experience-card
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="profile"] .profile-center-tab {
    min-height: 44px !important;
  }

  body[data-account-page="profile"] .profile-subscription-action,
  body[data-account-page="profile"] .profile-subscriptions-main-action,
  body[data-account-page="profile"] .profile-session-revoke,
  body[data-account-page="profile"] .profile-security-actions button,
  body[data-account-page="profile"] .password-input-wrap button,
  body[data-account-page="profile"] .joyjoy-preview-button {
    min-height: 44px !important;
    touch-action: manipulation;
  }

  body[data-account-page="profile"] .profile-security-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-account-page="profile"] .profile-session-item {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="profile"] .profile-session-main {
    min-width: 0;
  }

  body[data-account-page="profile"] :is(
    .profile-session-main strong,
    .profile-session-main small,
    .profile-session-meta span,
    .profile-security-event p,
    .profile-security-card-heading p
  ) {
    overflow-wrap: anywhere;
  }

  body[data-account-page="profile"] .profile-security-event {
    min-width: 0;
  }

  body[data-account-page="profile"] .password-input-wrap {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="profile"] .password-input-wrap input {
    min-width: 0;
  }

  body[data-account-page="profile"] .password-rules {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }

  body[data-account-page="profile"] .joyjoy-experience-row-controls {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  body[data-account-page="profile"] .profile-subscription-row {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
  }

  body[data-account-page="profile"] .profile-subscription-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    min-width: 0;
  }

  body[data-account-page="profile"] .profile-subscription-action {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  body[data-account-page="profile"] .profile-security-overview {
    grid-template-columns: minmax(0, 1fr) !important;
    text-align: left;
  }

  body[data-account-page="profile"] .profile-security-ring {
    justify-self: start;
  }

  body[data-account-page="profile"] .profile-session-item {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body[data-account-page="profile"] .profile-session-revoke {
    grid-column: 1 / -1;
    width: 100%;
  }

  body[data-account-page="profile"] .profile-session-meta {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-account-page="profile"] .profile-security-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body[data-account-page="profile"] .profile-security-actions button {
    width: 100%;
  }

  body[data-account-page="profile"] .profile-security-event {
    grid-template-columns: 38px minmax(0, 1fr) !important;
  }

  body[data-account-page="profile"] .profile-security-event time {
    grid-column: 2;
    justify-self: start;
  }

  body[data-account-page="profile"] .joyjoy-experience-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-account-page="profile"] .joyjoy-experience-row-controls {
    width: 100%;
  }

  body[data-account-page="profile"] .joyjoy-experience-row-controls :is(select,button) {
    min-height: 44px !important;
  }

  body[data-account-page="profile"] .joyjoy-experience-actions {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-account-page="profile"] .joyjoy-experience-actions button {
    width: 100%;
  }
}

/* =========================================================
   SUBSCRIPTIONS
   ========================================================= */
@media (max-width: 820px) {
  body[data-account-page="subscriptions"] :is(
    .subscription-overview-b560c7ed7,
    .subscription-builder-b560c7ed7,
    .subscription-checkout-grid-b560c7ed7,
    .subscription-order-summary-b560c7ed7,
    .subscription-payment-b560c7ed7,
    .subscription-payment-method-card-v28,
    .subscription-dialog-bfb423603
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="subscriptions"] .subscription-overview-b560c7ed7 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  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"] :is(
    .subscription-plan-b560c7ed7,
    .subscription-periods-b560c7ed7,
    .subscription-payment-methods-b560c7ed7
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="subscriptions"] :is(
    .subscription-cancel-button,
    .subscription-request-cancel-bfb423603,
    .subscription-withdraw-request-bfb423603,
    .subscription-buy-b560c7ed7,
    .subscription-payment-method-actions-v28 button,
    .subscription-dialog-actions-bfb423603 button
  ) {
    min-height: 44px !important;
    touch-action: manipulation;
  }

  body[data-account-page="subscriptions"] :is(
    .subscription-current-actions-b560c7ed7,
    .subscription-primary-actions-b99adaf3b,
    .subscription-extra-actions-b99adaf3b,
    .subscription-payment-method-actions-v28
  ) {
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }

  body[data-account-page="subscriptions"] .subscription-payment-method-layout-v28 {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  body[data-account-page="subscriptions"] .subscription-plan-b560c7ed7 ul {
    columns: 1 !important;
  }

  body[data-account-page="subscriptions"] :is(
    .subscription-current-actions-b560c7ed7,
    .subscription-primary-actions-b99adaf3b,
    .subscription-extra-actions-b99adaf3b,
    .subscription-payment-method-actions-v28,
    .subscription-dialog-actions-bfb423603
  ) > :is(button,a) {
    flex: 1 1 140px;
  }

  body[data-account-page="subscriptions"] .subscription-payment-method-layout-v28 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-account-page="subscriptions"] .subscription-bank-card-v28 {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

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

  body[data-account-page="subscriptions"] .promocode-input-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* =========================================================
   PROMOCODE
   ========================================================= */
@media (max-width: 560px) {
  body[data-account-page="promocode"] :is(
    .promocode-layout,
    .promocode-form,
    .promocode-input-row,
    .promocode-server-field
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="promocode"] .promocode-layout,
  body[data-account-page="promocode"] .promocode-input-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-account-page="promocode"] .promocode-form :is(input,select,button) {
    min-height: 44px !important;
  }
}

/* =========================================================
   ADMIN / CONSOLE
   ========================================================= */
@media (max-width: 820px) {
  body[data-account-page="console"] :is(
    .developer-console-layout,
    .admin-console-panel,
    .admin-hub-view,
    .admin-master-detail,
    .admin-list-card,
    .admin-detail-panel,
    .admin-table-wrap,
    .admin-premium-workspace-b2bb5ff2d,
    .admin-subscription-master-detail-b474bb34a
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-account-page="console"] :is(
    .admin-table-wrap,
    .admin-premium-table-wrap-b2bb5ff2d
  ) {
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  body[data-account-page="console"] .admin-master-detail,
  body[data-account-page="console"] .admin-premium-workspace-b2bb5ff2d,
  body[data-account-page="console"] .admin-subscription-master-detail-b474bb34a {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-account-page="console"] :is(
    .admin-view-heading,
    .admin-bot-detail-head,
    .admin-premium-heading-b2bb5ff2d,
    .admin-filter-row,
    .admin-inline-form,
    .admin-payment-reconcile-actions-b41ecc5f8,
    .admin-mail-actions-v30
  ) {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  body[data-account-page="console"] :is(
    .admin-payment-drawer-close-b1a9416e1,
    .admin-premium-refresh-b2bb5ff2d,
    .admin-announcement-media-clear-b2066407d,
    .admin-filter-row button,
    .admin-inline-form button,
    .admin-bot-actions button,
    .admin-payment-reconcile-actions-b41ecc5f8 button,
    .admin-mail-actions-v30 button
  ) {
    min-width: 44px;
    min-height: 44px !important;
    touch-action: manipulation;
  }
}

@media (max-width: 620px) {
  body[data-account-page="console"] .admin-hub-nav {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: thin;
  }

  body[data-account-page="console"] .admin-hub-nav > button {
    flex: 0 0 min(72vw, 240px);
    min-height: 48px !important;
    scroll-snap-align: start;
  }

  body[data-account-page="console"] :is(
    .admin-overview-grid,
    .admin-overview-kpis,
    .admin-bot-overview-cards,
    .admin-bot-metric-grid-b1a8139d2,
    .admin-form-grid,
    .admin-bot-role-fields-b8362ce3b,
    .admin-filter-row,
    .admin-inline-form,
    .admin-mail-mini-form-v30
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-account-page="console"] .admin-filter-row .field {
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-account-page="console"] :is(
    .admin-payment-reconcile-actions-b41ecc5f8,
    .admin-mail-actions-v30,
    .admin-bot-role-actions-b8362ce3b,
    .admin-bot-actions
  ) > button {
    flex: 1 1 140px;
  }

  body[data-account-page="console"] :is(
    .admin-payment-drawer-b1a9416e1,
    .admin-announcement-section-b394850fe
  ) {
    max-width: calc(100vw - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right))) !important;
    box-sizing: border-box;
  }
}
