/* JNET mobile candidate: CSS-only responsive layer, max-width 720px. */
@media screen and (max-width: 720px) {
  html, body { min-width: 320px; width: 100%; }
  body { height: auto !important; min-height: 100%; overflow-x: hidden !important; overflow-y: auto !important; }
  .app, .sap-app {
    display: block !important; width: 100%; max-width: 100%; height: auto !important;
    min-height: 100dvh !important; grid-template-columns: minmax(0, 1fr) !important;
    overflow: visible !important;
  }
  .rail, .sap-rail {
    display: block !important; position: sticky !important; top: 0; z-index: 100;
    width: 100%; max-width: 100%; max-height: none; height: auto;
    padding: 8px 10px !important; border-right: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.12); overflow: hidden !important;
    backdrop-filter: blur(14px);
  }
  .railCard { padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
  .railCard > :not(.railTitle), .railBottom, .timeGrid, .sap-clock { display: none !important; }
  .nav, .sap-nav {
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
    gap: 7px !important; margin: 7px 0 0 !important; padding: 0 0 4px !important;
    max-width: 100%; overflow-x: auto !important; overflow-y: hidden !important;
    overscroll-behavior-x: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  }
  .navBtn, .sap-nav a {
    display: flex; flex: 0 0 auto !important; align-items: center; width: auto; min-width: 148px;
    max-width: 84vw; min-height: 44px; padding: 9px 11px !important; white-space: nowrap;
  }
  .sap-profile { display: block !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
  .sap-profile > :not(.sap-wordmark) { display: none !important; }
  body.modalOpen { overflow: hidden !important; }
  .content, .sap-content {
    width: 100%; max-width: 100%; min-width: 0 !important; height: auto !important;
    min-height: 0 !important; overflow: visible !important; padding: 12px 10px 24px !important;
  }
  .topbar, .sap-classification { position: relative !important; top: auto !important; max-width: 100%; flex-wrap: wrap; gap: 8px; }
  .topbarLeft, .topbarRight { min-width: 0 !important; max-width: 100%; flex-wrap: wrap; }
  .pageWrap, .bodyGrid, .planningShell, .directoryLayout, .workspaceGrid { min-width: 0 !important; max-width: 100%; }
  .tableWrap, .tableWrapper, .tableContainer, .tableScroll, .tableScroller, .responsiveTable {
    max-width: 100%; overflow-x: auto !important; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  }
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  button, .btn, .miniBtn, .action, .navBtn, .sap-nav a { min-height: 44px; }
  button, input, select, textarea, .btn, .miniBtn, .action { max-width: 100%; touch-action: manipulation; }
  input, select, textarea { font-size: 16px; }
  img, iframe, video { max-width: 100%; }
  .modal, .modalCard, .modalPanel, .modalContent, .dialog { max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); overflow-y: auto; }
}
@media screen and (max-width: 720px) {
  /* Planning board: retain the hidden desktop rail as a compact mobile route bar. */
  .planningShell { grid-template-columns: minmax(0, 1fr) !important; overflow: visible !important; flex: none !important; }
  .planningShell > .panel { min-height: 0 !important; overflow: visible !important; }
  .canvasWrap { height: min(72vh, 640px) !important; min-height: 320px !important; flex: none !important; }
  .toolGrid.three { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .phoneStage, .phoneShell, .phoneBezel, .phoneScreen, .phoneBody, .phoneView { max-width: 100% !important; }
  .umGrid { grid-template-columns: minmax(0, 1fr) !important; }
  .userList { height: min(42vh, 330px) !important; min-height: 190px; }
  .umHead { display: block; }
  .umStatus { min-width: 0 !important; max-width: 100%; height: auto !important; min-height: 44px; margin-top: 12px; white-space: normal; line-height: 1.4; }
  .umPanelBody { min-width: 0; }
}
@media screen and (max-width: 520px) {
  .directoryLegend { display: none !important; }
  .userRow { grid-template-columns: minmax(0, 1fr) !important; gap: 5px !important; }
  .userDivider { display: none !important; }
  .userName, .userEmail { min-width: 0; white-space: normal !important; overflow-wrap: anywhere; }
  .umTabs { flex-wrap: wrap; }
  .umTab { min-height: 44px; }
  .canvasWrap { min-height: 280px !important; }
}
