/* Build 744: one coherent personalization studio for the private map of your life. */

html body .customize-mymappi-dialog {
  width: min(760px, calc(100vw - 28px));
  max-width: 760px;
}

html body .customize-live-preview {
  --preview-pin-color: #2674f0;
  --preview-chapter-color: #159879;
  --preview-route-color: #39c9a2;
  position: relative;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 74px;
  min-height: 116px;
  gap: 15px;
  align-items: center;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(55, 143, 145, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(89, 220, 186, 0.19), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 252, 0.96), rgba(230, 245, 242, 0.93));
  box-shadow: 0 14px 34px rgba(5, 61, 71, 0.09);
}

html body .customize-preview-map {
  position: relative;
  width: 116px;
  height: 84px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background:
    linear-gradient(28deg, transparent 45%, rgba(255, 255, 255, 0.76) 46% 50%, transparent 51%),
    linear-gradient(145deg, #cce9df, #b9dcdd 48%, #acd2e7);
  box-shadow: 0 10px 20px rgba(7, 65, 76, 0.13);
}

html body .customize-preview-map::before,
html body .customize-preview-map::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(23, 99, 104, 0.14);
  border-radius: 50%;
}

html body .customize-preview-map::before { inset: 14px -12px 32px 20px; }
html body .customize-preview-map::after { inset: 35px 24px -18px -14px; }

html body .customize-preview-route {
  position: absolute;
  z-index: 2;
  top: 42px;
  left: 17px;
  width: 78px;
  height: 24px;
  border-top: 4px solid var(--preview-route-color);
  border-radius: 50%;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--preview-route-color) 50%, transparent));
  transform: rotate(-12deg);
}

html body .customize-preview-pin {
  position: absolute;
  z-index: 4;
  right: 17px;
  bottom: 14px;
  display: grid;
  width: 24px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: var(--preview-pin-color);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 8px;
  box-shadow: 0 5px 12px rgba(2, 46, 55, 0.22);
  transform: rotate(-45deg);
}

html body .customize-preview-pin i {
  font-size: 0.68rem;
  font-style: normal;
  transform: rotate(45deg);
}

html body .customize-preview-chapter-symbol {
  position: absolute;
  z-index: 5;
  top: 9px;
  left: 10px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 9px;
  color: #fff;
  background: var(--preview-chapter-color);
  box-shadow: 0 4px 10px rgba(3, 47, 57, 0.15);
}

html body .customize-preview-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

