body.mx-mobile-x-plugin .mx-mobile-x-shell,
body.mx-mobile-x-plugin .mx-mobile-topbar,
body.mx-mobile-x-plugin .mx-mobile-bottomnav,
body.mx-mobile-x-plugin .mx-mobile-sidepanel,
body.mx-mobile-x-plugin .mx-mobile-compose-fab {
  display: none;
}

@media (max-width: 782px) {
  body.mx-mobile-x-plugin {
    --bg: #000000;
    --panel: #000000;
    --topbar-bg: rgba(0, 0, 0, 0.86);
    --search-focus-bg: #16181c;
    --card: #16181c;
    --border: #2f3336;
    --text: #e7e9ea;
    --muted: #71767b;
    --accent: #1d9bf0;
    --hover: rgba(231, 233, 234, 0.08);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    background: var(--bg);
    color: var(--text);
  }

  body.mx-mobile-x-plugin .mx-mobile-x-shell,
  body.mx-mobile-x-plugin .mx-mobile-topbar,
  body.mx-mobile-x-plugin .mx-mobile-bottomnav,
  body.mx-mobile-x-plugin .mx-mobile-sidepanel,
  body.mx-mobile-x-plugin .mx-mobile-compose-fab {
    display: block;
  }

  body.mx-mobile-x-plugin.admin-bar .mx-mobile-topbar {
    top: 46px;
  }

  body.mx-mobile-x-plugin {
    padding-top: 0 !important;
  }

  body.mx-mobile-x-plugin .mx-wrap {
    max-width: none;
    padding: 0;
  }

  body.mx-mobile-x-plugin .mx-grid,
  body.mx-mobile-x-plugin .mx-grid.mx-grid-chat,
  body.mx-mobile-x-plugin .mx-grid.mx-grid-no-right {
    display: block;
    width: 100%;
  }

  body.mx-mobile-x-plugin .mx-left,
  body.mx-mobile-x-plugin .mx-right,
  body.mx-mobile-x-plugin .mx-fabs,
  body.mx-mobile-x-plugin .mx-post-big,
  body.mx-mobile-x-plugin .mx-left-bottom,
  body.mx-mobile-x-plugin .mx-left-inner {
    display: none !important;
  }

  body.mx-mobile-x-plugin .mx-main {
    min-height: 100vh;
    width: 100%;
    border-left: 0;
    border-right: 0;
    background: var(--panel);
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.mx-mobile-x-plugin .mx-mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--topbar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel {
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(91, 112, 131, 0.38);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-sheet {
    position: relative;
    z-index: 1;
    width: min(86vw, 320px);
    height: 100%;
    background: #000;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.mx-mobile-x-plugin.mx-mobile-menu-open {
    overflow: hidden;
  }

  body.mx-mobile-x-plugin.mx-mobile-menu-open .mx-mobile-sidepanel {
    pointer-events: auto;
  }

  body.mx-mobile-x-plugin.mx-mobile-menu-open .mx-mobile-sidepanel-backdrop {
    opacity: 1;
  }

  body.mx-mobile-x-plugin.mx-mobile-menu-open .mx-mobile-sidepanel-sheet {
    transform: translateX(0);
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-head {
    display: flex;
    justify-content: flex-end;
    padding: max(8px, env(safe-area-inset-top)) 12px 6px;
    border-bottom: 1px solid var(--border);
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px calc(20px + env(safe-area-inset-bottom));
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-profile {
    padding: 8px 4px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-profilelink {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-avatar,
  body.mx-mobile-x-plugin .mx-mobile-sidepanel-avatarimg {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-meta strong {
    color: var(--text);
    font-size: 17px;
    line-height: 1.2;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-meta span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.2;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-link {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 52px;
    padding: 0 6px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-link.is-active {
    background: rgba(255, 255, 255, 0.06);
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-linkicon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-linkicon svg {
    width: 28px;
    height: 28px;
    display: block;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-linkavatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
  }

  body.mx-mobile-x-plugin .mx-mobile-sidepanel-linktext {
    line-height: 1.2;
  }

  body.mx-mobile-x-plugin .mx-mobile-topbar[hidden],
  body.mx-mobile-x-plugin .mx-mobile-bottomnav[hidden],
  body.mx-mobile-x-plugin .mx-mobile-sidepanel[hidden],
  body.mx-mobile-x-plugin .mx-mobile-compose-fab[hidden] {
    display: none !important;
  }

  body.mx-mobile-x-plugin .mx-mobile-topbar-inner {
    height: 54px;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 8px;
    padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
  }

  body.mx-mobile-x-plugin .mx-mobile-iconbtn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0;
  }

  body.mx-mobile-x-plugin .mx-mobile-iconbtn svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  body.mx-mobile-x-plugin .mx-mobile-avatar-btn img,
  body.mx-mobile-x-plugin .mx-mobile-avatar-btn .mx-mobile-avatar-fallback {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
  }

  body.mx-mobile-x-plugin .mx-mobile-avatar-fallback {
    background: #1d9bf0;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 30px;
    text-align: center;
  }

  body.mx-mobile-x-plugin .mx-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    font-weight: 800;
    color: var(--text);
  }

  body.mx-mobile-x-plugin .mx-mobile-brand img {
    max-height: 26px;
    width: auto;
    object-fit: contain;
  }

  body.mx-mobile-x-plugin .mx-mobile-brand .mx-brand-text,
  body.mx-mobile-x-plugin .mx-mobile-brand .mx-brand-text-full,
  body.mx-mobile-x-plugin .mx-mobile-brand .mx-brand-text-short {
    display: inline-flex !important;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.02em;
    max-width: 100%;
  }

  body.mx-mobile-x-plugin .mx-topbar {
    position: sticky;
    top: 54px;
    z-index: 45;
    background: var(--topbar-bg);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
  }

  body.mx-mobile-x-plugin.admin-bar .mx-topbar {
    top: 100px;
  }

  body.mx-mobile-x-plugin .mx-tabs {
    min-height: 52px;
  }

  body.mx-mobile-x-plugin .mx-tab {
    color: var(--muted);
    font-size: 16px;
    padding: 15px 8px 12px;
  }

  body.mx-mobile-x-plugin .mx-tab.is-active {
    color: var(--text);
  }

  body.mx-mobile-x-plugin .mx-tab.is-active:after {
    width: 56px;
    height: 4px;
  }

  body.mx-mobile-x-plugin .mx-compose,
  body.mx-mobile-x-plugin .mx-feed,
  body.mx-mobile-x-plugin .mx-subhead,
  body.mx-mobile-x-plugin .mx-card,
  body.mx-mobile-x-plugin .mx-card-soft,
  body.mx-mobile-x-plugin .mx-dm-compose,
  body.mx-mobile-x-plugin .mx-chat,
  body.mx-mobile-x-plugin .mx-searchbox,
  body.mx-mobile-x-plugin .mx-explore-top {
    background: var(--panel);
  }

  body.mx-mobile-x-plugin .mx-compose,
  body.mx-mobile-x-plugin .mx-post,
  body.mx-mobile-x-plugin .mx-feed-head,
  body.mx-mobile-x-plugin .mx-subhead,
  body.mx-mobile-x-plugin .mx-reply-compose,
  body.mx-mobile-x-plugin .mx-reply-item,
  body.mx-mobile-x-plugin .mx-chat,
  body.mx-mobile-x-plugin .mx-head,
  body.mx-mobile-x-plugin .mx-card,
  body.mx-mobile-x-plugin .mx-dm-compose,
  body.mx-mobile-x-plugin .mx-searchbox,
  body.mx-mobile-x-plugin .mx-explore-top,
  body.mx-mobile-x-plugin .mx-widget li {
    border-color: var(--border);
  }

  body.mx-mobile-x-plugin .mx-post:hover,
  body.mx-mobile-x-plugin .mx-reply-item:hover,
  body.mx-mobile-x-plugin .mx-tab:hover,
  body.mx-mobile-x-plugin .mx-navlink:hover {
    background: transparent;
  }

  body.mx-mobile-x-plugin .mx-card,
  body.mx-mobile-x-plugin .mx-card-soft,
  body.mx-mobile-x-plugin .mx-searchbox,
  body.mx-mobile-x-plugin .mx-dm-compose,
  body.mx-mobile-x-plugin .mx-chat {
    border-radius: 0;
    box-shadow: none;
  }

  body.mx-mobile-x-plugin .mx-compose {
    padding: 10px 14px;
  }

  body.mx-mobile-x-plugin .mx-compose textarea {
    min-height: 72px;
    font-size: 18px;
  }

  body.mx-mobile-x-plugin .mx-feed-head {
    display: none !important;
  }

  body.mx-mobile-x-plugin .mx-post,
  body.mx-mobile-x-plugin .mx-reply-item {
    padding: 12px 14px;
  }

  body.mx-mobile-x-plugin .mx-meta {
    font-size: 14px;
  }

  body.mx-mobile-x-plugin .mx-name {
    color: var(--text);
  }

  body.mx-mobile-x-plugin .mx-post-text,
  body.mx-mobile-x-plugin .mx-reply-text,
  body.mx-mobile-x-plugin .mx-input,
  body.mx-mobile-x-plugin .mx-dm-input,
  body.mx-mobile-x-plugin .mx-search-input,
  body.mx-mobile-x-plugin textarea {
    color: var(--text);
  }

  body.mx-mobile-x-plugin .mx-input,
  body.mx-mobile-x-plugin .mx-dm-input,
  body.mx-mobile-x-plugin .mx-search-input,
  body.mx-mobile-x-plugin .mx-widget input[type="search"],
  body.mx-mobile-x-plugin .mx-widget input[type="text"],
  body.mx-mobile-x-plugin .mx-widget input[type="email"],
  body.mx-mobile-x-plugin .mx-widget input[type="url"],
  body.mx-mobile-x-plugin .mx-widget textarea {
    background: transparent;
    border-color: var(--border);
  }

  body.mx-mobile-x-plugin .mx-btn,
  body.mx-mobile-x-plugin .mx-widget button,
  body.mx-mobile-x-plugin .mx-widget input[type="submit"],
  body.mx-mobile-x-plugin .mx-btn-following {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
  }

  body.mx-mobile-x-plugin .mx-btn-accent,
  body.mx-mobile-x-plugin .mx-btn-follow {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
  }

  body.mx-mobile-x-plugin .mx-small,
  body.mx-mobile-x-plugin .mx-handle,
  body.mx-mobile-x-plugin .mx-widget,
  body.mx-mobile-x-plugin .mx-widget a,
  body.mx-mobile-x-plugin .mx-head,
  body.mx-mobile-x-plugin .mx-body,
  body.mx-mobile-x-plugin .mx-subhead {
    color: var(--muted);
  }

  body.mx-mobile-x-plugin .mx-subhead,
  body.mx-mobile-x-plugin .mx-head,
  body.mx-mobile-x-plugin .mx-name,
  body.mx-mobile-x-plugin .mx-body strong {
    color: var(--text);
  }

  body.mx-mobile-x-plugin .mx-action {
    color: var(--muted);
  }

  body.mx-mobile-x-plugin .mx-mobile-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    padding: 0 8px calc(6px + env(safe-area-inset-bottom));
  }

  body.mx-mobile-x-plugin .mx-mobile-bottomnav-inner {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 2px;
    min-height: 58px;
  }

  body.mx-mobile-x-plugin .mx-mobile-navlink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    color: var(--text);
    border-radius: 999px;
    position: relative;
    text-decoration: none;
  }

  body.mx-mobile-x-plugin .mx-mobile-navlink.is-active {
    color: #ffffff;
  }

  body.mx-mobile-x-plugin .mx-mobile-navlink.is-active svg,
  body.mx-mobile-x-plugin .mx-mobile-navlink.is-active img {
    transform: scale(1.03);
  }

  body.mx-mobile-x-plugin .mx-mobile-navlink svg {
    width: 27px;
    height: 27px;
    display: block;
  }

  body.mx-mobile-x-plugin .mx-mobile-navlink .mx-mobile-nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid transparent;
    object-fit: cover;
    display: block;
  }

  body.mx-mobile-x-plugin .mx-mobile-navlink.is-active .mx-mobile-nav-avatar {
    border-color: #ffffff;
  }

  body.mx-mobile-x-plugin .mx-mobile-compose-fab {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 65;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    border: 0;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 30px rgba(29, 155, 240, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  body.mx-mobile-x-plugin .mx-mobile-compose-fab svg {
    width: 28px;
    height: 28px;
    display: block;
  }

  body.mx-mobile-x-plugin .mx-userbar,
  body.mx-mobile-x-plugin .mx-acct-menu,
  body.mx-mobile-x-plugin #mx-more-menu {
    display: none !important;
  }
}
