@media (max-width: 760px) {
  :root {
    --header-height: 64px;
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  body.editor-body {
    overflow: auto;
  }

  .site-header,
  .app-topbar {
    min-height: var(--header-height);
    padding: 0.65rem max(0.8rem, env(safe-area-inset-left)) 0.65rem max(0.8rem, env(safe-area-inset-right));
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand small,
  .editor-command-strip,
  .header-actions .button-secondary,
  .header-actions .button-ghost {
    display: none;
  }

  .header-actions {
    gap: 0.4rem;
  }

  .button {
    min-height: 44px;
    padding-inline: 0.75rem;
  }

  .hero {
    min-height: 86svh;
    padding: calc(var(--header-height) + 3.5rem) 1rem 3rem;
  }

  .hero h1 {
    max-width: 9ch;
    font-size: clamp(3rem, 17vw, 5.4rem);
  }

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(16, 17, 20, 0.76), rgba(16, 17, 20, 0.92)),
      linear-gradient(90deg, rgba(16, 17, 20, 0.82), transparent);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-next {
    inset-inline: 1rem;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-next span {
    min-height: 46px;
    padding: 0.65rem 0.5rem;
    text-align: center;
    font-size: 0.8rem;
  }

  .stats-band,
  .dashboard-metrics,
  .project-board,
  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: repeat(6, minmax(82vw, 1fr));
  }

  .dashboard-shell {
    padding: 0.9rem 0.9rem 5.6rem;
  }

  .dashboard-hero {
    min-height: 220px;
    padding-top: 1.5rem;
  }

  .quick-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .project-column {
    min-height: 280px;
  }

  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0.45rem max(0.5rem, env(safe-area-inset-left)) max(0.45rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-right));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    min-height: 44px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font-weight: 850;
  }

  .mobile-bottom-nav a[aria-current="page"],
  .mobile-bottom-nav button:active {
    background: var(--surface-2);
    color: var(--text);
  }

  .editor-shell,
  .video-shell,
  .photo-shell {
    display: grid;
    height: auto;
    min-height: calc(100svh - var(--header-height));
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding-bottom: 74px;
  }

  .editor-sidebar,
  .video-shell .right-panel,
  .photo-shell .right-panel,
  .tool-rail {
    display: none;
  }

  .editor-stage,
  .photo-stage {
    min-height: calc(100svh - var(--header-height) - 270px);
    padding: 0.75rem;
  }

  .preview-header {
    min-height: 54px;
    align-items: start;
  }

  .preview-header h1 {
    max-width: 64vw;
    font-size: 1.1rem;
  }

  .video-preview-surface {
    height: min(52svh, 420px);
    min-height: 230px;
  }

  .editing-controls {
    display: none;
  }

  .timeline-panel {
    grid-column: 1;
    height: 230px;
    padding: 0.6rem;
  }

  .timeline-toolbar {
    gap: 0.5rem;
  }

  .timeline-toolbar output {
    min-width: 78px;
    font-size: 0.78rem;
  }

  .track {
    grid-template-columns: 86px minmax(900px, 1fr);
  }

  .track-label {
    font-size: 0.72rem;
  }

  .playhead {
    left: 86px;
  }

  .mobile-editor-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.5rem max(0.5rem, env(safe-area-inset-left)) max(0.55rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-right));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(18px);
  }

  .mobile-editor-bar button {
    min-height: 48px;
    padding: 0.3rem 0.2rem;
    font-size: clamp(0.62rem, 2.8vw, 0.78rem);
  }

  .mobile-editor-bar.photo-mobile-tools {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .photo-stage {
    grid-template-rows: auto minmax(360px, 1fr);
  }

  .photo-canvas-shell {
    min-height: 360px;
    padding: 0.5rem;
  }

  .drawer {
    width: 100vw;
  }

  .toast-region {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .brand strong {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions .button-primary {
    padding-inline: 0.55rem;
    font-size: 0.82rem;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 15vw, 4.6rem);
  }
}
