/* Mobile reading layout, loaded after the desktop application styles. */
.mobile-navigation { display: none; }

@media screen and (max-width: 700px), screen and (max-width: 900px) and (max-height: 500px) {
  .window, .window.expanded {
    grid-template-rows: 44px 52px minmax(0, 1fr);
  }
  .window .titlebar { height: 44px; }
  .window .addressbar, .window .statusbar { display: none; }
  .window .commandbar { padding: 4px 8px; gap: 8px; }
  .command-divider, .command-meta, .search-box kbd { display: none; }
  .command-group button { width: 44px; height: 44px; }
  #go-up, #refresh-view { display: none; }
  .search-box { min-width: 0; max-width: none; }
  .search-box input { font-size: 16px; min-height: 40px; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .window .sidebar { padding: 4px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar > p, .sidebar-bottom, .enhanced .sidebar nav { display: none; }
  .mobile-navigation { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #526b85; }
  .mobile-navigation select { flex: 1; min-width: 0; min-height: 44px; padding: 8px; font: inherit; font-size: 16px; color: #175a94; background: white; border: 1px solid #ccd8e5; border-radius: 5px; }
  .pages { scrollbar-gutter: auto; }
  .page { padding: 22px 18px 32px; overflow-wrap: anywhere; }
  .hero-grid, .comparison, .furniture-panel, .measure-grid, .timeline, .gallery { grid-template-columns: minmax(0, 1fr); }
  .hero-grid > *, .page > *, .labour-metrics article > * { min-width: 0; }
  .hero-grid h1, .compact-window .hero-grid h1 { font-size: clamp(34px, 10vw, 44px); }
  .hero-grid p, .page > p, .question-list p, .comparison p, .measure-grid p { font-size: 16px; line-height: 1.65; }
  .evidence-strip { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .evidence-strip > div { border: 0; border-bottom: 1px solid #ccdaea; padding: 0 0 12px; }
  .evidence-strip > div > span { font-size: 14px; }
  .stat-grid article { display: block; }
  .labour-metrics article { display: block; }
  .labour-metrics strong { margin: 10px 0; }
  .table-scroll { max-width: 100%; overflow-x: auto; }
  .filters button, .button-row > *, .browser-page-controls button, summary { min-height: 44px; }
  .window-actions button, .fuentes-titlebar .window-actions button, .browser-titlebar .window-actions button { width: 44px; height: 44px; flex-shrink: 0; }
  #maximize, #browser-maximize { display: none; }
  .taskbar { gap: 0; }
  .taskbar-center { flex: 1; overflow-x: auto; }
  .taskbar-center > *, .browser-task { min-width: 44px; min-height: 44px; flex-shrink: 0; }
  .weather-widget { min-width: 44px; min-height: 44px; }
  .weather-widget > span:last-child { display: none; }
  .task-date { min-height: 44px; }
  .fuentes-titlebar { min-height: 44px; }
  .source-browser { grid-template-rows: 44px 48px 52px minmax(0, 1fr) 26px; }
  .browser-tabs button { min-height: 44px; }
  .browser-toolbar > button { min-width: 44px; height: 44px; }
  #browser-home, #browser-reload { display: none; }
  .browser-address input { font-size: 16px; }
  .browser-toolbar > a { min-height: 44px; display: flex; align-items: center; }
  .browser-profile p, .browser-word-reading p { font-size: 16px; }
  .photos-toolbar-right > *, #viewer-zoom, .photos-nav { min-width: 44px; min-height: 44px; }
  .photos-thumbnails button { height: 44px; }
  .photos-toolbar { flex-wrap: wrap; }
  .photos-meta p { font-size: 13px; }
  .desktop-icons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    left: 12px;
    right: 12px;
    top: 56px;
    width: auto;
    gap: 12px;
    max-height: calc(100dvh - 130px);
    overflow-y: auto;
    padding: 4px;
  }
  .desktop-icons > a { min-width: 0; min-height: 100px; justify-content: center; text-align: center; overflow-wrap: anywhere; }
  .desktop-message { display: none; }
}

@media screen and (max-width: 900px) and (max-height: 500px) {
  .window, .window.expanded { grid-template-rows: 44px minmax(0, 1fr); }
  .window .commandbar { display: none; }
  .desktop-header { visibility: hidden; }
}
