/* Phone presentation only. No scene, texture, icon or desktop rules. */
@media (max-width:760px), (max-width:1000px) and (max-height:600px) and (hover:none) and (pointer:coarse) {
  body.mobile-workspace {
    --mobile-sheet-max-height:min(34dvh,calc(100dvh - 284px - var(--mobile-sheet-bottom)));
  }
  body.mobile-workspace .object-info h1 {font-size:20px!important;line-height:1.35!important;}
  body.mobile-workspace #constellation-explorer .constellation-hero h1,
  body.mobile-workspace .black-hole-hero h1 {font-size:20px;line-height:1.35;}
  body.mobile-workspace #mobile-features-toggle {min-height:44px;padding:5px 8px;}
  body.mobile-workspace :is(.earth-navigation,.solar-navigation) button {min-height:40px;padding-block:6px;}
  body.mobile-workspace .black-hole-topics {gap:5px;margin-top:6px;}
  body.mobile-workspace .black-hole-topics button {min-height:40px;padding:6px 7px;font-size:12px;}

  /* The heading is the drag surface; scrolling inside the reading body is untouched. */
  body.mobile-workspace .mobile-sheet-grip {position:relative;touch-action:none;user-select:none;}
  body.mobile-workspace .mobile-sheet-grip::before {content:"";position:absolute;left:calc(50% - 14px);top:2px;width:28px;height:3px;border-radius:3px;background:#9fc8dc66;pointer-events:none;}
  body.mobile-workspace :is(.facts-toolbar,.earthsense-header,.earth-environment-header,.moon-phases-header,.constellation-card-toolbar,.earth-overview-heading,.black-hole-card-toolbar) {min-height:48px;padding:6px 10px 2px;gap:4px;}
  body.mobile-workspace :is(.mobile-read-button,.mobile-fold-button,#black-hole-read) {min-height:36px;padding:5px 7px;font-size:11px;}
  /* A smaller visible frame retains extra hit area, with separated neighbours. */
  body.mobile-workspace :is(.mobile-read-button,.mobile-fold-button,#black-hole-read,.mobile-guide-pager button) {position:relative;}
  body.mobile-workspace :is(.mobile-read-button,.mobile-fold-button,#black-hole-read)::before {content:"";position:absolute;inset:-4px 0;}
  body.mobile-workspace .mobile-reader-actions {gap:5px;}
  body.mobile-workspace :is(.earthsense-header,.earth-environment-header,.moon-phases-header) h2 {font-size:15px;line-height:1.35;}
  body.mobile-workspace :is(.earthsense-close,.earth-environment-close,.moon-phases-close) {min-width:36px;min-height:40px;height:40px;}
  body.mobile-workspace :is(.mobile-reader,.black-hole-card,.destination-dock,.constellation-dock,.black-hole-dock) {border-radius:14px!important;}
  body.mobile-workspace :is(.facts-content,#black-hole-card-content) {padding:0 12px 10px;}
  body.mobile-workspace #facts-name {font-size:18px;line-height:1.4;}
  body.mobile-workspace .mobile-reader .facts-identity {margin:4px 0;gap:10px;}
  body.mobile-workspace .mobile-reader .facts-summary {font-size:13px;line-height:1.6;margin:8px 0;}
  body.mobile-workspace .facts-panel .object-stats {padding-block:10px;gap:10px;}
  body.mobile-workspace .facts-panel .object-stats dd {font-size:13px;}
  body.mobile-workspace :is(.facts-sections section,.learning-reading-section) {margin-block:12px;}
  body.mobile-workspace :is(.facts-sections p,.constellation-card-body p,.learning-reading-section p) {font-size:13px;line-height:1.65;}
  body.mobile-workspace :is(.facts-sections h3,.constellation-card-body h3,.learning-reading-section h3) {font-size:13px;line-height:1.5;}
  body.mobile-workspace .black-hole-card {max-height:var(--mobile-sheet-max-height);}
  body.mobile-workspace .black-hole-card.is-reading {max-height:none;}
  body.mobile-workspace #black-hole-card-content h2 {font-size:18px;line-height:1.4;margin:4px 0;}
  body.mobile-workspace .black-hole-context {margin:6px 0 4px;}
  body.mobile-workspace .black-hole-latin {margin:4px 0 8px;}
  body.mobile-workspace .black-hole-summary {font-size:13px;line-height:1.6;margin:8px 0 12px;}
  body.mobile-workspace .black-hole-facts {padding-block:10px;gap:12px;}
  body.mobile-workspace #black-hole-card-content section {margin-block:12px;}
  body.mobile-workspace #black-hole-card-content section p {font-size:12px;line-height:1.65;}
  body.mobile-workspace #constellation-explorer .constellation-card-identity h2 {font-size:18px;}
  body.mobile-workspace #constellation-explorer .constellation-card-content {padding:0 4px 8px;}
  body.mobile-workspace .earthsense-content {padding-inline:10px;}
  body.mobile-workspace .earthsense-continent-card {padding:10px;}
  body.mobile-workspace .earthsense-continent-card h3 {font-size:18px;}
  body.mobile-workspace .earthsense-continent-card p {font-size:12px;line-height:1.65;}
  body.mobile-workspace .earthsense-continent-options button {min-height:40px;padding:6px;font-size:12px;}

  /* Two compact header rows instead of a full-width search row and a third tab row. */
  body.mobile-workspace .destination-dock:not(.dock-collapsed) {padding:6px 10px 8px;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .dock-heading {grid-template-columns:minmax(112px,1fr) minmax(70px,.8fr) 58px;gap:4px 6px;padding:0;margin:0;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .dock-heading>span {grid-column:1 / 3;grid-row:1;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .dock-collapse {grid-column:3;grid-row:1;min-height:40px;padding:5px 8px;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .dock-tabs {grid-column:1;grid-row:2;min-width:0;gap:2px;}
  body.mobile-workspace .destination-dock .dock-tabs button {min-height:40px;padding:5px 6px;font-size:11px;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .destination-search {grid-column:2 / -1;grid-row:2;min-width:0;margin:0;width:100%;}
  body.mobile-workspace .destination-dock .destination-search input {min-height:40px;height:40px;padding-block:6px;}
  body.mobile-workspace .destination-dock .destination-list {min-height:80px;padding:4px 0 0;gap:5px;}
  body.mobile-workspace .destination-dock .destination-list>button {flex-basis:80px;width:80px;height:80px;min-height:80px;gap:2px;padding:4px 3px;}
  body.mobile-workspace .destination-dock .destination-name {font-size:11px;line-height:1.4;min-height:31px;}
  body.mobile-workspace #constellation-explorer .constellation-destination {min-height:78px;padding:5px 4px;}
  body.mobile-workspace #black-hole-destinations button {min-height:80px;flex-basis:88px;padding:5px 4px;}
  body.mobile-workspace #black-hole-destinations strong {font-size:12px;}

  /* Keep the search and the first results visible; secondary tools remain one tap away. */
  body.mobile-workspace .earthsense-panel[data-layer="places"][data-mobile-reading="compact"] .earthsense-toolbar {display:none;}
  body.mobile-workspace .earthsense-panel[data-mobile-reading="compact"] .earthsense-places-tools {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 6px;}
  body.mobile-workspace .earthsense-place-search {grid-column:1 / -1;margin:3px 0 0;}
  body.mobile-workspace .earthsense-query-wrap {min-height:40px;}
  body.mobile-workspace .earthsense-query-wrap input {min-height:40px;height:40px;padding-block:6px;}
  body.mobile-workspace .earthsense-query-wrap button {min-height:40px;padding:5px 10px;}
  body.mobile-workspace .earthsense-place-results {grid-column:1;grid-row:2;align-self:center;font-size:10px;line-height:1.5;margin:4px 0;}
  body.mobile-workspace .mobile-place-options {grid-column:2;grid-row:2;margin:0;min-width:0;}
  body.mobile-workspace .mobile-place-options>summary {min-height:40px;display:flex;align-items:center;justify-content:flex-end;gap:6px;padding:4px 8px;cursor:pointer;color:#b9dce9;font-size:12px;list-style:none;}
  body.mobile-workspace .mobile-place-options>summary::-webkit-details-marker {display:none;}
  body.mobile-workspace .mobile-place-options>summary::after {content:'⌄';}
  body.mobile-workspace .mobile-place-options[open] {grid-column:1 / -1;grid-row:3;padding:0 6px 6px;border:1px solid #7bd1ff33;border-radius:9px;}
  body.mobile-workspace .mobile-place-options[open]>summary::after {content:'⌃';}
  body.mobile-workspace .mobile-place-options:focus-within {outline-color:#9ddfeb;}
  body.mobile-workspace .earthsense-region-filter {margin:2px 0 6px;}
  body.mobile-workspace .earthsense-tabs {margin-bottom:2px;padding:2px;}
  body.mobile-workspace .earthsense-tabs button {min-height:40px;padding-block:6px;font-size:12px;}
  body.mobile-workspace .earthsense-panel[data-mobile-reading="compact"] .earthsense-row {min-height:48px;padding:5px 8px;}
  body.mobile-workspace .earthsense-place-group summary {min-height:44px;padding:7px 10px;font-size:12px;}
  body.mobile-workspace .earthsense-list {gap:4px;}

  /* Chapter navigation belongs to the lesson, not the already busy scene bar. */
  body.mobile-workspace #guide-panel #guide-lesson {padding:4px 10px;}
  body.mobile-workspace #guide-panel .guide-lesson-heading {padding-top:6px;min-height:46px;}
  body.mobile-workspace #guide-panel .guide-lesson-toggle {min-height:36px;padding:5px 7px;font-size:11px!important;}
  body.mobile-workspace #guide-panel #guide-title {font-size:17px;margin:2px 0 6px;}
  body.mobile-workspace #guide-panel .guide-copy {font-size:13px;line-height:1.6;margin-bottom:8px;}
  body.mobile-workspace .mobile-guide-pager {display:flex;flex:none;gap:8px;padding:4px 0 2px;border-top:1px solid #7bd1ff26;}
  body.mobile-workspace .mobile-guide-pager button {flex:1;min-height:40px;padding:5px 10px;font-size:12px;}
  body.mobile-workspace .mobile-guide-pager button::before {content:"";position:absolute;inset:-2px 0;}
  body.mobile-workspace .mobile-guide-pager[hidden] {display:none;}
  body.mobile-workspace #guide-panel>.mobile-guide-pager {position:fixed;left:12px;right:12px;bottom:var(--mobile-sheet-bottom);padding:4px 8px;border:1px solid #7bd1ff33;border-radius:12px;background:#08172bf5;}
  body.mobile-workspace #guide-panel.mobile-guide-chapters-open>.mobile-guide-pager {display:none;}
  body.mobile-workspace :is(.mobile-setting-group>button,.mobile-menu-items>button) {font-size:12px;padding:6px;}
  body.mobile-workspace .constellation-library-header h2 {font-size:20px;}
  body.mobile-workspace .constellation-library-tile-copy strong {font-size:13px;}
  body.mobile-workspace #catalog-dialog .catalog-top h2 {font-size:19px;}
  body.mobile-workspace #catalog-dialog .catalog-card {min-height:80px;padding:8px;}
}

/* Short landscape retains the existing side-sheet layout. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (max-width:1000px) and (max-height:600px) and (hover:none) and (pointer:coarse) and (orientation:landscape) {
  body.mobile-workspace .black-hole-card {max-height:none;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .dock-heading {grid-template-columns:minmax(0,1fr) 58px;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .dock-collapse {grid-column:2;grid-row:1;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .dock-tabs {grid-column:1;grid-row:1;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .dock-heading>span {grid-column:2;grid-row:2;}
  body.mobile-workspace .destination-dock:not(.dock-collapsed) .destination-search {grid-column:1;grid-row:2;}
}
