/* Phone navigation keeps source credits in its Map sources menu. */
body.dt-mobile-cockpit .map :is(.hybrid-map-attribution, .ienc-attribution) { display: none !important; }
/* Keep source credits off the phone Plan and Freight maps. */
body:is(.dt-mobile-plan, .dt-mobile-orders) .map :is(.hybrid-map-attribution, .ienc-attribution, .ol-attribution) { display: none !important; }
/* The fairway provider badge follows the same phone map presentation. */
body.dt-mobile-shell .dt-fairway-attribution { display: none !important; }
.ma-map-sources:not([open]) { display: none !important; }
body.dt-mobile-shell .ma-map-sources[open] {
  position: fixed; inset: auto 0 var(--ma-viewport-bottom, 0px); margin: 0 auto;
  width: min(100%, 560px); max-height: calc(var(--ma-viewport-height, 100dvh) - 12px);
  padding: 0; border: 1px solid var(--ma-line); border-radius: 16px 16px 0 0;
  background: var(--ma-bg); color: var(--ma-ink); font: 13px/1.5 system-ui;
  overflow: auto; box-shadow: 0 -8px 40px #102d4330;
}
body.dt-mobile-shell .ma-map-sources::backdrop { background: #102d4370; }
body.dt-mobile-shell .ma-map-sources header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--ma-line); }
body.dt-mobile-shell .ma-map-sources header button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 22px; cursor: pointer; }
body.dt-mobile-shell .ma-map-sources-content { padding: 4px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
body.dt-mobile-shell .ma-map-sources-content p { margin: 12px 0; overflow-wrap: anywhere; }
body.dt-mobile-shell .ma-map-sources-content a { color: var(--ma-blue); text-decoration: underline; }

/* Compact phone presentation. The mobile shell class follows the device breakpoint. */
body.dt-mobile-shell {
  --ma-nav-height: calc(56px + env(safe-area-inset-bottom, 0px));
  --ma-top: calc(60px + var(--ma-safe-top));
  --el-font-size-base: 13px;
  --el-font-size-small: 12px;
  --el-font-size-large: 16px;
  font-size: 13px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body.dt-mobile-shell .ma-header { min-height: 40px; padding-right: 12px; border-radius: 20px; font-size: 13px; }
body.dt-mobile-shell :is(.ma-menu-toggle, .ma-auth-back) { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 10px; }
body.dt-mobile-shell :is(.ma-header svg, .ma-nav svg, .ma-account-link img) { width: 20px; height: 20px; }
body.dt-mobile-shell .ma-nav { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
body.dt-mobile-shell .ma-nav a { min-height: 44px; gap: 2px; border-radius: 10px; font-size: 10px; }
body.dt-mobile-shell #app .navbar .user-avatar { width: 20px !important; height: 20px !important; }
body.dt-mobile-shell #app .navbar .avatar-wrapper { gap: 2px !important; }
body.dt-mobile-shell #app .navbar .avatar-wrapper::after { font-size: 10px; }
body.dt-mobile-shell :is(.el-button, .el-checkbox__label, .el-radio__label, .el-form-item__label, .el-tabs__item) { font-size: 13px !important; }
body.dt-mobile-shell :is(.el-input__wrapper, .el-select__wrapper) { min-height: 40px !important; }
body.dt-mobile-shell :is(.el-button, .el-checkbox, .el-radio, .el-switch) { min-height: 40px; }
/* Keep editable text at 16px so iOS does not zoom the whole page on focus. */
body.dt-mobile-shell :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { font-size: 16px !important; }
body.dt-mobile-shell :is(.ma-menu, .dt-account-dropdown) { font-size: 13px; }
body.dt-mobile-shell .ma-menu > header { padding: 6px 12px; }
body.dt-mobile-shell .ma-menu section :is(a, button) { min-height: 44px; padding: 8px 10px; font-size: 13px; }
body.dt-mobile-shell .dt-account-dropdown .el-dropdown-menu__item { font-size: 13px; }

/* The planner has no title above its ports: reclaim that unused header row. */
body.dt-mobile-plan { --mn-top-height: calc(108px + var(--ma-safe-top)); }
html body.dt-mobile-plan.dt-mobile-navigation .rp .rp-ports,
html body.dt-mobile-plan.dt-mobile-navigation .mn-detail-ports {
  top: calc(8px + var(--ma-safe-top)) !important;
  grid-template-columns: 16px minmax(0, 1fr) 40px !important;
  grid-template-rows: 40px 40px;
  min-height: 100px;
  gap: 4px 6px;
  padding: 8px 10px;
  border-radius: 14px;
}
html body.dt-mobile-plan .rp-ports input { height: 40px !important; min-height: 40px !important; padding: 0 9px !important; border-radius: 8px; }
html body.dt-mobile-plan .rp-ports :is(.rp-swap, .mn-route-more, .rp-mini) { width: 40px; height: 40px !important; min-width: 40px; min-height: 40px; }
body.dt-mobile-plan .rp-ports :is(.rp-swap, .mn-route-more) svg { width: 20px; height: 20px; }
body.dt-mobile-plan .rp-ports .rp-field:first-child::before { left: -21px; top: 9px; font-size: 16px; }
body.dt-mobile-plan .rp-ports > .rp-field:has([data-port=to])::before { left: -20px; top: 10px; font-size: 15px; }
body.dt-mobile-plan .mn-stops { gap: 4px; }
body.dt-mobile-plan .mn-stops .rp-via-row { grid-template-columns: 16px minmax(0, 1fr) 40px; gap: 6px; }
body.dt-mobile-plan .rp .mn-stop-menu button { padding: 6px 8px; font-size: 13px; }
body.dt-mobile-plan .rp-ports .mn-stop-menu { top: 48px; right: 10px; }
body:is(.dt-mobile-plan, .dt-mobile-cockpit) .ma-plan-tools svg { width: 18px; height: 18px; }
body:is(.dt-mobile-plan, .dt-mobile-cockpit) .ma-plan-tools :is(button, a) { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 10px; }
body:is(.dt-mobile-plan, .dt-mobile-cockpit) .ma-plan-tool-list { gap: 6px; margin-top: 6px; }
body:is(.dt-mobile-plan, .dt-mobile-cockpit) .ma-tool-label { right: 48px; padding: 5px 8px; border-radius: 10px; font-size: 11px; }
body.dt-mobile-plan .mn-route-facts > span { padding: 6px 8px; gap: 1px; border-radius: 10px; font-size: 13px; }
body.dt-mobile-plan .mn-route-facts small { font-size: 10px; }
body.dt-mobile-plan .mn-handle { height: 32px; min-height: 32px; padding: 3px 10px; font-size: 11px; }
body.dt-mobile-plan .mn-handle::before { width: 28px; height: 3px; }
body.dt-mobile-plan .mn-summary { padding: 0 14px; }
body.dt-mobile-plan .mn-duration { font-size: 15px; line-height: 21px; }
body.dt-mobile-plan :is(.mn-caption, .mn-status) { font-size: 11px; line-height: 15px; }
body.dt-mobile-plan .mn-actions { gap: 6px; margin-top: 6px; padding: 0 14px 10px; }
body.dt-mobile-plan .mn-actions button { min-height: 40px; padding: 7px 12px; border-radius: 12px; font-size: 13px; }
body.dt-mobile-plan .mn-actions svg { width: 18px; height: 18px; }
body.dt-mobile-plan .mn-actions [data-mn-details] { min-width: 100px; }
body.dt-mobile-plan .rp { font-size: 13px !important; gap: 8px !important; }
body.dt-mobile-plan .rp :is(.rp-section, .rp-options, .rp-grid) { gap: 8px; }
body.dt-mobile-plan .rp :is(.rp-note, .rp-field > label, summary, button) { font-size: 12px; }
body.dt-mobile-plan .mn-panel-label { color: var(--ma-ink); font-size: 13px; padding: 0 14px 8px; min-height: 32px; }
body.dt-mobile-plan .rp .rp-vessels button { flex-basis: 44px; min-width: 44px; min-height: 48px; padding: 4px 3px; border-radius: 10px; font-size: 10px; }
body.dt-mobile-plan .rp .rp-vessels svg { width: 18px; height: 18px; }
html body.dt-mobile-plan .rp .rp-operating label { height: 40px; background: #f8fafc !important; }
html body.dt-mobile-plan .rp .rp-operating input { height: 38px; min-height: 38px; }
html body.dt-mobile-plan .rp .rp-operating .rp-operating-unit { color: #667386; }
body.dt-mobile-plan .rp .rp-choice-top strong,
body.dt-mobile-plan .rp-detail-summary strong { font-size: 20px; }
body.dt-mobile-shell .dt-endpoint-weather .dt-ew-temp { font-size: 22px; }
body.dt-mobile-shell .dt-endpoint-weather .dt-ew-stat { padding: 8px; gap: 6px; }

/* Forward navigation: smaller instruction and voyage cards leave more chart visible. */
body.dt-mobile-cockpit .cpd-upcoming { top: calc(8px + var(--ma-safe-top)) !important; border-radius: 14px !important; }
body.dt-mobile-cockpit .cpd-map-banner { gap: 8px; padding: 10px !important; }
body.dt-mobile-cockpit .cpd-map-banner strong { font-size: 15px; line-height: 1.35; }
body.dt-mobile-cockpit .cpd-map-banner > div > span { font-size: 12px !important; }
body.dt-mobile-cockpit .cpd-next-icon { width: 36px; height: 36px; border-radius: 8px; }
body.dt-mobile-cockpit .cpd-next-icon svg { width: 21px; height: 21px; }
body.dt-mobile-cockpit .cpd-current { gap: 6px; padding: 10px !important; border-radius: 14px !important; }
body.dt-mobile-cockpit .cpd-route-select select { height: 40px; min-height: 40px; padding: 0 8px; border-radius: 8px; }
body.dt-mobile-cockpit .cpd-connection > button { min-height: 40px; padding: 5px 7px; font-size: 11px; }
body.dt-mobile-cockpit .cpd-current > [data-detail=voyage] { font-size: 12px; }
body.dt-mobile-cockpit .cpd-attention { font-size: 11px !important; line-height: 1.4; }
body.dt-mobile-cockpit .cpd-map-actions { width: 40px !important; gap: 3px; padding: 3px !important; }
body.dt-mobile-cockpit .cpd-map-actions :is([data-action="3d"], [data-action="2d"], [data-action="forward"]) { width: 32px; height: 32px; min-width: 0; min-height: 32px; padding: 3px 2px; gap: 2px; font-size: 10px; }
body.dt-mobile-cockpit .cpd-map-actions [data-action="forward"] svg { width: 14px; height: 14px; }
body.dt-mobile-cockpit .cpd-map-actions [data-action="forward"] span { display: none; }
body.dt-mobile-cockpit .cpd-map-actions .cpd-north-compass { width: 40px; height: 40px; min-height: 40px; }
body.dt-mobile-cockpit .cpd-map-actions .cpd-north-compass svg { width: 30px; height: 30px; }

/* Orders and publishing use the same compact card/form rhythm. */
body.dt-mobile-orders .section-header.header-with-controls { min-height: 46px !important; padding: 6px 12px !important; }
body.dt-mobile-orders .section-header .title { font-size: 13px; }
body.dt-mobile-orders .record-card { margin: 6px 0 !important; padding: 6px; border-radius: 10px !important; }
body.dt-mobile-orders .record-card > .el-card__body { padding: 8px !important; }
body.dt-mobile-orders .route-block .place { font-size: 12px !important; }
body.dt-mobile-orders .record-list { padding: 0 10px 10px; }
body.dt-mobile-orders .ma-order-route:not([hidden]) { padding: 8px 10px; border-radius: 12px; }
body.dt-mobile-orders .ma-order-route strong { font-size: 13px; }
body.dt-mobile-publish .ma-publish-tabs { height: 52px; padding: 6px 10px; gap: 6px; }
body.dt-mobile-publish .ma-publish-tabs :is(button, select) { min-height: 40px; border-radius: 8px; }
body.dt-mobile-publish .ma-publish-tabs button { font-size: 12px; }
body.dt-mobile-publish .publish-company-container :is(.form-float-panel, .info-panel) { top: calc(var(--ma-map-height) + 52px) !important; padding: 0 10px 10px !important; }
body.dt-mobile-publish .compact-form .el-form-item { margin-bottom: 8px !important; }
body.dt-mobile-publish .compact-form .el-form-item__label { font-size: 12px !important; line-height: 28px; }
body.dt-mobile-publish .compact-form :is(.el-input__wrapper, .el-select__wrapper, button) { min-height: 40px; }

/* Shared sheets and account screens keep readable hierarchy at the smaller scale. */
body.dt-mobile-shell :is(.dt-vessel-dialog-header, .dt-saved-voyages-header, .cpd-dialog-head) { gap: 8px; padding: 8px 12px !important; }
body.dt-mobile-shell :is(.dt-vessel-dialog-header, .dt-saved-voyages-header, .cpd-dialog-head) h2 { font-size: 15px !important; }
html body.dt-mobile-shell :is(.dt-vessel-dialog-body, .dt-saved-voyages-body, .cpd-detail-body) { padding: 12px !important; }
body.dt-mobile-shell .dt-vessel-dialog-body { gap: 10px; }
body.dt-mobile-shell .dt-vessel-dialog :is(input, select) { height: 40px; }
body.dt-mobile-shell .dt-vessel-dialog-actions { gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
body.dt-mobile-shell .dt-vessel-dialog-actions button { height: 44px; font-size: 13px; border-radius: 10px; }
body.dt-mobile-shell .dt-saved-voyages .rp :is(input:not([type=checkbox]), select) { min-height: 40px; }
body.dt-mobile-shell .el-dialog__header { padding: 14px 60px 10px 12px; }
body.dt-mobile-shell .el-dialog__title { font-size: 15px; }
body.dt-mobile-shell .el-dialog__body { padding: 12px; font-size: 13px; }
body.dt-mobile-shell .el-dialog__footer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
body.dt-mobile-shell :is(.el-select-dropdown__item, .el-dropdown-menu__item, .el-autocomplete-suggestion li) { min-height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
html body[class].dt-mobile-shell .el-card.info-panel[data-v-53e610ab] .map-info-heading strong { font-size: 13px; }
html body[class].dt-mobile-shell .el-card.info-panel[data-v-53e610ab] .map-info-actions button { padding: 6px 8px !important; font-size: 12px; }
body.dt-mobile-shell .cpd-detail-dialog :is(h2, .cpd-grid2 .cpd-value strong) { font-size: 16px; }
body.dt-mobile-shell .cpd-detail-dialog .cpd-card-title h3 { font-size: 13px; }
body.dt-mobile-shell:not(.dt-mobile-app) .el-card__body { padding: 12px; }
body.dt-mobile-shell:not(.dt-mobile-app) .el-card { margin-bottom: 10px; border-radius: 12px; }
body.dt-mobile-shell:not(.dt-mobile-app) .app-main h1 { font-size: 18px; }
body.dt-mobile-shell:not(.dt-mobile-app) .app-main h2 { font-size: 16px; }
body.dt-mobile-shell:not(.dt-mobile-app) .app-main h3 { font-size: 14px; }
body.dt-mobile-shell:not(.dt-mobile-app) :is(.el-input__wrapper, .el-select__wrapper, .el-button) { min-height: 40px; }
body.dt-mobile-auth :is(.login-form, .register-form) { padding: 20px 16px 16px !important; border-radius: 16px !important; }
body.dt-mobile-auth .title { font-size: 20px; }
body.dt-mobile-auth .ma-auth-note { margin-bottom: 18px; font-size: 13px; }
body.dt-mobile-auth .el-form-item { margin-bottom: 16px; }
body.dt-mobile-auth .el-input__wrapper { min-height: 44px !important; }
body.dt-mobile-auth :is(.login-form, .register-form) .el-button { height: 44px !important; min-height: 44px; font-size: 14px !important; }
body.dt-mobile-auth :is(.login-code, .register-code) { height: 44px; }

@media (orientation: landscape) and (max-height: 500px) {
  body.dt-mobile-shell { --ma-nav-height: calc(48px + env(safe-area-inset-bottom, 0px)); --ma-top: calc(56px + var(--ma-safe-top)); }
  body.dt-mobile-shell .ma-nav a { min-height: 38px; gap: 5px; }
  html body.dt-mobile-plan.dt-mobile-navigation .rp .rp-ports { top: calc(8px + var(--ma-safe-top)) !important; }
  body.dt-mobile-plan { --mn-top-height: calc(108px + var(--ma-safe-top)); }
  body.dt-mobile-cockpit .cpd-map-actions { width: auto !important; }
  html body.dt-mobile-cockpit.dt-cockpit.dt-map-shell .cp-workspace #map > :is(.hybrid-map-attribution, .ienc-attribution) { bottom: calc(var(--ma-nav-height) + 170px) !important; }
  html body.dt-mobile-cockpit.dt-cockpit.dt-map-shell .cp-workspace #map > .hybrid-map-attribution { bottom: calc(var(--ma-nav-height) + 190px) !important; }
  body.dt-mobile-publish .publish-company-container :is(.form-float-panel, .info-panel) { top: calc(var(--ma-top) + 52px) !important; }
}

/* Readability floor: the compact spacing stays, but phone text no longer drops
   below 11px for badges and units, or 12px for labels and secondary copy. */
html body.dt-mobile-shell .ma-nav a { font-size: 11px; }
html body.dt-mobile-shell:not(.dt-mobile-app):not(.dt-mobile-auth) #app .app-main { padding-top: calc(12px + var(--ma-safe-top)) !important; }
html body.dt-mobile-shell .layer-switcher-wrapper .el-tabs__item { font-size: 12px !important; }
html body:is(.dt-mobile-plan, .dt-mobile-cockpit) .ma-tool-label { font-size: 12px; }

html body.dt-mobile-plan .rp { font-size: 14px !important; }
html body.dt-mobile-plan .rp :is(.rp-note, .rp-field > label, summary, button, .rp-chk, .rp-account-sync, .rp-vessel-caption, .rp-starter) { font-size: 13px; }
html body.dt-mobile-plan .rp .rp-msg { font-size: 13px; }
html body.dt-mobile-plan .rp .rp-vessels button { font-size: 11px; }
/* Three side-by-side fields cannot fit readable labels at 360-390px: stack label over value. */
html body.dt-mobile-plan .rp .rp-operating label { grid-template-columns: max-content minmax(0, 1fr); grid-template-rows: 16px 24px; align-content: center; column-gap: 3px; row-gap: 0; height: 48px; padding: 3px 8px; font-size: 12px; }
html body.dt-mobile-plan .rp .rp-operating label > span:first-child { grid-row: 1; grid-column: 1; }
html body.dt-mobile-plan .rp .rp-operating .rp-operating-unit { grid-row: 1; grid-column: 2; font-size: 11px; }
html body.dt-mobile-plan .rp .rp-operating input { grid-row: 2; grid-column: 1 / -1; width: 100%; height: 24px; min-height: 24px; text-align: left; }
html body.dt-mobile-plan .mn-route-facts > span { font-size: 14px; }
html body.dt-mobile-plan .rp :is(.rp-node-meta, .rp-node-meta > span, .rp-timeline-day, .rp-step-note, .rp-status, .rp-list li, .rp-timeline-controls label) { font-size: 12px; }
html body.dt-mobile-plan .rp :is(.rp-stop time, .rp-detail-summary) { font-size: 13px; }
html body.dt-mobile-plan .rp :is(.rp-m small, .rp-m i, .rp-tag, .rp-badge) { font-size: 11px; }
html body.dt-mobile-plan .rp .rp-m b { font-size: 14px; }
html body.dt-mobile-plan .rp .rp-detail-toolbar :is(.rp-detail-summary, .rp-status) { font-size: 13px; }
html body.dt-mobile-plan .mn-route-facts small { font-size: 11px; }
html body.dt-mobile-plan .mn-duration { font-size: 17px; line-height: 23px; }
html body.dt-mobile-plan :is(.mn-caption, .mn-status) { font-size: 13px; line-height: 18px; }
html body.dt-mobile-plan .mn-actions button { font-size: 14px; }

html body.dt-mobile-cockpit :is(.cpd-mobile-voyage-heading, .cpd-mobile-metrics) small { font-size: 12px; }
html body.dt-mobile-cockpit .cpd-current .cpd-mobile-state > :is(span, button, [data-action="show-route-notices"]) { font-size: 12px; }
html body.dt-mobile-cockpit .cp-camera-position span { font-size: 11px; }
html body.dt-mobile-cockpit .cpd-map-banner > div > small { font-size: 11px; }
html body.dt-mobile-cockpit .cpd-map-actions :is([data-action="3d"], [data-action="2d"]) { font-size: 11px; }
html body.dt-mobile-cockpit .cpd-route-progress .cpr-total { font-size: 11px; }
html body.dt-mobile-cockpit .cpd-route-progress .cpr-status { font-size: 10px; }
html body.dt-mobile-cockpit .cpd-route-progress .cpr-marker small { font-size: 10px; }
html body.dt-mobile-cockpit .cpd-attention { font-size: 12px !important; }
html body.dt-mobile-cockpit .cpd-connection > button { font-size: 12px; }

html body.dt-mobile-orders .route-block .place { font-size: 14px !important; }
html body.dt-mobile-orders :is(.time-main, .date-small) { font-size: 13px; }
html body.dt-mobile-orders :is(.demo-logistics-subtitle, .demo-logistics-disclaimer) { font-size: 12px; }
html body.dt-mobile-orders .demo-logistics-notice { font-size: 12px !important; }
html body.dt-mobile-orders .demo-logistics-details { font-size: 13px; }
html body.dt-mobile-orders .demo-logistics-record .status-badge { font-size: 11px; }

/* Expanded route sheets keep the primary action reachable once the route is ready. */
html body.dt-mobile-plan.dt-mobile-navigation .map:is([data-mn-panel="routes"], [data-mn-panel="details"]) .mn-sheet-header[data-state="ready"] .mn-actions { display: flex; margin-top: 0; padding: 0 14px 10px; }
html body.dt-mobile-plan.dt-mobile-navigation .map:is([data-mn-panel="routes"], [data-mn-panel="details"]) .mn-sheet-header[data-state="ready"] .mn-actions [data-mn-details] { display: none; }
/* The sheet's back arrow already returns to route options; drop the duplicate "← Routes" link. */
html body.dt-mobile-plan.dt-mobile-navigation .rp .rp-detail-toolbar .rp-detail-head { display: none; }
html body.dt-mobile-plan.dt-mobile-navigation .rp .rp-detail-toolbar .rp-detail-summary { grid-column: 1 / -1; text-align: left; }
/* Close control injected by mobile-app.js into the phone layers sheet. */
.ma-panel-close { display: none; }
html body.dt-mobile-app .map .layer-switcher-wrapper > .layer-switcher { position: relative; }
html body.dt-mobile-app .map .layer-switcher-wrapper > .layer-switcher > .ma-panel-close { display: grid; place-items: center; position: absolute; top: 4px; right: 4px; z-index: 2; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--ma-bg, #fff); color: var(--ma-ink, #172e45); cursor: pointer; }
html body.dt-mobile-app .map .layer-switcher-wrapper > .layer-switcher > .ma-panel-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
html body.dt-mobile-app .map .layer-switcher-wrapper > .layer-switcher .el-tabs__header { padding-right: 44px; }
html body.dt-mobile-app .map .layer-switcher-wrapper .el-tabs__item { padding: 0 7px !important; }
