@media (max-width: 720px) {
  .nav {
    width: min(72rem, calc(100% - 1rem));
    min-height: auto;
    padding: 0.55rem 0;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .brand {
    flex: 1 1 auto;
  }

  .nav-links {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 0.4rem;
  }

  .nav-links .button {
    flex: 1 1 auto;
    min-width: 0;
    padding-inline: 0.55rem;
  }

  .upload-view,
  .download-view {
    width: min(100%, calc(100% - 1rem));
    min-height: auto;
    padding: 2rem 0;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .option-grid,
  .form-footer,
  .result-header,
  .site-footer {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .docs-grid,
  .field-grid,
  .app-shell,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .api-docs {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .api-sidebar {
    position: static;
    top: auto;
  }

  .api-sidebar-title {
    margin-bottom: 0.5rem;
  }

  .api-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: 0;
    padding-left: 0;
    gap: 0.35rem;
  }

  .api-nav-link {
    border: 1px solid var(--border);
  }

  .api-sidebar-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
  }

  .endpoint-list div em {
    margin-left: 0;
    width: 100%;
  }

  .app-sidebar {
    position: static;
    width: 100%;
    overflow: hidden;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .sidebar-link {
    justify-content: flex-start;
    padding-inline: 0.65rem;
  }

  .sidebar-logout .button {
    justify-content: center;
  }

  .endpoint-list div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .result-actions {
    width: 100%;
  }

  .file-progress-side {
    width: 100%;
  }

  .result-actions .button {
    flex: 1;
  }

  .file-browser-toolbar {
    align-items: stretch;
  }

  .file-browser-toolbar,
  .file-browser-toolbar .view-toolbar {
    width: 100%;
  }

  .file-browser-toolbar .view-toolbar .button,
  .file-browser-toolbar > .button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .file-browser-toolbar .view-toolbar .icon-button {
    flex: 0 0 2.5rem;
  }

  .file-browser-head {
    display: none;
  }

  .file-open {
    grid-template-columns: 3rem minmax(0, 1fr) auto;
  }

  .file type {
    display: none;
  }

  .file-browser.is-list .file-card {
    grid-template-columns: minmax(0, 1fr) minmax(7rem, auto);
  }

  h1 {
    font-size: 1.65rem;
  }

  .drop-zone {
    min-height: 15rem;
  }

  .admin-header,
  .table-header {
    flex-direction: column;
    align-items: stretch;
  }

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

  .tabs-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-section {
    grid-template-columns: 1fr;
  }

  .new-collection-body {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 0.5rem;
    box-shadow: none;
  }

  .inline-controls {
    align-items: stretch;
  }

  .inline-controls label,
  .inline-controls input,
  .inline-controls select,
  .compact-input {
    width: 100%;
    min-width: 0;
  }

  .copy-field,
  .token-reveal-row,
  .storage-card-edit-bar {
    flex-wrap: wrap;
  }

  .copy-field .button,
  .token-reveal-row .button,
  .storage-card-edit-bar .button {
    flex: 1 1 auto;
  }

  .storage-card-header,
  .storage-card-actions {
    align-items: stretch;
  }

  .storage-card-header {
    flex-direction: column;
  }

  .storage-card-actions,
  .storage-card-actions form,
  .storage-card-actions .button,
  .storage-card-actions button {
    width: 100%;
  }

  .storage-card-summary {
    gap: 0.65rem;
  }

  .storage-detail {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .storage-card-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100%, calc(100% - 1rem));
    padding: 1rem 0;
    gap: 1rem;
  }

  .card-content {
    padding: 1rem;
  }

  .metric-grid,
  .user-edit-metrics {
    grid-template-columns: 1fr;
  }

  .storage-type-grid,
  .storage-ops-grid {
    grid-template-columns: 1fr;
  }

  .result-item,
  .download-item {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .file-browser-titlebar {
    align-items: flex-start;
  }

  .file-browser-titlebar > div:first-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
  }

  .file-browser {
    padding: 0.25rem;
  }

  .file-open {
    grid-template-columns: 2.65rem minmax(0, 1fr);
    gap: 0.55rem;
    padding: 0.5rem;
  }

  .file-media {
    width: 2.65rem;
    height: 2.65rem;
  }

  .file-size {
    display: none;
  }

  .file-browser.is-list .file-card {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .file-browser.is-list .file-reaction-dock {
    justify-content: flex-end;
    padding: 0 0.5rem 0.5rem;
  }

  .file-browser.is-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.5rem;
  }

  .file-browser.is-thumbs .file-open {
    height: 100%;
  }

  .file-actions,
  .file-browser.is-thumbs .file-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .file-reaction-dock {
    right: 0.5rem;
    bottom: 0.45rem;
  }

  .reaction-button {
    opacity: 1;
    transform: none;
  }

  .file-progress-side {
    width: 100%;
  }

  .site-footer {
    width: min(100%, calc(100% - 1rem));
  }
}

@media (max-width: 380px) {
  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .badge-row .badge {
    flex: 1 1 100%;
    justify-content: center;
  }

  .nav-links .button {
    flex-basis: 100%;
  }
}
