.mobile-integrations {
  display: none;
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .rail {
    display: none;
  }

  header,
  body.rail-expanded header {
    left: 0;
    height: 52px;
    padding: 0 12px;
  }

  main,
  body.rail-expanded main {
    width: 100%;
    margin-left: 0;
    padding: 56px 0 calc(76px + env(safe-area-inset-bottom));
  }

  .board-topbar {
    min-height: 52px;
    padding-inline: 10px;
  }

  .board-topbar select,
  .board-topbar .toolbar-check {
    min-height: 44px;
  }

  .board-breadcrumb {
    display: none;
  }

  .board-topbar-spacer {
    min-width: 2px;
  }

  .board-add {
    position: sticky;
    left: 10px;
    z-index: 1;
    order: -1;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    padding-inline: 11px;
  }

  .board-add svg {
    width: 20px;
    height: 20px;
  }

  .board-add span {
    display: none;
  }

  .workspace.board {
    width: 100%;
    padding-inline: 0;
  }

  .board-columns {
    width: 100%;
    padding: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .board-columns::-webkit-scrollbar {
    display: none;
  }

  .workspace.board .column {
    flex-basis: 100%;
    min-width: 100%;
    min-height: calc(100vh - 150px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .mobile-stage-nav {
    position: fixed;
    z-index: 6;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 8px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(62px, .9fr);
    gap: 3px;
    padding: 5px;
    border: 1px solid rgba(203, 206, 211, .9);
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 28px rgba(29, 32, 36, .18);
    backdrop-filter: blur(12px);
  }

  .mobile-stage-nav button {
    display: grid;
    min-width: 0;
    min-height: 48px;
    place-content: center;
    gap: 1px;
    padding: 4px 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    line-height: 1.1;
  }

  .mobile-stage-nav button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-stage-nav button b {
    font-size: 11px;
  }

  .mobile-stage-nav button.active {
    background: #e8eef8;
    color: var(--brand);
  }

  .mobile-stage-nav .mobile-attention-entry {
    border-left: 1px solid var(--line);
    border-radius: 0 10px 10px 0;
    color: #97590f;
  }

  .page-attention {
    padding-bottom: 72px;
  }

  .page-attention .attention-queue {
    padding: 12px;
  }

  .page-attention .attention-queue>header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-attention .attention-queue .card {
    max-width: none;
  }

  .drawer {
    right: 0;
    width: 100vw;
    max-width: none;
    padding: 0;
    border-radius: 18px 18px 0 0;
    transform: translateY(102%);
    transition: transform .22s ease;
    overflow: hidden;
  }

  .drawer.open {
    right: 0;
    transform: translateY(0);
  }

  .drawer-head {
    position: sticky;
    z-index: 4;
    top: 0;
    min-height: 68px;
    margin: 0;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    background: #fff;
  }

  .drawer-head h2 {
    max-width: calc(100vw - 76px);
    margin: 0;
    overflow: hidden;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .drawer-head button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
  }

  #drawerBody {
    height: calc(100dvh - 68px - env(safe-area-inset-top));
    padding: 0 12px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .drawer-tabs {
    top: 0;
    gap: 2px;
    margin: 0 -12px;
    padding: 8px 12px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .drawer-tabs::-webkit-scrollbar {
    display: none;
  }

  .drawer-tabs button {
    flex: 0 0 auto;
    min-height: 44px;
    padding-inline: 12px;
    white-space: nowrap;
  }

  .drawer .detail-block {
    margin: 10px 0;
    padding: 12px;
  }

  .drawer button,
  .drawer input,
  .drawer select,
  .drawer textarea {
    min-height: 44px;
  }

  .drawer .mail-bubble {
    width: 92%;
    max-width: none;
  }

  .drawer .mail-attachments a {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-integrations {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .board-columns {
    scroll-behavior: auto;
    transition: none;
  }
}