html body .customize-preview-copy small {
  color: #188879;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html body .customize-preview-copy strong {
  overflow: hidden;
  color: #073744;
  font-size: clamp(1rem, 3vw, 1.28rem);
  font-weight: 900;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body .customize-preview-copy span {
  overflow: hidden;
  color: #58757a;
  font-size: 0.73rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body .customize-preview-capsule {
  display: grid;
  width: 70px;
  height: 76px;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(17, 93, 99, 0.13);
  border-radius: 15px;
  background: #fffdf8;
  box-shadow: 0 8px 18px rgba(5, 53, 61, 0.1);
  transform: rotate(2deg);
}

html body .customize-preview-capsule span {
  border-radius: 9px;
  background: linear-gradient(145deg, var(--preview-chapter-color), #1b86a0);
}

html body .customize-preview-capsule i {
  height: 4px;
  border-radius: 99px;
  background: #d9e8e4;
}

html body .customize-live-preview[data-map-theme="paper"] .customize-preview-map {
  filter: sepia(0.28) saturate(0.72) brightness(1.04);
  background: linear-gradient(145deg, #eee4ca, #e4dcc7 48%, #cfdedc);
}

html body .customize-live-preview[data-map-theme="midnight"] .customize-preview-map {
  background: linear-gradient(145deg, #183842, #15313e 48%, #153b56);
}

html body .customize-live-preview[data-map-theme="adventure"] .customize-preview-map {
  filter: saturate(1.25);
  background: linear-gradient(145deg, #9edaad, #8fcfc2 48%, #83cbe6);
}

html body .customize-live-preview[data-route-style="solid"] .customize-preview-route { filter: none; }
html body .customize-live-preview[data-route-style="dotted"] .customize-preview-route { border-top-style: dotted; filter: none; }
html body .customize-live-preview[data-route-style="hand-drawn"] .customize-preview-route { border-top-style: dashed; border-radius: 36% 64% 45% 55%; filter: none; }

html body .customize-live-preview[data-pin-style="minimal"] .customize-preview-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

html body .customize-live-preview[data-pin-style="minimal"] .customize-preview-pin i { display: none; }
html body .customize-live-preview[data-pin-style="photo"] .customize-preview-pin { background: linear-gradient(145deg, #ffd17c, #369d91); }

html body .customize-live-preview[data-capsule-style="postcard"] .customize-preview-capsule { border-radius: 5px; transform: rotate(-2deg); }
html body .customize-live-preview[data-capsule-style="scrapbook"] .customize-preview-capsule { border-style: dashed; transform: rotate(4deg); }
html body .customize-live-preview[data-capsule-style="journal"] .customize-preview-capsule { border-radius: 8px 15px 15px 8px; box-shadow: -4px 0 0 #bcae93, 0 8px 18px rgba(5, 53, 61, 0.1); }

html body .customize-category-builder {
  display: grid;
  gap: 8px;
}

html body .customize-category-empty {
  margin: 0;
  padding: 13px;
  border: 1px dashed rgba(15, 107, 112, 0.2);
  border-radius: 15px;
  color: #658084;
  background: rgba(238, 248, 245, 0.55);
  font-size: 0.75rem;
  font-weight: 650;
  text-align: center;
}

html body .customize-category-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 52px 44px;
  gap: 8px;
  align-items: center;
}

html body .customize-category-row input,
html body .customize-text-fields input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(15, 91, 100, 0.15);
  border-radius: 14px;
  color: #093b48;
  background: rgba(255, 255, 252, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 730;
}

html body .customize-category-emoji input { padding: 0 8px; font-size: 1.18rem; text-align: center; }
html body .customize-category-name input { padding: 0 13px; }

html body .customize-category-color input,
html body .customize-single-color input {
  width: 48px;
  min-width: 48px;
  height: 46px;
  min-height: 46px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(15, 91, 100, 0.15);
  border-radius: 14px;
  background: #fff;
}

html body .customize-remove-category,
html body .customize-add-category {
  min-height: 44px;
  border: 1px solid rgba(15, 91, 100, 0.13);
  border-radius: 13px;
  color: #607b80;
  background: rgba(255, 255, 252, 0.86);
}

html body .customize-remove-category { display: grid; width: 44px; padding: 0; place-items: center; }
html body .customize-remove-category svg { width: 17px; height: 17px; }

html body .customize-add-category {
  display: inline-flex;
  width: fit-content;
  gap: 8px;
  align-items: center;
  padding: 0 14px;
  color: #0b736e;
  font-size: 0.75rem;
  font-weight: 830;
}

html body .customize-add-category:disabled { opacity: 0.48; }
html body .customize-add-category svg { width: 17px; height: 17px; }

html body .customize-field-help {
  color: #668186;
  font-size: 0.7rem;
  font-weight: 630;
  line-height: 1.35;
}

html body .customize-inline-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: end;
}

html body .customize-single-color {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 10px;
  border: 1px solid rgba(15, 91, 100, 0.12);
  border-radius: 16px;
  color: #547278;
  background: rgba(244, 250, 247, 0.78);
  font-size: 0.65rem;
  font-weight: 790;
}

html body input[data-inactive] { filter: saturate(0.25); opacity: 0.48; }

html body .customize-symbol-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

html body .customize-symbol-grid label { position: relative; }
html body .customize-symbol-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; }

html body .customize-symbol-grid label > span {
  display: grid;
  min-height: 64px;
  gap: 4px;
  place-items: center;
  border: 1px solid rgba(15, 91, 100, 0.12);
  border-radius: 15px;
  color: #176f70;
  background: rgba(249, 252, 248, 0.9);
  font-size: 1.3rem;
}

html body .customize-symbol-grid small { color: #607b80; font-size: 0.61rem; font-weight: 780; }

html body .customize-symbol-grid label:has(input:checked) > span {
  border-color: rgba(17, 159, 133, 0.52);
  background: linear-gradient(145deg, rgba(219, 250, 239, 0.94), rgba(230, 245, 250, 0.92));
  box-shadow: 0 0 0 3px rgba(24, 169, 120, 0.08);
}

html body .customize-text-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

html body .customize-text-fields label { display: grid; gap: 6px; color: #56747a; font-size: 0.68rem; font-weight: 800; }
html body .customize-text-fields input { padding: 0 13px; }

/* Curated base-map personalities retain one tile source and all map semantics. */
html[data-mymappi-map-theme="paper"] body .map-stage #map canvas {
  filter: sepia(0.28) saturate(0.72) contrast(0.94) brightness(1.04) !important;
}

html[data-mymappi-map-theme="midnight"] body .map-stage #map canvas {
  filter: brightness(0.62) saturate(0.82) contrast(1.18) hue-rotate(146deg) !important;
}

html[data-mymappi-map-theme="midnight"] body .map-stage.map-focus::after {
  background: linear-gradient(180deg, rgba(3, 22, 39, 0.13), rgba(4, 30, 46, 0.2)) !important;
  pointer-events: none;
}

html[data-mymappi-map-theme="adventure"] body .map-stage #map canvas {
  filter: saturate(1.36) contrast(1.08) brightness(0.98) !important;
}

/* Pin silhouettes stay spatially anchored while their centers become personal. */
html body .mymappi-pin-only { position: relative !important; }

html[data-mymappi-pin-style="emoji"] body .mymappi-pin-only .memory-pin-symbol {
  fill: #fff !important;
  stroke: rgba(4, 47, 57, 0.34) !important;
  stroke-width: 0.65px !important;
  paint-order: stroke fill !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

html[data-mymappi-pin-style="minimal"] body .mymappi-pin-only :is(.memory-pin-body, .memory-pin-rim, .memory-pin-inner, .memory-pin-shine, .memory-pin-symbol) {
  display: none !important;
}

html[data-mymappi-pin-style="minimal"] body .mymappi-pin-only .memory-pin-center {
  fill: #fff !important;
  stroke: #073b47 !important;
  stroke-width: 1.7px !important;
  transform: translateY(38px) scale(1.2);
  transform-origin: 32px 29.2px;
}

html[data-mymappi-pin-style="minimal"] body .mymappi-pin-only .memory-pin-core {
  fill: var(--marker-color) !important;
  transform: translateY(38px) scale(1.25);
  transform-origin: 32px 29.2px;
}

html[data-mymappi-pin-style="minimal"] body .mymappi-pin-only .memory-pin-svg {
  filter: drop-shadow(0 2px 3px rgba(3, 38, 48, 0.2)) !important;
}

html body .memory-pin-photo {
  position: absolute;
  z-index: 5;
  top: 7px;
  left: 50%;
  display: none;
  width: 17px;
  height: 17px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: #d9ece7;
  box-shadow: 0 1px 3px rgba(2, 36, 44, 0.2);
  transform: translateX(-50%);
}

html body .memory-pin-photo img { width: 100%; height: 100%; object-fit: cover; }
html[data-mymappi-pin-style="photo"] body .memory-pin-photo { display: block; }
html[data-mymappi-pin-style="photo"] body .mymappi-pin-only:has(.memory-pin-photo) :is(.memory-pin-center, .memory-pin-core) { opacity: 0 !important; }

/* Chapter defaults can follow each cover or use one owner signature. */
html body #homeJourney .life-chapter-card {
  position: relative;
}

html[data-mymappi-chapter-accent-mode="custom"] body #homeJourney .life-chapter-card,
html[data-mymappi-chapter-accent-mode="custom"] body .life-chapter-viewer-content {
  --chapter-accent: var(--mymappi-chapter-accent) !important;
  --chapter-view-accent: var(--mymappi-chapter-accent) !important;
}

html body #homeJourney .life-chapter-card::before {
  position: absolute;
  z-index: 18;
  top: 12px;
  right: 12px;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  content: var(--mymappi-chapter-symbol, "✦");
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  color: #fff;
  background: color-mix(in srgb, var(--chapter-accent, #159879) 88%, #073744);
  box-shadow: 0 6px 16px rgba(2, 39, 47, 0.2);
  font-size: 0.88rem;
  pointer-events: none;
}

html[data-mymappi-chapter-style="postcard"] body #homeJourney .life-chapter-card {
  border-radius: 12px !important;
  background: #fffaf0 !important;
  box-shadow: 0 15px 28px rgba(63, 48, 31, 0.14) !important;
}

html[data-mymappi-chapter-style="postcard"] body #homeJourney .life-chapter-cover {
  margin: 7px 7px 0 !important;
  border-radius: 8px !important;
}

html[data-mymappi-chapter-style="film"] body #homeJourney .life-chapter-cover {
  border: 7px solid #102f37 !important;
  border-radius: 13px !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18) !important;
}

html[data-mymappi-chapter-style="film"] body #homeJourney .life-chapter-cover-caption {
  background: linear-gradient(180deg, rgba(7, 31, 38, 0.08), rgba(7, 31, 38, 0.94)) !important;
}

/* Memory Capsule skins alter presentation only; content and actions stay fixed. */
html[data-mymappi-capsule-style="postcard"] body .memory-capsule-card {
  background: #fffaf0 !important;
}

html[data-mymappi-capsule-style="postcard"] body .memory-capsule-visual {
  margin: 12px 12px 0 !important;
  overflow: hidden !important;
  border: 8px solid #fffdf8 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 26px rgba(61, 47, 31, 0.15) !important;
}

html[data-mymappi-capsule-style="postcard"] body .memory-capsule-inside-card { border-radius: 10px !important; }

html[data-mymappi-capsule-style="scrapbook"] body .memory-capsule-body {
  background:
    radial-gradient(circle at 14% 8%, rgba(244, 188, 103, 0.12), transparent 24%),
    linear-gradient(145deg, #fffdf7, #f3eee2) !important;
}

html[data-mymappi-capsule-style="scrapbook"] body .memory-capsule-inside-card {
  border: 1px dashed color-mix(in srgb, var(--sheet-accent, #159879) 42%, #c5bda8) !important;
  border-radius: 7px 17px 9px 15px !important;
  box-shadow: 3px 5px 0 rgba(184, 159, 111, 0.09) !important;
}

html[data-mymappi-capsule-style="journal"] body .memory-capsule-body {
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(31, 110, 111, 0.08) 28px),
    #fffdf6 !important;
}

html[data-mymappi-capsule-style="journal"] body .memory-capsule-card :is(.memory-capsule-hero h2, .memory-capsule-inside-heading h3, .memory-capsule-story p, blockquote) {
  font-family: Georgia, "Times New Roman", serif !important;
}

html[data-mymappi-capsule-style="journal"] body .memory-capsule-inside-card {
  border-radius: 8px !important;
  background: rgba(255, 254, 248, 0.9) !important;
}

/* Motion personality is additive and always yields to the OS reduced-motion setting. */
html[data-mymappi-personality="playful"] body .home-action-card:active,
html[data-mymappi-personality="playful"] body .customize-choice-card:active {
  transform: scale(0.97) rotate(-0.4deg) !important;
}

html[data-mymappi-personality="playful"] body #homeJourney .life-chapter-card::before {
  animation: mymappi-personality-sparkle 1.8s ease-in-out infinite alternate;
}

html[data-mymappi-personality="minimal"] body .mymappi-pin-only,
html[data-mymappi-personality="minimal"] body .memory-pin-presence,
html[data-mymappi-personality="minimal"] body #homeJourney .life-chapter-card::before,
html[data-mymappi-personality="minimal"] body .chapter-journey-signature-stop > span {
  animation: none !important;
  transition-duration: 0.01ms !important;
}

@keyframes mymappi-personality-sparkle {
  from { transform: rotate(-3deg) scale(0.96); }
  to { transform: rotate(3deg) scale(1.05); }
}

@media (max-width: 620px) {
  html body .customize-live-preview {
    grid-template-columns: 94px minmax(0, 1fr);
    min-height: 104px;
    gap: 11px;
    padding: 12px;
    border-radius: 20px;
  }

  html body .customize-preview-map { width: 94px; height: 76px; }
  html body .customize-preview-capsule { display: none; }
  html body .customize-preview-route { left: 13px; width: 62px; }
  html body .customize-category-row { grid-template-columns: 48px minmax(0, 1fr) 48px 44px; gap: 6px; }
  html body .customize-inline-controls { grid-template-columns: minmax(0, 1fr); }
  html body .customize-single-color { grid-template-columns: minmax(0, 1fr) 48px; justify-items: start; align-items: center; }
  html body .customize-symbol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body .customize-text-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 390px) {
  html body .customize-live-preview { grid-template-columns: 82px minmax(0, 1fr); }
  html body .customize-preview-map { width: 82px; }
  html body .customize-category-row { grid-template-columns: 46px minmax(0, 1fr) 44px; }
  html body .customize-remove-category { grid-column: 2 / 4; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-mymappi-personality="playful"] body #homeJourney .life-chapter-card::before {
    animation: none !important;
  }
}
