:root {
  --pg-mp-ink: #2f2a1f;
  --pg-mp-muted: rgba(47, 42, 31, 0.68);
  --pg-mp-border: rgba(128, 106, 77, 0.34);
  --pg-mp-paper: rgba(255, 252, 245, 0.98);
  --pg-mp-gold: #9d8255;
  --pg-mp-gold-dark: #755d38;
}

.pg-mp-guide {
  box-sizing: border-box;
  width: min(100%, 1688px);
  margin: 16px auto 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  border: 1px solid var(--pg-mp-border);
  border-radius: 16px;
  background: var(--pg-mp-paper);
  box-shadow: 0 12px 28px rgba(74, 59, 37, 0.08);
  color: var(--pg-mp-ink);
  font-family: inherit;
}

.pg-mp-guide > .pg-mp-help-trigger {
  margin-left: 16px;
}

.pg-mp-guide-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.pg-mp-guide-copy strong {
  font-size: clamp(0.98rem, 1.35vw, 1.12rem);
  line-height: 1.25;
}

.pg-mp-guide-copy span {
  color: var(--pg-mp-muted);
  font-size: clamp(0.8rem, 1.1vw, 0.94rem);
  line-height: 1.4;
}

.pg-mp-help-trigger,
.pg-mp-help-close,
.pg-mp-coach > .pg-mp-coach-dismiss {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
  height: 44px !important;
  max-height: none !important;
  border: 1px solid var(--pg-mp-border);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--pg-mp-ink);
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.pg-mp-help-trigger:hover,
.pg-mp-help-trigger:focus-visible,
.pg-mp-help-close:hover,
.pg-mp-help-close:focus-visible,
.pg-mp-coach-dismiss:hover,
.pg-mp-coach-dismiss:focus-visible {
  border-color: var(--pg-mp-gold-dark);
  outline: 3px solid rgba(157, 130, 85, 0.24);
  outline-offset: 2px;
}

.pg-mp-help-panel {
  box-sizing: border-box;
  width: min(100%, 1688px);
  margin: -4px auto 16px;
  padding: 14px 16px;
  border: 1px solid var(--pg-mp-border);
  border-radius: 16px;
  background: #fffdf8;
  color: var(--pg-mp-ink);
  box-shadow: 0 14px 32px rgba(74, 59, 37, 0.1);
}

.pg-mp-help-panel[hidden] {
  display: none !important;
}

.pg-mp-help-panel ol {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 8px;
  line-height: 1.45;
}

.pg-mp-help-panel-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.pg-mp-discoverability-stage {
  position: relative !important;
}

.pg-mp-coach {
  position: absolute;
  z-index: 70;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(92%, 520px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(117, 93, 56, 0.44);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  color: var(--pg-mp-ink);
  box-shadow: 0 14px 34px rgba(47, 42, 31, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: pgMpCoachIn 180ms ease-out both;
}

.pg-mp-coach-copy {
  min-width: 0;
  font: inherit;
  font-weight: 800;
  line-height: 1.3;
}

.pg-mp-coach-dismiss {
  flex: 0 0 auto;
  margin-left: 12px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--pg-mp-ink, #2f2a1f);
  border-color: var(--pg-mp-border, rgba(128, 106, 77, 0.34));
  box-shadow: none;
  animation: pgMpCoachDismissCue 3600ms cubic-bezier(.4, 0, .2, 1) 400ms 1 both;
}

.pg-mp-coach > .pg-mp-coach-dismiss:hover,
.pg-mp-coach > .pg-mp-coach-dismiss:focus-visible,
.pg-mp-coach > .pg-mp-coach-dismiss:active {
  background: #fffdf8;
  color: var(--pg-mp-ink, #2f2a1f);
  animation: none;
}

.pg-mp-coach > .pg-mp-coach-dismiss:focus-visible {
  outline: 3px solid var(--pg-mp-gold-dark, #755d38);
  outline-offset: 2px;
}

.nlp-plot-zone.pg-mp-coach-target {
  stroke: #fff9ed !important;
  stroke-width: 3.2px !important;
  fill: rgba(255, 249, 224, 0.3) !important;
  filter: drop-shadow(0 0 8px rgba(117, 93, 56, 0.98)) !important;
  animation: pgMpPlotAttention 900ms ease-in-out infinite;
}

.pg-mp-target-marker {
  position: absolute;
  z-index: 71;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  border: 3px solid #fffdf8;
  border-radius: 999px;
  background: rgba(157, 130, 85, 0.24);
  box-shadow: 0 0 0 4px rgba(117, 93, 56, 0.92), 0 8px 22px rgba(47, 42, 31, 0.3);
  pointer-events: none;
  animation: pgMpMarkerAttention 1050ms ease-out infinite;
}

.pg-mp-target-marker::before,
.pg-mp-target-marker::after {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  bottom: -10px;
  left: -10px;
  inset: -10px;
  border: 3px solid rgba(255, 253, 248, 0.96);
  border-radius: inherit;
  opacity: 0;
  animation: pgMpMarkerRipple 1050ms ease-out infinite;
}

.pg-mp-target-marker::after {
  animation-delay: 350ms;
}

.pg-mp-target-marker-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fffdf8;
  box-shadow: 0 0 0 4px var(--pg-mp-gold-dark);
}

@keyframes pgMpCoachIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pgMpCoachDismissCue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(128, 106, 77, 0); }
  50% {
    box-shadow: 0 0 0 4px rgba(128, 106, 77, 0.14);
  }
}

@keyframes pgMpPlotAttention {
  0%, 100% { stroke-opacity: 0.78; fill-opacity: 0.7; }
  50% { stroke-opacity: 1; fill-opacity: 1; }
}

@keyframes pgMpMarkerAttention {
  0%, 100% { transform: translate(-50%, -50%) scale(0.94); }
  50% { transform: translate(-50%, -50%) scale(1.12); }
}

@keyframes pgMpMarkerRipple {
  0% { transform: scale(0.72); opacity: 0.95; }
  100% { transform: scale(1.42); opacity: 0; }
}

@media (max-width: 767px) {
  .pg-mp-guide {
    margin: 12px 0;
    padding: 12px max(12px, env(safe-area-inset-left)) 12px max(12px, env(safe-area-inset-right));
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .pg-mp-help-trigger {
    margin-top: 10px;
    margin-left: 0;
    width: 100%;
    min-height: 48px !important;
    height: 48px !important;
  }

  .pg-mp-help-panel {
    margin: 0 0 12px;
  }

  .pg-mp-coach {
    top: 10px;
    top: max(10px, env(safe-area-inset-top));
    width: calc(100% - 24px);
    max-width: none;
    justify-content: space-between;
    border-radius: 16px;
  }

  .pg-mp-target-marker {
    width: 46px;
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pg-mp-coach,
  .pg-mp-coach-dismiss,
  .nlp-plot-zone.pg-mp-coach-target,
  .pg-mp-target-marker,
  .pg-mp-target-marker::before,
  .pg-mp-target-marker::after {
    animation: none !important;
    transition: none !important;
  }
}
