/* D-057 P3: layout and navigation only, after mobile.css and mobile-p2.css. */
@media (max-width: 880px) {
  body.mobile-journey #app,
  body.mobile-journey #app.map-hidden,
  body.mobile-journey #app.map-big {
    grid-row: 2;
    display: block;
    min-width: 0;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  body.mobile-journey #main-panel {
    display: grid;
    grid-template-rows: var(--mobile-step-height) minmax(0, 1fr) auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
  }

  body.mobile-journey #main-panel > #panel {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 14px max(16px, var(--mobile-safe-right))
      20px max(16px, var(--mobile-safe-left));
  }

  body.mobile-journey #main-panel > .panel-foot,
  body.mobile-journey #view-project #project-controls > .project-terrain,
  body.mobile-journey #mapwrap {
    display: none;
  }

  body.mobile-journey #mobile-journey-footer {
    display: grid;
    gap: 8px;
    padding: 8px max(16px, var(--mobile-safe-right))
      calc(8px + var(--mobile-safe-bottom)) max(16px, var(--mobile-safe-left));
    border-top: 1px solid var(--line);
    background: var(--panel);
  }

  body.mobile-journey #mobile-journey-primary-slot > .panel-foot {
    position: static;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.mobile-journey .panel-foot .actions {
    display: block;
  }

  body.mobile-journey #footer-status {
    display: none;
  }

  body.mobile-journey #mobile-journey-footer .btn {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.3;
  }

  body.mobile-journey #mobile-journey-footer #mobile-footer-map-view {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 14px;
  }

  body.mobile-journey .mobile-journey-summary {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--green);
    border-radius: 10px;
    background: var(--card);
  }

  body.mobile-journey #mobile-journey-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  body.mobile-journey .mobile-journey-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
  }

  body.mobile-journey .mobile-journey-facts > div {
    display: grid;
    align-content: start;
    min-width: 0;
    gap: 3px;
  }

  body.mobile-journey .mobile-journey-facts > div:last-child {
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  body.mobile-journey .mobile-journey-facts dt {
    color: var(--ink-3);
    font-size: 12px;
  }

  body.mobile-journey .mobile-journey-facts dd {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  body.mobile-journey .mobile-journey-facts #mobile-journey-vocation {
    font-size: 14px;
    font-weight: 500;
  }

  body.mobile-journey .mobile-journey-summary .help {
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  body.mobile-journey #mobile-journey-map-view {
    justify-self: start;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
  }

  body.mobile-terrain #mobile-selection-scope-slot:empty {
    display: none;
  }

  body.mobile-map-recall #mobile-map-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: var(--panel);
    color: var(--ink);
  }

  body.mobile-map-recall #mobile-map-dialog[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  body.mobile-map-recall #mobile-map-dialog .mobile-map-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(10px + var(--mobile-safe-top)) max(12px, var(--mobile-safe-right))
      10px max(12px, var(--mobile-safe-left));
    border-bottom: 1px solid var(--line);
  }

  body.mobile-map-recall #mobile-map-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
  }

  body.mobile-map-recall #mobile-map-dialog .mobile-map-foot {
    display: grid;
    gap: 8px;
    padding: 10px max(12px, var(--mobile-safe-right))
      calc(10px + var(--mobile-safe-bottom)) max(12px, var(--mobile-safe-left));
    border-top: 1px solid var(--line);
  }

  body.mobile-map-recall #mobile-map-dialog .btn {
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 15px;
    line-height: 1.3;
  }

  body.mobile-map-recall #mobile-map-slot,
  body.mobile-map-recall #mobile-map-dialog #mapwrap {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 0;
  }

  body.mobile-map-recall #mobile-map-dialog #map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  body.mobile-journey #work-type-dialog {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    overflow: hidden;
    border: 0;
  }

  body.mobile-journey #work-type-dialog .work-volet {
    height: 100%;
    min-height: 0;
  }

  body.mobile-journey #work-type-dialog .work-volet-head {
    flex: none;
    padding-top: calc(12px + var(--mobile-safe-top));
  }

  body.mobile-journey #work-type-dialog .work-search {
    flex: none;
  }

  body.mobile-journey #work-type-search {
    min-height: 48px;
    font-size: 16px;
  }

  body.mobile-journey #work-type-close,
  body.mobile-journey #work-type-search-clear {
    min-width: 44px;
    min-height: 44px;
  }

  body.mobile-journey #work-type-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(16px + var(--mobile-safe-bottom));
  }
}
