/* Memory Lane editing: dependable actions and an unobstructed editing surface. */
html body .app-shell .memory-editor.open,
html body main.app-shell .memory-editor.open {
  z-index: 1800 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

html body .app-shell .map-stage.memory-editor-active .memory-database-page,
html body main.app-shell section.map-stage.memory-editor-active .memory-database-page {
  pointer-events: none !important;
  filter: saturate(0.88) brightness(0.97) !important;
  transition: filter 180ms ease !important;
}

html body .app-shell .map-stage.memories-focus #memoryList .memory-card-action,
html body main.app-shell section.map-stage.memories-focus #memoryList .memory-card-action {
  isolation: isolate !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

@media (max-width: 760px) {
  html body .app-shell .map-stage.memory-editor-active .topbar,
  html body .app-shell .map-stage.memory-editor-active .bottom-nav,
  html body main.app-shell section.map-stage.memory-editor-active .topbar,
  html body main.app-shell section.map-stage.memory-editor-active .bottom-nav {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  html body .app-shell .memory-editor.open,
  html body main.app-shell .memory-editor.open {
    position: fixed !important;
    inset:
      max(8px, env(safe-area-inset-top))
      8px
      max(8px, env(safe-area-inset-bottom))
      8px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border-radius: 26px !important;
    transform: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  html body .app-shell .memory-editor .editor-header,
  html body main.app-shell .memory-editor .editor-header {
    top: -14px !important;
    margin: -14px -14px 12px !important;
    padding: 15px 14px 13px !important;
  }

  html body .app-shell .memory-editor .editor-actions,
  html body main.app-shell .memory-editor .editor-actions {
    position: relative !important;
    bottom: auto !important;
    z-index: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: center !important;
    gap: 10px !important;
    margin: 18px -2px 2px !important;
    padding: 18px 12px 10px !important;
    border-top: 1px solid rgba(14, 64, 81, 0.1) !important;
    background: rgba(246, 252, 248, 0.78) !important;
    border-radius: 20px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  }

  html body .app-shell .memory-editor .editor-actions .save-step,
  html body main.app-shell .memory-editor .editor-actions .save-step {
    order: 1 !important;
  }

  html body .app-shell .memory-editor .editor-actions .save-memory-note,
  html body main.app-shell .memory-editor .editor-actions .save-memory-note {
    order: 2 !important;
  }

  html body .app-shell .memory-editor .editor-actions .primary-button,
  html body main.app-shell .memory-editor .editor-actions .primary-button {
    order: 3 !important;
    width: 100% !important;
    min-height: 54px !important;
  }

  html body .app-shell .memory-editor .editor-actions #deleteButton,
  html body main.app-shell .memory-editor .editor-actions #deleteButton {
    order: 4 !important;
    min-height: 40px !important;
    margin-top: 1px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .app-shell .map-stage.memory-editor-active .memory-database-page,
  html body main.app-shell section.map-stage.memory-editor-active .memory-database-page {
    transition: none !important;
  }
}
