/* One welcome, then a useful draft. No live map or remote media in the demo. */
html body #authGate .auth-email-guidance { display: block; min-width: 0; white-space: normal; overflow-wrap: anywhere; font-size: .8rem; line-height: 1.45; color: #486275; }
html body #firstTimeOnboarding .first-time-onboarding-card {
  box-sizing: border-box; width: min(500px, 100%) !important; min-height: 0 !important; padding: 0 !important;
  height: min(740px, calc(100svh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  max-height: calc(100svh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
  grid-template-rows: max-content minmax(0, 1fr) max-content; gap: 0 !important;
  overflow: hidden !important; color: #f5faf8; background: #00243b; border: 1px solid #315466; border-radius: 30px;
  box-shadow: 0 28px 80px #00192455;
}
html body #firstTimeOnboarding { align-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)); }
/* Equal side tracks center the wordmark on the panel, not the space beside Close. */
html body #firstTimeOnboarding .welcome-story-header { display: grid; grid-template-columns: minmax(44px, 1fr) max-content minmax(44px, 1fr); align-items: center; gap: 4px; padding: 12px 24px 0; border: 0; background: transparent; }
html body #firstTimeOnboarding .welcome-story-wordmark { grid-column: 2; grid-row: 1; justify-self: center; font-size: 1.125rem; }
html body #firstTimeOnboarding .first-time-onboarding-close { grid-column: 3; grid-row: 1; justify-self: end; position: static; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; color: #c5dadc; background: #ffffff08; border: 1px solid #ffffff14; box-shadow: none; }
html body #firstTimeOnboarding .first-time-onboarding-close svg { width: 20px; height: 20px; }
html body #firstTimeOnboarding .welcome-story-content { display: contents; }
html body #firstTimeOnboarding .welcome-story-body { min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable both-edges; padding: 6px 26px 20px; display: grid; align-content: safe center; gap: 8px; }
html body #firstTimeOnboarding .first-time-onboarding-copy { min-width: 0; padding: 0; gap: 12px !important; align-content: center; text-align: center; background: transparent; border: 0; box-shadow: none; }
html body #firstTimeOnboarding #firstTimeOnboardingTitle:focus { outline: none; }
html body #firstTimeOnboarding .first-time-onboarding-eyebrow { font-size: .625rem; line-height: 1.5; letter-spacing: .18em; color: #91d7c9; font-weight: 650; }
html body #firstTimeOnboarding .first-time-onboarding-copy h2 { width: 100%; min-width: 0; max-width: min(100%, 16ch) !important; overflow-wrap: anywhere; hyphens: auto; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2rem, 8.8vw, 2.75rem); font-weight: 400; line-height: 1.07; letter-spacing: -.04em; margin: 0 auto !important; color: #f9fbf4; text-wrap: balance; }
html body #firstTimeOnboarding .first-time-onboarding-copy > p { max-width: 29ch !important; margin: 0 auto !important; font-size: .9375rem; font-weight: 400 !important; line-height: 1.5 !important; color: #c5dadc !important; text-wrap: pretty; }
html body #firstTimeOnboarding .first-time-onboarding-copy > .welcome-story-start-note { max-width: 32ch !important; font-size: .75rem; line-height: 1.5 !important; color: #afc8cd !important; }
html body #firstTimeOnboarding .first-time-onboarding-actions { box-sizing: border-box; display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 6px 12px !important; width: 100% !important; margin: 0 !important; padding: 8px 26px 22px; border: 0; background: transparent; }
html body #firstTimeOnboarding .first-time-onboarding-actions button { min-width: 0; min-height: 44px !important; height: auto; width: 100% !important; border-radius: 16px !important; font-size: .8125rem; font-weight: 600; line-height: 1.35; white-space: normal; padding: 10px 12px; }
html body #firstTimeOnboarding #firstTimeOnboardingPrimary { grid-column: 1 / -1; min-height: 54px !important; background: #79dac6; color: #00243b; border: 1px solid #a7eadb; font-size: .9375rem; box-shadow: none; }
html body #firstTimeOnboarding :is(#firstTimeOnboardingSecondary, #firstTimeOnboardingPreview) { background: transparent; border: 1px solid transparent; color: #d3e3e2; box-shadow: none; text-decoration: none; }
html body #firstTimeOnboarding .first-time-onboarding-assurance { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; max-width: 100%; margin: 4px 0 0; padding: 0; border: 0; border-radius: 0; font-size: .625rem; font-weight: 400; line-height: 1.5; color: #aac6cd; background: transparent; text-align: center; }
html body #firstTimeOnboarding .first-time-onboarding-assurance > svg { flex: 0 0 12px; width: 12px; height: 12px; }
html body #firstTimeOnboarding button:focus-visible { outline: 3px solid #f9fbf4; outline-offset: 3px; }
@media (hover: hover) {
  html body #firstTimeOnboarding :is(#firstTimeOnboardingSecondary, #firstTimeOnboardingPreview, #firstTimeOnboardingClose):hover { background: #ffffff0b; color: #fff; }
  html body #firstTimeOnboarding #firstTimeOnboardingPrimary:hover { background: #9be5d5; }
}
/* One open stage, not a separate picture card. All artwork remains local. */
html body #firstTimeOnboarding .welcome-memory-demo { position: relative; isolation: isolate; width: 100%; min-width: 0; height: calc(210px + 3rem); min-height: 0; padding: 0; margin: 0; overflow: visible; border: 0; border-radius: 0; background: radial-gradient(ellipse at 57% 59%, #28727155 0, #00243b00 66%); }
html body #firstTimeOnboarding .welcome-story-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
html body #firstTimeOnboarding .welcome-story-greeting { position: relative; z-index: 1; display: table; width: fit-content; max-width: 75%; margin: 6px 0 0 3%; padding: 12px 17px; border-radius: 18px 18px 5px 18px; color: #00243b; background: #f6fbf5; font-size: 1rem; line-height: 1.35; font-weight: 650; box-shadow: 0 5px 20px #00182614; }
html body #firstTimeOnboarding .welcome-story-greeting::after { content: ""; position: absolute; right: 0; bottom: -8px; width: 14px; height: 14px; background: #f6fbf5; clip-path: polygon(0 0, 100% 0, 100% 100%); }
html body #firstTimeOnboarding .welcome-story-character { position: absolute; width: 236px; height: 236px; bottom: -4px; left: calc(50% - 102px); filter: drop-shadow(0 12px 14px #000f2638); transform-origin: 50% 90%; }
/* Complementary CSS clips articulate the original mascot at the wrist.
   Both layers share one cached image; no video, animation library or new asset. */
html body #firstTimeOnboarding .welcome-story-character img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
html body #firstTimeOnboarding .welcome-story-mappi { clip-path: polygon(29% 0, 100% 0, 100% 100%, 0 100%, 0 36%, 25% 36%, 29% 32%); }
html body #firstTimeOnboarding .welcome-story-hand { clip-path: polygon(0 0, 29% 0, 29% 32%, 25% 36.3%, 0 36.3%); transform-origin: 21% 35%; }
.first-memory-inspiration { text-align: left; padding: 4px 0 16px; color: #00243f; }
.first-memory-inspiration strong { display: block; font-size: 1.2rem; line-height: 1.35; }
.first-memory-inspiration p { font-size: .9rem; line-height: 1.5; margin: 10px 0; color: #486275; }
.first-memory-inspiration small { font-size: .8rem; color: #486275; }
.first-memory-inspiration[hidden] { display: none !important; }
.photo-metadata-suggestion { padding: 16px; border: 1px solid #aecad8; border-radius: 18px; background: #e2f5f0; color: #00243f; }
.photo-metadata-suggestion p { font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
html body #memoryForm .photo-metadata-suggestion label { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: .85rem; }
html body #memoryForm .photo-metadata-suggestion input { width: 22px; height: 22px; min-height: 22px; padding: 0; accent-color: #00243f; }
.photo-metadata-suggestion > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photo-metadata-suggestion button { min-height: 44px; border: 1px solid #aecad8; border-radius: 12px; padding: 10px 14px; color: #fff; background: #00243f; font: inherit; font-size: .85rem; }
.photo-metadata-suggestion button:last-child { color: #00243f; background: #f8fbfc; }
.photo-metadata-suggestion button:disabled { opacity: .5; }
/* Photo GPS is a deliberate replacement for the memory's existing pin. Keep
   both sources legible before asking anyone to make that choice. */
html body main.app-shell #memoryForm#memoryForm #memoryPhotoMetadataSuggestion {
  box-sizing: border-box !important;
  width: min(100%, 560px) !important;
  min-width: 0 !important;
  margin-inline: auto !important;
  padding: clamp(14px, 3vw, 22px) !important;
  text-align: left !important;
  background: linear-gradient(155deg, #f8fffc 0%, #e3f5f0 100%) !important;
  border-color: #b6d8d3 !important;
  box-shadow: 0 14px 34px rgba(0, 36, 63, .09);
}
html body #memoryForm #memoryPhotoMetadataSuggestion > strong { display: block; font-size: 1.12rem; line-height: 1.3; }
html body #memoryForm #memoryPhotoMetadataSuggestion > p { margin: 8px 0; color: #3e6170; }
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-source {
  display: inline-block; max-width: 100%; margin: 3px 0 14px; padding: 5px 9px;
  color: #426371; background: rgba(255, 255, 255, .78); border: 1px solid #d1e6e1;
  border-radius: 999px; font-size: .73rem; overflow-wrap: anywhere;
}
html body main.app-shell #memoryForm#memoryForm #memoryPhotoMetadataSuggestion label.photo-metadata-option {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-content: stretch !important;
  justify-items: stretch !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 56px !important;
  margin: 8px 0 !important;
  padding: 13px 14px !important;
  text-align: left !important;
  border: 1px solid #bddbd7;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
html body main.app-shell #memoryForm#memoryForm #memoryPhotoMetadataSuggestion input[type="checkbox"] {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  width: 22px !important; min-width: 22px !important; max-width: 22px !important;
  height: 22px !important; min-height: 22px !important; max-height: 22px !important;
  padding: 0 !important; margin: 0 !important; align-self: center !important;
  box-shadow: none !important; accent-color: #00243f;
}
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-option-copy { display: grid; gap: 3px; min-width: 0; max-width: none; text-align: left; }
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-option-copy strong { font-size: .875rem; line-height: 1.35; }
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-option-copy small { font-size: .8rem; font-weight: 500; line-height: 1.4; color: #486275; overflow-wrap: anywhere; }
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-location-compare {
  display: grid; gap: 9px; min-width: 0; margin-top: 14px; padding: 13px;
  background: rgba(255, 255, 255, .69); border: 1px solid #bddbd7; border-radius: 17px;
}
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-location-heading {
  display: block; margin-bottom: 2px; font-size: .9rem; line-height: 1.35;
}
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-current-pin {
  display: grid; gap: 4px; min-width: 0; padding: 12px 14px;
  background: #fff; border: 1px solid #d6e7e4; border-radius: 14px;
  box-shadow: inset 3px 0 #9dc9c2;
}
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-location-source {
  display: block; color: #21776d; font-size: .69rem; font-weight: 800;
  letter-spacing: .08em; line-height: 1.35; text-transform: uppercase;
}
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-current-pin strong {
  font-size: .85rem; line-height: 1.35; overflow-wrap: anywhere;
}
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-current-pin small {
  color: #54707a; font-size: .76rem; line-height: 1.4; overflow-wrap: anywhere;
}
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-location-compare > .photo-metadata-location-source {
  margin: 6px 0 -3px 2px;
}
html body main.app-shell #memoryForm#memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-location-compare label.photo-metadata-option {
  margin: 0 !important; border-color: #9ccbc3; background: #f8fffc;
}
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-location-summary {
  margin: 0; padding: 9px 11px; color: #1a5f58; background: #e1f3ed;
  border-radius: 10px; font-size: .76rem; font-weight: 700; line-height: 1.4;
}
html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-inline: auto; }
html body main.app-shell #memoryForm#memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-actions button {
  width: 100% !important; min-width: 0 !important; min-height: 48px !important;
  height: auto !important; white-space: normal !important; line-height: 1.35 !important;
}
html body #memoryForm #memoryPhotoMetadataSuggestion :is(input,button):focus-visible { outline: 3px solid #247a8b; outline-offset: 3px; }
html body #memoryForm #memoryPhotoMetadataSuggestion label:has(input:checked) { border-color: #247a8b; background: #e2f5f0; box-shadow: 0 0 0 2px rgba(117, 217, 195, .32); }
@media (max-width: 600px) {
  html body #memoryForm #memoryPhotoMetadataSuggestion .photo-metadata-actions { grid-template-columns: minmax(0, 1fr); }
}
/* Two calm actions use the existing save lane, without a vacant third slot. */
html body main.app-shell #memorySaveConfirmation#memorySaveConfirmation#memorySaveConfirmation#memorySaveConfirmation[data-variant="first-memory"] .memory-confirmation-actions { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) !important; grid-template-rows: minmax(44px, auto) !important; }
html body main.app-shell #memorySaveConfirmation#memorySaveConfirmation#memorySaveConfirmation#memorySaveConfirmation[data-variant="first-memory"] .memory-confirmation-actions > button { grid-column: auto !important; grid-row: auto !important; min-height: 44px !important; white-space: normal !important; }
html body main.app-shell #memoryForm#memoryForm.is-first-memory-onboarding .first-memory-details-toggle:not([hidden]) { display: flex !important; align-items: center; justify-content: center; gap: 10px; min-height: 48px; color: #00243f; background: #e2f5f0; border: 1px solid #aecad8; }
html body main.app-shell #memoryForm#memoryForm.memory-editor.is-progressive-capture.is-first-memory-onboarding:not(.details-open) :is(.memory-editor-progress, .memory-flow-step, .memory-story-field, .mappi-story-tip, .favorite-toggle, .memory-flow-feeling, .memory-optional-fields, .memory-media-advanced, .save-step) { display: none !important; }
html body main.app-shell #memoryForm#memoryForm.memory-editor.is-progressive-capture.is-first-memory-onboarding:not(.details-open) :is(.memory-sound-capture, .memory-song-field) { display: none !important; }
html body main.app-shell #memoryForm#memoryForm.is-first-memory-onboarding .memory-cover-help { display: none !important; }
/* Keep the date available for past memories without expanding every detail. */
html body main.app-shell #memoryForm#memoryForm.is-first-memory-onboarding .memory-date-row { display: grid !important; grid-template-columns: 1fr; }
html body main.app-shell #memoryForm#memoryForm.is-first-memory-onboarding .memory-date-row .memory-people-select { display: none !important; }
html body main.app-shell #memoryForm#memoryForm #firstMemoryLocationConsent { grid-template-columns: minmax(0, 1fr); background: #f8fbfc; border-color: #d2e2e9; color: #00243f; }
html body main.app-shell #memoryForm#memoryForm #firstMemoryLocationConsent .first-memory-location-consent-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html body main.app-shell #memoryForm#memoryForm #firstMemoryLocationConsent .first-memory-location-consent-icon { display: none; }
html body main.app-shell #memoryForm#memoryForm #firstMemoryLocationSkip { background: transparent !important; color: #486275 !important; border-color: #d2e2e9; min-height: 44px; }
html body main.app-shell #memoryForm#memoryForm #firstMemoryLocationAllow { background: #e2f5f0 !important; color: #00243f !important; border-color: #aecad8; min-height: 44px; }
@media (max-width: 360px), (max-height: 680px) {
  html body #firstTimeOnboarding .welcome-story-header { padding: 6px 18px 0; }
  html body #firstTimeOnboarding .welcome-story-body { padding: 6px 18px 16px; gap: 6px; align-content: start; }
  html body #firstTimeOnboarding .welcome-memory-demo { height: calc(152px + 3rem); }
  html body #firstTimeOnboarding .welcome-story-character { width: 180px; height: 180px; left: calc(50% - 74px); bottom: -2px; }
  html body #firstTimeOnboarding .welcome-story-greeting { padding: 10px 14px; margin-left: 0; }
  html body #firstTimeOnboarding .first-time-onboarding-copy h2 { font-size: 2rem; }
  html body #firstTimeOnboarding .first-time-onboarding-actions { padding: 6px 18px 14px; gap: 2px 8px !important; }
}
@media (max-width: 360px) {
  html body #firstTimeOnboarding .welcome-story-header { padding-inline: 12px; }
}
@media (orientation: landscape) and (min-width: 740px) {
  html body #firstTimeOnboarding .first-time-onboarding-card { width: min(860px, 100%) !important; height: min(490px, calc(100svh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); }
  html body #firstTimeOnboarding .welcome-story-body { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center; align-content: safe center; gap: 28px; padding-inline: 28px; }
  html body #firstTimeOnboarding .welcome-memory-demo { height: calc(184px + 3rem); }
  html body #firstTimeOnboarding .welcome-story-character { width: 220px; height: 220px; left: calc(50% - 94px); }
  html body #firstTimeOnboarding .first-time-onboarding-copy { text-align: left; }
  html body #firstTimeOnboarding .first-time-onboarding-copy h2 { margin-inline: 0 !important; font-size: 2.5rem; }
  html body #firstTimeOnboarding .first-time-onboarding-copy > p { margin-inline: 0 !important; }
  html body #firstTimeOnboarding .first-time-onboarding-actions { grid-template-columns: minmax(0, 1.5fr) minmax(0, .85fr) minmax(0, 1fr) !important; align-items: center; padding-inline: 28px; }
  html body #firstTimeOnboarding #firstTimeOnboardingPrimary { grid-column: auto; }
}
@media (orientation: landscape) and (min-width: 740px) and (max-height: 520px) {
  html body #firstTimeOnboarding .welcome-story-body { padding-block: 4px 10px; }
  html body #firstTimeOnboarding .welcome-memory-demo { height: calc(116px + 3rem); }
  html body #firstTimeOnboarding .welcome-story-character { width: 166px; height: 166px; left: calc(50% - 60px); bottom: -8px; }
  html body #firstTimeOnboarding .welcome-story-greeting { font-size: .875rem; padding: 9px 12px; margin: 0; }
  html body #firstTimeOnboarding .first-time-onboarding-copy { gap: 8px !important; }
  html body #firstTimeOnboarding .first-time-onboarding-copy h2 { font-size: 2rem; max-width: 18ch !important; }
  html body #firstTimeOnboarding .first-time-onboarding-eyebrow { display: none; }
  html body #firstTimeOnboarding .first-time-onboarding-copy > p { font-size: .875rem; }
  html body #firstTimeOnboarding .first-time-onboarding-copy > .welcome-story-start-note { font-size: .75rem; }
  html body #firstTimeOnboarding .first-time-onboarding-actions { padding-block: 4px 10px; }
}
/* Large type on short/narrow screens gets a full reading lane, not a slit.
   Only the header stays fixed; all content and actions remain scrollable. */
@media (orientation: landscape) and (max-width: 739px) and (max-height: 360px) {
  html body #firstTimeOnboarding .first-time-onboarding-card { grid-template-rows: max-content minmax(0, 1fr); }
  html body #firstTimeOnboarding .welcome-story-content { display: block; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 12px; }
  html body #firstTimeOnboarding .welcome-story-body { overflow: visible; scrollbar-gutter: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  html body #firstTimeOnboarding .welcome-story-character { animation: welcome-mappi-arrive 650ms ease-out both, welcome-mappi-lean 1800ms 500ms ease-in-out; }
  html body #firstTimeOnboarding .welcome-story-hand { animation: welcome-mappi-wave 1800ms 500ms ease-in-out both; }
}
@keyframes welcome-mappi-wave { 0%, 100% { transform: rotate(0); } 18%, 54% { transform: rotate(-12deg); } 36%, 72% { transform: rotate(10deg); } }
@keyframes welcome-mappi-lean { 0%, 100% { transform: rotate(0); } 18%, 54% { transform: rotate(-1.25deg); } 36%, 72% { transform: rotate(.5deg); } }
@keyframes welcome-mappi-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .welcome-memory-demo *, html body #firstTimeOnboarding .first-time-onboarding-card { animation: none !important; transition: none !important; }
}
