@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .container {
    padding-top: env(safe-area-inset-top, 14px);
    padding-bottom: env(safe-area-inset-bottom, 24px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  .timeline-section {
    min-height: calc(100dvh - 180px);
  }

  .card {
    padding: 12px;
  }

  .timeline-section {
    padding: 0;
    border-left: none;
    border-right: none;
    border-radius: 0;
    box-shadow: none;
  }

  .top-content h1 {
    margin-top: 14px;
  }

  .timeline-header {
    padding: 18px 10px 0;
    align-items: center;
    gap: 8px;
  }

  .timeline-title-edit {
    width: 34px;
    height: 34px;
  }

  .timeline-title-edit svg.icon {
    width: 18px;
    height: 18px;
  }

  .timeline-topbar {
    padding-right: 10px;
  }

  .timeline-right-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .timeline-zoom-controls {
    margin-right: 8px;
    gap: 10px;
  }

  .timeline-zoom-btn {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
  }

  .mobile-viewer-menu-btn {
    width: 60px;
    height: 60px;
  }

  .mobile-viewer-menu-wrap {
    right: 16px;
    bottom: 34px;
  }

  .mobile-viewer-action-btn {
    font-size: 0.92rem;
    padding: 10px 12px;
  }

  .mobile-viewer-icon-btn {
    width: 46px;
    height: 46px;
  }

  .mobile-viewer-menu .viewer-action-icon {
    width: 20px;
    height: 20px;
  }

  body.presentation-mode:not(.viewer-mode)
    .timeline-right-controls
    .timeline-zoom-controls {
    position: fixed;
    right: 10px;
    bottom: 10px;
    margin-right: 0;
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    z-index: 40;
  }

  body.presentation-mode .timeline-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 32px);
    padding-left: 16px;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
  }

  body.presentation-mode .timeline-header h2 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    margin: 0;
  }

  .viewer-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .timeline-section h2 {
    margin: 0;
    padding: 0;
  }

  .timeline {
    padding: var(--timeline-top-padding) 10px 12px;
    gap: 10px;
    min-height: 240px;
  }

  .timeline-item {
    --timeline-item-width: min(calc(100vw - 20px), 480px);
  }

  .fab-stack {
    flex-wrap: wrap;
    justify-content: center;
  }

  body.viewer-mode .timeline-right-controls .viewer-actions,
  body.viewer-mode .timeline-right-controls .timeline-zoom-controls {
    display: none;
  }

  body.viewer-mode .timeline-zoom-controls {
    margin-right: 0;
  }

  body.viewer-mode .mobile-viewer-menu-wrap {
    display: flex;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  body:not(.viewer-mode) .mobile-viewer-menu-wrap {
    display: none;
  }

  .backup-menu {
    position: fixed;
    left: 50%;
    right: auto;
    top: clamp(96px, 16dvh, 140px);
    transform: translateX(-50%) translateY(0);
    min-width: min(360px, calc(100vw - 10px));
    width: min(360px, calc(100vw - 10px));
    z-index: 30;
  }

  .backup-menu.hidden {
    transform: translateX(-50%) translateY(-8px);
  }

  .online-save-panel .primary {
    align-self: auto;
  }

  .modal-body-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .modal-footer-actions {
    margin-top: 16px;
  }
}
