/* Keep the profile editor's identity and save actions visible while its long form scrolls. */
html.kulinara-app-starting #app {
  position: relative;
  display: grid;
  min-height: 100svh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
}

html.kulinara-app-starting #app > * {
  visibility: hidden;
}

html.kulinara-app-starting #app::before {
  content: "Kulinara";
  color: var(--leaf);
  font: 700 30px/1 var(--serif);
  letter-spacing: -.05em;
}

html.kulinara-app-starting #app::after {
  position: absolute;
  top: calc(50% + 27px);
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: -15px 0 0 color-mix(in srgb, var(--leaf) 25%, transparent), 15px 0 0 color-mix(in srgb, var(--leaf) 25%, transparent);
  content: "";
  animation: kulinara-startup-pulse 1s ease-in-out infinite alternate;
}

@keyframes kulinara-startup-pulse {
  to { opacity: .45; transform: scale(.78); }
}

.ps-identity-actions .ps-account-settings-link {
  flex-shrink: 0;
  white-space: nowrap;
}

.modal-backdrop:has(> .profile-editor-modal) {
  padding: clamp(12px, 2.5vh, 24px);
}

.auth-modal.profile-editor-modal.editor-studio {
  display: flex;
  flex-direction: column;
  width: min(800px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  padding: 0;
}

.profile-editor-modal .modal-close {
  z-index: 2;
  top: 18px;
  right: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--sage);
}

.profile-editor-modal .es-header {
  flex: 0 0 auto;
  padding: 27px 64px 19px 32px;
  border-bottom: 1px solid var(--line);
}

.profile-editor-modal .es-header h2 {
  margin-bottom: 9px;
}

.profile-editor-modal #profile-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 32px;
  scrollbar-gutter: stable;
}

.profile-editor-modal #profile-form > .es-section {
  flex: 0 0 auto;
}

.profile-editor-modal #profile-form > .modal-footer-actions {
  position: sticky;
  bottom: 0;
  flex: 0 0 auto;
  margin: 0 -32px;
  padding: 14px 32px max(14px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

@media (max-width: 760px) {
  .modal-backdrop:has(> .profile-editor-modal) {
    align-items: end;
    padding: 0;
  }

  .auth-modal.profile-editor-modal.editor-studio {
    width: 100%;
    max-height: 96dvh;
    border-radius: 20px 20px 0 0;
  }

  .profile-editor-modal .es-header {
    padding: 22px 58px 16px 22px;
  }

  .profile-editor-modal .modal-close {
    top: 14px;
    right: 14px;
  }

  .profile-editor-modal #profile-form {
    padding: 0 22px;
  }

  .profile-editor-modal #profile-form > .modal-footer-actions {
    margin: 0 -22px;
    padding: 14px 22px max(14px, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 600px) {
  .auth-modal.profile-editor-modal.editor-studio {
    max-height: 96dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.kulinara-app-starting #app::after { animation: none; }
}
