@media screen and (max-width: 900px) {
  .app-shell { display: block; }
  .app-shell .sidebar {
    display: flex; position: static; width: 100%; height: auto;
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px clamp(12px, 3vw, 24px);
  }
  .sidebar .brand { margin: 0; max-width: 47%; }
  .sidebar :is(.side-label, .side-nav, .side-bottom), .public-nav .public-links { display: none; }
  .sidebar .mobile-brand, .public-nav .public-actions { display: flex; align-items: center; gap: 8px; padding: 0; }
  .mobile-brand a { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; }
  .mobile-menu { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 8px; }
  .sidebar .mobile-menu { color: var(--ivory); }
  .app-body, .modal, main, fieldset, .field { min-width: 0; }
  .app-body { margin-left: 0; }
  .modal-backdrop { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .modal { max-height: 90vh; max-height: 90dvh; overscroll-behavior: contain; overflow-wrap: anywhere; }
  .modal-close { min-width: 44px; min-height: 44px; }
  :is(.btn, .textlink, .resource-list a, .resource-list button, .mobile-journey-links a, summary) { min-height: 44px; }
  :is(input:not([type=checkbox],[type=radio]), select, textarea) { max-width: 100%; min-width: 0; font-size: max(1rem, 16px); }
  :is(input:not([type=checkbox],[type=radio]), select) { min-height: 44px; }
  .check-option { min-height: 44px; }
  .ac-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 12px; white-space: normal; }
  .ac-tabs a { min-height: 44px; display: flex; align-items: center; }
  .wx-workspace, .app-body, .modal { overflow-wrap: break-word; }
  .wx-actions, .wx-actions>.row, .modal-actions, .library-pagination { flex-wrap: wrap; }
  .wx-written, .studio-upload-text, .wx-file-text { white-space: pre-wrap; overflow-wrap: anywhere; }
  :is(.ac-image-preview,.ac-pdf-preview,.studio-pdf-paper img,.wx-file-image) { max-width: 100%; }
}
@media screen and (max-width: 640px) {
  .modal { padding: 22px 16px; }
  .modal h2:first-of-type { padding-right: 32px; }
  .ac-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .wx-actions { display: grid; gap: 12px; }
  .wx-actions>.row { justify-content: flex-start; }
  .wx-workspace :is(.wx-heading, .wx-message, .wx-resource, .wx-file-row) { min-width: 0; overflow-wrap: anywhere; }
  .wx-message header > div, .row > .field { min-width: 0; }
  .hero-portrait img { height: auto; aspect-ratio: 4 / 5; }
  .modal-actions > .btn { flex: 1 1 10rem; }
  .library-main-filters, .studio-case-layout, .studio-guide-grid { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; transition-duration: 0s!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; }
}
@media screen and (max-width: 640px) {
  .sim-layout { grid-template-columns: minmax(0, 1fr); }
  .sim-layout > *, .sim-layout .panel { min-width: 0; }
  .sim-layout .panel-head, .sim-form .row { flex-wrap: wrap; }
  .data-wrap { max-width: 100%; overflow-x: auto; }
}
