.m-topbar, .m-bottom, .m-scrim, .m-drawer { display: none; }

html.phone .sidebar { display: none !important; }
html.phone .m-topbar,
html.phone .m-bottom { display: flex !important; }
html.phone body {
  flex-direction: column !important;
  padding-top: 52px !important;
  padding-bottom: 64px !important;
}
html.phone .main {
  margin-left: 0 !important;
  padding: 12px !important;
  width: 100% !important;
  max-width: none !important;
}
html.phone body.nav-open .m-drawer { display: flex !important; }
html.phone body.nav-open .m-scrim { display: block !important; }

.m-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 52px; background: #111; color: #fff;
  z-index: 500; align-items: center; gap: 10px; padding: 0 10px;
}
.m-topbar .m-brand { font-weight: 800; font-size: .82rem; flex: 1; letter-spacing: .06em; }
.m-topbar .m-hamb, .m-topbar .m-user {
  border: 0; background: #2a2a2a; color: #fff;
  width: 40px; height: 40px; border-radius: 10px; font-size: 1.15rem;
}
.m-scrim {
  position: fixed; top: 52px; bottom: 58px; left: 0; right: 0;
  background: rgba(0,0,0,.45); z-index: 480;
}
.m-drawer {
  position: fixed; top: 52px; bottom: 58px; left: 0;
  width: min(82vw, 300px);
  background: #161616; color: #fff;
  z-index: 490; overflow-y: auto;
  padding: 8px 0 16px;
  flex-direction: column;
}
.m-drawer-title {
  margin: 4px 14px 8px; font-size: 12px; color: #888;
  letter-spacing: .08em; text-transform: uppercase;
}
.m-drawer button {
  display: block; width: 100%;
  border: 0; background: none;
  color: #fff !important;
  text-align: left;
  padding: 12px 16px;
  font-size: 16px !important;
  line-height: 1.3;
}
.m-drawer button:active { background: #2a2a2a; }
.m-bottom {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 58px; background: #111; z-index: 500;
  border-top: 1px solid #333;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.m-bottom button {
  flex: 1; border: 0; background: none; color: #9aa;
  font-size: .65rem; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.m-bottom button .ico { font-size: 1.15rem; }
.m-bottom button.on { color: #fff; }

@media (max-width: 920px) {
  .sidebar { display: none !important; }
  .m-topbar, .m-bottom { display: flex !important; }
  body {
    flex-direction: column !important;
    padding-top: 52px !important;
    padding-bottom: 64px !important;
  }
  .main {
    margin-left: 0 !important;
    padding: 12px !important;
    width: 100% !important;
  }
  body.nav-open .m-drawer { display: flex !important; }
  body.nav-open .m-scrim { display: block !important; }
  .dash-grid { grid-template-columns: 1fr !important; }
  .kanban-col { min-width: 80vw; flex: 0 0 auto; }
  .prio-cols { overflow-x: auto; display: flex; gap: 10px; }
  .trello-modal, .modal {
    max-width: 100% !important; width: 100% !important;
    max-height: 90vh; border-radius: 16px 16px 0 0;
  }
  .modal-overlay.show { align-items: flex-end; }
  input, select, textarea { font-size: 16px !important; }
}

html.phone .modal-overlay {
  z-index: 700 !important;
  align-items: flex-end !important;
}
html.phone .modal-overlay .modal,
html.phone .trello-modal {
  width: 100% !important;
  max-width: 100% !important;
  max-height: calc(100dvh - 120px) !important;
  padding: 16px 16px 88px !important;
  overflow-y: auto !important;
}
html.phone .modal .btn-group {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  background: #fff;
  padding: 12px 0 6px;
}
html.phone .modal .btn-group .btn { flex: 1; min-height: 44px; }
html.phone .modal .form-row { flex-direction: column; }

@media (max-width: 920px) {
  .modal-overlay { z-index: 700 !important; align-items: flex-end !important; }
  .modal-overlay .modal, .trello-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 120px) !important;
    padding: 16px 16px 88px !important;
    overflow-y: auto !important;
  }
  .modal .btn-group {
    position: sticky; bottom: 0; display: flex; gap: 8px;
    background: #fff; padding: 12px 0 6px;
  }
  .modal .btn-group .btn { flex: 1; min-height: 44px; }
  .modal .form-row { flex-direction: column; }
}
