@media (max-width: 1180px) {
  /* Keep existing-media cards readable on Windows/Chromium widths where
     the two-column layout makes the filename and actions collide. */
  .media-chip {
    grid-template-columns: 1fr;
  }

  .media-chip-actions {
    justify-content: flex-start;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-sheet-grid {
    grid-template-columns: 1fr;
  }

  .editor-side-stack {
    position: static;
  }

  .content-grid,
  .content-grid-lg,
  .dashboard-secondary-grid,
  .dashboard-live-grid {
    grid-template-columns: 1fr;
  }

  .live-connect-row {
    grid-template-columns: 1fr;
  }

  .tool-card-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-trailing {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .dashboard-gift-entry {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .dashboard-gift-button {
    width: 100%;
    margin-left: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .editor-overlay {
    padding: 0;
  }

  .editor-sheet {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .dialog-sheet {
    width: min(100%, 560px);
    height: auto;
    max-height: calc(100vh - 24px);
    border-radius: 28px;
  }

  .editor-sheet-header,
  .editor-sheet-body,
  .editor-sheet-footer {
    padding: 18px;
  }

  .dialog-sheet-header,
  .dialog-sheet-body,
  .dialog-sheet-footer {
    padding: 18px;
  }

  .editor-block-head,
  .editor-sheet-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-footer-copy {
    max-width: none;
  }

  .editor-media-grid {
    grid-template-columns: 1fr;
  }

  .media-chip {
    grid-template-columns: 1fr;
  }

  .media-chip-actions {
    justify-content: flex-start;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1200;
    width: min(86vw, 320px);
    height: 100vh;
    border-right: 0;
    border-right: 1px solid rgba(92, 63, 67, 0.72);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 18px 0 42px rgba(2, 6, 23, 0.5);
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-button,
  .mobile-sidebar-close {
    display: inline-flex;
  }

  .mobile-sidebar-close {
    min-width: 44px;
    padding: 0;
    margin-left: auto;
  }

  .mobile-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
    border: 0;
    padding: 0;
    background: rgba(2, 6, 23, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.mobile-nav-open .mobile-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    padding: 18px;
  }

  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    min-width: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-search {
    width: 100%;
    max-width: none;
  }

  .toolbar-button-group {
    width: 100%;
    padding-bottom: 0;
  }

  .actions-summary-card {
    padding: 16px;
  }

  .actions-table th,
  .actions-table td {
    padding: 14px 16px;
  }

  .form-grid,
  .form-grid-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-gift-entry {
    gap: 14px;
    min-height: 0;
    padding: 18px;
  }

  .dashboard-gift-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    font-size: 25px;
  }

  .dashboard-gift-copy {
    flex: 1 1 180px;
  }

  .auth-card,
  .metric-card,
  .panel-card,
  .list-card,
  .summary-card,
  .section-toolbar,
  .account-card,
  .placeholder-card,
  .url-card {
    padding: 16px;
  }

  .dashboard-grid,
  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .auth-mode-links {
    grid-template-columns: 1fr;
  }

  .topbar-heading {
    width: 100%;
  }

  .mobile-menu-button span {
    display: none;
  }

  .topbar-actions,
  .status-pills {
    width: 100%;
  }

  .topbar-actions .button,
  .quick-action,
  .button-full {
    width: 100%;
  }

  .editor-sheet-header,
  .editor-sheet-body,
  .editor-sheet-footer {
    padding: 16px;
  }

  .dialog-sheet-header,
  .dialog-sheet-body,
  .dialog-sheet-footer {
    padding: 16px;
  }

  .editor-preview-card h4 {
    font-size: 22px;
  }

  .editor-sheet-footer .editor-actions,
  .editor-sheet-footer .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
