/* mz-upsell.css — shared Pro-conversion layer (meter pill, limit modal,
   delight toast, PRO badges). Loaded on the cosmic tool pages + library.php,
   which are dark-themed; a light fallback rides on :root[data-theme="light"].
   Everything is fixed/absolute overlay UI — it never reflows tool layout. */

/* ── usage meter pill ─────────────────────────────────────────────────── */

/* Bottom-CENTER slim pill bar: the left edge belongs to the rail menu and the
   right edge to the Tweaks panel/FAB — neither may be covered, and a low
   one-line bar keeps the tool content behind it readable. Always visible — no
   close control; it disappears only for Pro/admin accounts. */
#mzup-meter {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 14px;
  width: auto;
  max-width: calc(100vw - 110px);
  padding: 8px 10px 8px 16px;
  border-radius: 99px;
  background: linear-gradient(160deg, rgba(30, 27, 52, .97), rgba(18, 16, 34, .97));
  border: 1px solid rgba(167, 142, 240, .35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  color: #ece9f8;
  font: 13px/1.35 "Segoe UI", system-ui, sans-serif;
  backdrop-filter: blur(6px);
}

.mzup-meter-uses {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.mzup-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffc857;
  box-shadow: 0 0 8px rgba(255, 200, 87, .8);
}
#mzup-meter.mzup-meter-low .mzup-dot {
  background: #ff7a7a;
  box-shadow: 0 0 8px rgba(255, 122, 122, .8);
}

.mzup-compare {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}
.mzup-compare-col {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  white-space: nowrap;
}
.mzup-compare-free {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #b6b2c9;
}
.mzup-compare-pro {
  background: linear-gradient(160deg, rgba(167, 142, 240, .22), rgba(126, 87, 220, .16));
  border: 1px solid rgba(167, 142, 240, .55);
  color: #e9e2ff;
}
.mzup-compare-tier {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.mzup-compare-pro .mzup-compare-tier { color: #c9b6ff; }
.mzup-compare-val { font-size: 14px; font-weight: 700; }
.mzup-compare-sub { font-size: 10px; opacity: .7; }
.mzup-compare-vs {
  font-size: 10px;
  font-weight: 700;
  color: #8f8aa6;
  text-transform: uppercase;
}

.mzup-gopro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 99px;
  white-space: nowrap;
  background: linear-gradient(90deg, #7e57dc, #a78ef0);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.mzup-gopro:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(126, 87, 220, .5);
  color: #fff;
}

/* ── limit-hit modal ──────────────────────────────────────────────────── */

.mzup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 6, 18, .72);
  backdrop-filter: blur(4px);
  animation: mzup-fade .18s ease;
}
@keyframes mzup-fade { from { opacity: 0; } to { opacity: 1; } }

