/* MyMappi v778 — targeted color-accessibility safeguards.
   This layer changes contrast only. It intentionally leaves layout, category
   colors, Ticketmaster violet, the coral signature, and personal palettes
   untouched. Load it after the feature-specific color layers. */

:root {
  --mymappi-a11y-action-gradient: var(
    --mymappi-action-primary-gradient,
    linear-gradient(112deg, #00243f 0%, #075965 54%, #0b806e 100%)
  );
  --mymappi-a11y-muted: var(--mymappi-text-muted, #4f6b70);
  --mymappi-a11y-focus: #0a5966;
  --mymappi-a11y-symbol-dark: #052f39;
}

/* White text must not cross the former bright mint/aqua endpoints. Every
   stop in this fallback gradient supports at least 4.5:1 against white. */
html body .auth-gate .account-auth-button.primary,
html body .app-shell .memory-editor .memory-place-search-button,
html body main.app-shell .memory-editor .memory-place-search-button,
html body .app-shell .map-stage.map-focus .location-banner button,
html body main.app-shell section.map-stage.map-focus .location-banner button,
html body .app-shell .first-memory-location-allow,
html body .our-map-story-publish,
html body .our-map-stories-add,
html body .our-map-place-request-submit,
html body .our-map-pin-key-done,
html body #ourMapAllNearby[aria-pressed="true"],
html body .our-map-result-actions button.is-primary,
html body #ourMapContributionsDone,
html body .our-map-empty-actions button:first-child,
html body .our-map-florida-city-jumps-list button:is(.is-active, [aria-pressed="true"]),
html body .our-map-result-actions button[data-our-map-result-save]:not([aria-pressed="true"]):not(.is-saved),
html body main.app-shell section.map-stage.map-focus.our-map-mode .our-map-filters button[aria-pressed="true"] {
  border-color: rgba(11, 114, 100, 0.42) !important;
  color: #ffffff !important;
  background: var(--mymappi-a11y-action-gradient) !important;
}

html body main.app-shell section.map-stage.map-focus.our-map-mode .our-map-popup .popup-route:not(.subtle):not(:disabled) {
  border-color: rgba(11, 114, 100, 0.42) !important;
  color: #ffffff !important;
  background: var(--mymappi-a11y-action-gradient) !important;
}

/* Small white action symbols use the same safe paint. Coral request marks are
   deliberately excluded so the product's signature contribution state stays. */
html body .first-memory-location-consent-icon,
html body .our-map-live-sign-in > span:first-child,
html body .our-map-contribute-mark,
html body .capture-choice-dialog.is-from-our-map .capture-choice-mark,
html body :is(.our-map-visit-prompt-mark, .our-map-contributions-mark),
html body .our-map-contribution-symbol:not(.is-request),
html body .customize-choice-card:has(input:checked) .customize-choice-check {
  color: #ffffff !important;
  background: var(--mymappi-a11y-action-gradient) !important;
}

/* Authentication copy should remain quiet, but never faint. Error copy keeps
   its existing red semantic treatment. */
html body .auth-form-heading span,
html body .auth-gate-form label,
html body .auth-local-divider,
html body .auth-local-option > span,
html body .auth-verification-panel p,
html body .auth-card > .account-auth-message:not(.error) {
  color: var(--mymappi-a11y-muted) !important;
  opacity: 1 !important;
}

/* One AA-oriented muted role replaces low-contrast local grays in the two
   most copy-dense personal areas. */
html body main.app-shell > section.map-stage.memories-focus > section.memory-database-page.side-panel {
  --memory-lane-muted: var(--mymappi-a11y-muted) !important;
  --memory-card-v3-muted: var(--mymappi-a11y-muted) !important;
}

html body :is(
  .customize-mymappi-heading p,
  .customize-section-heading p,
  .customize-view-note,
  .customize-preview-copy span,
  .customize-choice-card small,
  .customize-category-empty,
  .customize-field-help,
  .customize-single-color,
  .customize-symbol-grid small,
  .customize-text-fields label,
  .customize-mymappi-status
) {
  color: var(--mymappi-a11y-muted) !important;
}

html body .customize-view-switcher button small {
  opacity: 1 !important;
}

html body :is(.customize-preview-copy small, .customize-step-label) {
  color: #0b776f !important;
}

html body .our-map-live-sign-in small,
html body main.app-shell section.map-stage.map-focus.our-map-mode .our-map-spot-count,
html body .our-map-data-attribution,
html body .our-map-data-attribution-inline {
  color: var(--mymappi-a11y-muted) !important;
}

/* Focus is an interaction state, not decoration. A solid ocean ring remains
   visible on the app's porcelain, mint, and sky surfaces without reflow. */
html body .auth-gate :is(button, a, input):focus-visible,
html body .customize-view-switcher button:focus-visible,
html body .customize-choice-card:has(input:focus-visible),
html body .customize-color-field:has(input:focus-visible),
html body .customize-mymappi-close:focus-visible,
html body .customize-mymappi-actions button:focus-visible,
html body main.app-shell section.map-stage.map-focus .map-scope-switch button:focus-visible,
html body :is(#ourMapAllNearby, .our-map-mood-choices button, #ourMapShowAllResults, #ourMapLiveSignInButton):focus-visible,
html body .our-map-florida-city-jumps-list button:focus-visible,
html body .our-map-use-location:focus-visible,
html body .our-map-empty-actions button:focus-visible,
html body .our-map-result-main:focus-visible,
html body .our-map-result-actions button:focus-visible,
html body .our-map-popup :is(button, a):focus-visible,
html body :is(.our-map-data-attribution, .our-map-data-attribution-inline) a:focus-visible {
  outline: 3px solid var(--mymappi-a11y-focus) !important;
  outline-offset: 3px !important;
}

/* The contrast tone was already calculated for real and draft memory pins.
   Consume it consistently in the editor, the map, and the live studio preview. */
html body .mymappi-pin-only[data-pin-contrast="dark"] .memory-pin-symbol,
html body #memoryPinPreview[data-pin-contrast="dark"] .memory-pin-symbol {
  fill: var(--mymappi-a11y-symbol-dark) !important;
  stroke: rgba(255, 255, 255, 0.78) !important;
  stroke-width: 0.75px !important;
  paint-order: stroke fill !important;
}

html body #customizeMymappiPreview[data-pin-contrast="dark"] .customize-preview-pin,
html body #customizeMymappiPreview[data-chapter-contrast="dark"] .customize-preview-chapter-symbol {
  color: var(--mymappi-a11y-symbol-dark) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

html body #customizeMymappiPreview[data-pin-contrast="light"] .customize-preview-pin,
html body #customizeMymappiPreview[data-chapter-contrast="light"] .customize-preview-chapter-symbol {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(5, 47, 57, 0.72);
}

/* Provider identity stays violet; only the very small provenance/status type
   becomes readable at phone distance. Pin seal geometry remains unchanged. */
html body main.app-shell section.map-stage.map-focus .our-map-place-pin .our-map-pin-label {
  font-size: 0.42rem !important;
  font-weight: 950 !important;
}

html body :is(.our-map-result-source, .our-map-result-trust) {
  font-size: 0.64rem !important;
}

html body .our-map-result-event-status {
  font-size: 0.64rem !important;
}

html body .our-map-event-status-message {
  font-size: 0.68rem !important;
}

html body main.app-shell section.map-stage.map-focus.our-map-mode > .our-map-data-attribution:not([hidden]),
html body .our-map-data-attribution-inline:not([hidden]) {
  font-size: 0.65rem !important;
}

@media (forced-colors: active) {
  html body :is(
    .our-map-story-publish,
    .our-map-stories-add,
    .our-map-place-request-submit,
    .our-map-pin-key-done,
    #ourMapContributionsDone,
    .our-map-empty-actions button:first-child
  ) {
    border: 2px solid ButtonText !important;
    color: ButtonText !important;
    background: ButtonFace !important;
    box-shadow: none !important;
    forced-color-adjust: auto;
  }

  html body .mymappi-pin-only .memory-pin-symbol,
  html body #memoryPinPreview .memory-pin-symbol {
    fill: CanvasText !important;
    stroke: Canvas !important;
  }
}