.mzup-modal {
  position: relative;
  width: 560px;
  max-width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 26px 26px 20px;
  border-radius: 18px;
  background: linear-gradient(170deg, #221e3e, #14111f);
  border: 1px solid rgba(167, 142, 240, .35);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
  color: #ece9f8;
  font: 14px/1.5 "Segoe UI", system-ui, sans-serif;
}

.mzup-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  color: #8f8aa6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
}
.mzup-modal-close:hover { color: #fff; }

.mzup-modal-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #c9b6ff;
  margin-bottom: 6px;
}
.mzup-modal-title {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.25;
  color: #fff;
}
.mzup-modal-sub { margin: 0; color: #b6b2c9; }
.mzup-reset { color: #ffc857; }

.mzup-perks {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.mzup-perks li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: #d8d4ea;
}
.mzup-perks li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: #7ee2a8;
  font-weight: 700;
}
/* Lead perk: the tool the user is holding right now — full width, starred. */
.mzup-perks .mzup-perk-tool {
  grid-column: 1 / -1;
  font-size: 14px;
  color: #fff;
}
.mzup-perks .mzup-perk-tool::before { content: "\2605"; color: #ffc857; }

.mzup-plans {
  display: flex;
  gap: 12px;
  margin: 6px 0 14px;
}
.mzup-plans-loading { color: #8f8aa6; padding: 18px 0; width: 100%; text-align: center; }

.mzup-plan {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 14px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  text-align: center;
}
.mzup-plan-best {
  background: linear-gradient(170deg, rgba(167, 142, 240, .16), rgba(126, 87, 220, .08));
  border-color: rgba(167, 142, 240, .6);
}
.mzup-plan-flag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, #7e57dc, #a78ef0);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mzup-plan-name { font-size: 13px; font-weight: 700; color: #c9b6ff; }
.mzup-plan-price { font-size: 26px; font-weight: 800; color: #fff; }
.mzup-plan-was { font-size: 16px; font-weight: 600; color: #8f8aa6; margin-right: 2px; }
.mzup-plan-deal { font-size: 11px; font-weight: 600; color: #ffc857; }
.mzup-plan-per { font-size: 13px; font-weight: 500; color: #8f8aa6; }
.mzup-plan-note { font-size: 11px; color: #8f8aa6; margin-bottom: 4px; }

.mzup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.mzup-btn-primary {
  background: linear-gradient(90deg, #7e57dc, #a78ef0);
  color: #fff;
}
.mzup-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(126, 87, 220, .5);
  color: #fff;
}
.mzup-btn-ghost {
  background: none;
  border: 1px solid rgba(255, 255, 255, .25);
  color: #d8d4ea;
}
.mzup-btn-ghost:hover { border-color: rgba(167, 142, 240, .7); color: #fff; }
.mzup-btn:disabled { opacity: .55; cursor: wait; }
.mzup-loading .mzup-btn-label { opacity: .6; }
.mzup-login-cta { width: 100%; }

.mzup-social {
  text-align: center;
  font-size: 13px;
  color: #b6b2c9;
  padding: 10px 0 2px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.mzup-social strong { color: #ffc857; }

.mzup-modal-foot { display: flex; justify-content: center; margin-top: 10px; }
.mzup-details-link { font-weight: 500; }

/* ── delight toast ────────────────────────────────────────────────────── */

.mzup-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 10040;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(30, 27, 52, .97), rgba(18, 16, 34, .97));
  border: 1px solid rgba(167, 142, 240, .4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  color: #ece9f8;
  font: 13px/1.4 "Segoe UI", system-ui, sans-serif;
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.mzup-toast-in { transform: translate(-50%, 0); opacity: 1; }
.mzup-toast-emoji { font-size: 16px; }
.mzup-toast-cta {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #7e57dc, #a78ef0);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.mzup-toast-cta:hover { color: #fff; }
.mzup-toast-close {
  border: 0;
  background: none;
  color: #8f8aa6;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
}
.mzup-toast-close:hover { color: #fff; }

/* ── PRO badge over locked chordresult controls ───────────────────────── */

.mzup-badge {
  position: absolute;
  top: -9px;
  right: -6px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 99px;
  background: linear-gradient(90deg, #7e57dc, #a78ef0);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
  transition: transform .15s ease;
}
.mzup-badge:hover { transform: scale(1.12); color: #fff; }

/* ── light theme fallback ─────────────────────────────────────────────── */

:root[data-theme="light"] #mzup-meter,
:root[data-theme="light"] .mzup-toast {
  background: #fff;
  border-color: rgba(126, 87, 220, .4);
  color: #2a2537;
  box-shadow: 0 12px 32px rgba(40, 30, 80, .2);
}
:root[data-theme="light"] .mzup-compare-free {
  background: rgba(0, 0, 0, .04);
  border-color: rgba(0, 0, 0, .1);
  color: #6a6580;
}
:root[data-theme="light"] .mzup-compare-pro {
  background: linear-gradient(160deg, rgba(126, 87, 220, .14), rgba(126, 87, 220, .07));
  border-color: rgba(126, 87, 220, .55);
  color: #4a2f96;
}
:root[data-theme="light"] .mzup-compare-pro .mzup-compare-tier { color: #6d4fc4; }
:root[data-theme="light"] #mzup-meter .mzup-compare-sub { opacity: .85; }
:root[data-theme="light"] .mzup-modal {
  background: #fff;
  border-color: rgba(126, 87, 220, .35);
  color: #2a2537;
}
:root[data-theme="light"] .mzup-modal-title { color: #1c1828; }
:root[data-theme="light"] .mzup-modal-sub,
:root[data-theme="light"] .mzup-social,
:root[data-theme="light"] .mzup-perks li { color: #4d4863; }
:root[data-theme="light"] .mzup-perks .mzup-perk-tool { color: #1c1828; }
:root[data-theme="light"] .mzup-perks .mzup-perk-tool::before { color: #b07a12; }
:root[data-theme="light"] .mzup-plan {
  background: rgba(0, 0, 0, .03);
  border-color: rgba(0, 0, 0, .12);
}
:root[data-theme="light"] .mzup-plan-price { color: #1c1828; }
:root[data-theme="light"] .mzup-plan-deal { color: #b07a12; }
:root[data-theme="light"] .mzup-btn-ghost {
  border-color: rgba(0, 0, 0, .25);
  color: #4d4863;
}
:root[data-theme="light"] .mzup-social { border-top-color: rgba(0, 0, 0, .08); }
:root[data-theme="light"] .mzup-social strong { color: #b07a12; }

/* ── mobile ───────────────────────────────────────────────────────────── */

/* When the meter occupies bottom-center, the toast slides in above it. */
.mzup-toast-raised { bottom: 72px; }

@media (max-width: 740px) {
  /* Narrow screens: the pill folds into a compact two-row card, centered in
     the CONTENT area — the 56px touch rail offsets the visual middle. */
  #mzup-meter {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    bottom: 10px;
    left: calc(50% + 28px);
    max-width: calc(100vw - 76px);
    padding: 10px 14px 10px;
    border-radius: 16px;
    font-size: 12px;
  }
  #mzup-meter .mzup-meter-uses { white-space: normal; justify-content: center; text-align: center; }
  #mzup-meter .mzup-compare { justify-content: center; }
  .mzup-toast-raised { bottom: 120px; }
  .mzup-plans { flex-direction: column; }
  .mzup-perks { grid-template-columns: 1fr; }
  .mzup-modal { padding: 20px 16px 16px; }
  .mzup-toast { bottom: 12px; flex-wrap: wrap; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .mzup-overlay, .mzup-toast, .mzup-gopro, .mzup-btn, .mzup-badge { transition: none; animation: none; }
}
