/*
 * Monster Progression Expansion
 * Scoped companion styles for breeding, condensation, Soul Charms, and
 * end-game crafting. Every public class is prefixed with mpx- so this file
 * can sit beside the existing world/dashboard styles without changing them.
 */

:where(
  .mpx-shell,
  .mpx-farm-dashboard,
  .mpx-progression-card,
  .mpx-condense-card,
  .mpx-soul-card,
  .mpx-craft-card,
  .mpx-dv-card
) {
  --mpx-ink: #111821;
  --mpx-soft: #566272;
  --mpx-muted: #7b8794;
  --mpx-line: rgba(19, 33, 45, 0.14);
  --mpx-line-strong: rgba(19, 33, 45, 0.23);
  --mpx-paper: rgba(255, 255, 255, 0.92);
  --mpx-paper-soft: rgba(247, 250, 252, 0.86);
  --mpx-teal: #168466;
  --mpx-teal-bright: #42cba5;
  --mpx-teal-wash: rgba(66, 203, 165, 0.14);
  --mpx-violet: #7258c9;
  --mpx-violet-wash: rgba(114, 88, 201, 0.13);
  --mpx-gold: #c98a1c;
  --mpx-gold-bright: #f1bd4f;
  --mpx-gold-wash: rgba(240, 180, 64, 0.16);
  --mpx-danger: #b9423d;
  --mpx-danger-wash: rgba(185, 66, 61, 0.1);
  --mpx-radius: 10px;
  --mpx-radius-small: 7px;
  --mpx-shadow: 0 16px 42px rgba(15, 27, 36, 0.14);
  color: var(--mpx-ink);
}

/* Removable world-collection presentation. The real map remains untouched:
   these elements exist only for the short object-to-player absorption arc. */
.mpx-pickup-flight,
.mpx-pickup-burst {
  position: fixed;
  z-index: 46;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.mpx-pickup-flight {
  left: 0;
  top: 0;
  contain: layout style;
  isolation: isolate;
  will-change: transform, opacity;
}

.mpx-pickup-flight__viewport,
.mpx-pickup-flight__halo {
  position: absolute;
  display: block;
  pointer-events: none;
}

.mpx-pickup-flight__viewport {
  inset: 0;
  z-index: 1;
  overflow: hidden;
  transform-origin: center;
}

.mpx-pickup-flight__viewport img,
.mpx-pickup-flight__viewport canvas {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  pointer-events: none;
  image-rendering: auto;
}

.mpx-pickup-flight__halo {
  z-index: 0;
  inset: -38%;
  border-radius: 50%;
  opacity: 0.7;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--mpx-pickup-color, #b8f5ff) 64%, transparent) 0 12%,
    color-mix(in srgb, var(--mpx-pickup-color, #b8f5ff) 24%, transparent) 30%,
    transparent 68%
  );
  mix-blend-mode: screen;
  animation: mpx-pickup-halo-pulse 360ms ease-in-out infinite alternate;
}

.mpx-pickup-burst {
  width: 30px;
  height: 30px;
  border: 1.5px solid color-mix(in srgb, var(--mpx-pickup-color, #b8f5ff) 82%, white);
  border-radius: 50%;
  box-shadow:
    0 0 10px color-mix(in srgb, var(--mpx-pickup-color, #b8f5ff) 70%, transparent),
    inset 0 0 8px color-mix(in srgb, var(--mpx-pickup-color, #b8f5ff) 42%, transparent);
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

.mpx-pickup-burst::before,
.mpx-pickup-burst::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 3px;
  height: 24px;
  border-radius: 99px;
  background: linear-gradient(
    transparent,
    color-mix(in srgb, var(--mpx-pickup-color, #b8f5ff) 88%, white),
    transparent
  );
  transform: translate(-50%, -50%);
}

.mpx-pickup-burst::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.mpx-pickup-burst.is-target {
  width: 38px;
  height: 38px;
  border-width: 2px;
}

#mpxVisualQaPanel {
  position: fixed;
  z-index: 120;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto minmax(220px, 38vw) auto;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 20px);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: #f7fbff;
  background: rgba(8, 13, 20, 0.92);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(12px);
  font: 600 11px/1.2 system-ui, sans-serif;
}

#mpxVisualQaPanel select,
#mpxVisualQaPanel button {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  color: #f7fbff;
  background: rgba(255, 255, 255, 0.08);
}

#mpxVisualQaPanel select {
  min-width: 0;
  padding: 0 8px;
}

#mpxVisualQaPanel button {
  min-width: 32px;
  margin-left: 4px;
  cursor: pointer;
}

@media (max-width: 640px) {
  #mpxVisualQaPanel {
    left: 8px;
    right: 8px;
    grid-template-columns: 1fr auto;
  }

  #mpxVisualQaPanel strong {
    display: none;
  }
}

@keyframes mpx-pickup-halo-pulse {
  from {
    opacity: 0.48;
    transform: scale(0.9);
  }
  to {
    opacity: 0.76;
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mpx-pickup-flight__halo {
    animation: none;
  }
}

.mpx-shell {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.mpx-kicker {
  margin: 0;
  color: var(--mpx-teal);
  font-size: 0.69rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.mpx-title {
  min-width: 0;
  margin: 0;
  color: var(--mpx-ink);
  font-family: inherit;
  font-size: clamp(1.18rem, 2.4vw, 1.6rem);
  font-weight: 950;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.mpx-copy,
.mpx-note {
  margin: 0;
  color: var(--mpx-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.mpx-note {
  font-size: 0.74rem;
}

.mpx-badge,
.mpx-rank-badge,
.mpx-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--mpx-line);
  border-radius: 999px;
  color: var(--mpx-soft);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.mpx-rank-badge,
.mpx-status-badge {
  color: #66440a;
  background: linear-gradient(180deg, #fff7d9, #fbe5a7);
  border-color: rgba(164, 111, 17, 0.26);
}

.mpx-primary-button,
.mpx-secondary-button,
.mpx-danger-button,
.mpx-plus-button,
.mpx-page-button,
.mpx-collect-all,
.mpx-upgrade-button,
.mpx-craft-button,
.mpx-condense-button {
  min-height: 38px;
  border: 1px solid rgba(17, 82, 66, 0.3);
  border-radius: var(--mpx-radius-small);
  padding: 0 13px;
  color: #08271f;
  background: linear-gradient(180deg, #8ae4ca, #51c49f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 5px 12px rgba(31, 119, 92, 0.14);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 950;
}

.mpx-primary-button:hover,
.mpx-primary-button:focus-visible,
.mpx-collect-all:hover,
.mpx-collect-all:focus-visible,
.mpx-upgrade-button:hover,
.mpx-upgrade-button:focus-visible,
.mpx-craft-button:hover,
.mpx-craft-button:focus-visible,
.mpx-condense-button:hover,
.mpx-condense-button:focus-visible {
  border-color: rgba(17, 82, 66, 0.5);
  background: linear-gradient(180deg, #9defd6, #5cd1aa);
  outline: none;
}

.mpx-secondary-button,
.mpx-page-button {
  color: var(--mpx-ink);
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--mpx-line);
  box-shadow: none;
}

.mpx-secondary-button:hover,
.mpx-secondary-button:focus-visible,
.mpx-page-button:hover,
.mpx-page-button:focus-visible {
  background: var(--mpx-teal-wash);
  border-color: rgba(22, 132, 102, 0.34);
  outline: none;
}

.mpx-danger-button {
  color: #511512;
  background: linear-gradient(180deg, #ffd8d3, #f1ada7);
  border-color: rgba(148, 43, 37, 0.28);
  box-shadow: none;
}

.mpx-danger-button:hover,
.mpx-danger-button:focus-visible {
  background: linear-gradient(180deg, #ffe2de, #f4b7b1);
  border-color: rgba(148, 43, 37, 0.46);
  outline: none;
}

.mpx-primary-button:disabled,
.mpx-secondary-button:disabled,
.mpx-danger-button:disabled,
.mpx-plus-button:disabled,
.mpx-page-button:disabled,
.mpx-collect-all:disabled,
.mpx-upgrade-button:disabled,
.mpx-craft-button:disabled,
.mpx-condense-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.46;
  transform: none;
}

/* Bulk breeding farm ------------------------------------------------------ */

.mpx-farm-dashboard {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.mpx-farm-banner {
  position: relative;
  display: grid;
  gap: 10px;
  overflow: hidden;
  padding: 13px;
  border: 1px solid rgba(24, 121, 91, 0.2);
  border-radius: var(--mpx-radius);
  color: var(--mpx-ink);
  background:
    radial-gradient(circle at 92% -18%, rgba(78, 206, 164, 0.3), transparent 43%),
    radial-gradient(circle at 8% 130%, rgba(241, 189, 79, 0.2), transparent 48%),
    linear-gradient(180deg, rgba(251, 255, 253, 0.95), rgba(239, 249, 244, 0.9));
  box-shadow: 0 10px 26px rgba(29, 89, 68, 0.09);
}

.mpx-farm-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.5), transparent 30%);
}

.mpx-farm-banner > * {
  position: relative;
  z-index: 1;
}

.mpx-farm-banner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mpx-farm-banner-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mpx-farm-tier {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 3px;
}

.mpx-farm-tier strong {
  color: var(--mpx-teal);
  font-size: 1.05rem;
  font-weight: 950;
}

.mpx-farm-tier span {
  color: var(--mpx-muted);
  font-size: 0.65rem;
  font-weight: 850;
  text-transform: uppercase;
}

.mpx-farm-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.mpx-summary-cell {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(17, 85, 66, 0.11);
  border-radius: var(--mpx-radius-small);
  background: rgba(255, 255, 255, 0.67);
}

.mpx-summary-cell span,
.mpx-summary-cell small {
  display: block;
  overflow: hidden;
  color: var(--mpx-muted);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mpx-summary-cell strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--mpx-ink);
  font-size: 0.92rem;
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-farm-aura-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mpx-aura-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(112, 79, 190, 0.2);
  border-radius: 999px;
  color: #433574;
  background: rgba(237, 230, 255, 0.72);
  font-size: 0.69rem;
  font-weight: 850;
}

.mpx-aura-chip img {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  object-fit: contain;
}

.mpx-aura-chip strong {
  color: #2d2254;
}

.mpx-aura-empty {
  color: var(--mpx-muted);
  background: rgba(255, 255, 255, 0.62);
  border-color: var(--mpx-line);
}

.mpx-farm-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mpx-page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.mpx-page-button {
  min-width: 36px;
  min-height: 34px;
  padding: 0 9px;
}

.mpx-page-active,
.mpx-page-active:hover,
.mpx-page-active:focus-visible {
  color: #0a3e31;
  background: rgba(91, 212, 176, 0.28);
  border-color: rgba(22, 132, 102, 0.42);
  box-shadow: inset 0 -2px 0 rgba(22, 132, 102, 0.52);
}

.mpx-farm-action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.mpx-collect-all::before {
  content: "\2726";
  margin-right: 6px;
}

.mpx-upgrade-button {
  color: #513800;
  background: linear-gradient(180deg, #ffe8a2, #efbd4d);
  border-color: rgba(143, 95, 10, 0.28);
}

.mpx-upgrade-button:hover,
.mpx-upgrade-button:focus-visible {
  border-color: rgba(143, 95, 10, 0.5);
  background: linear-gradient(180deg, #fff0bd, #f5c960);
}

.mpx-upgrade-price {
  margin-left: 5px;
  opacity: 0.78;
  white-space: nowrap;
}

.mpx-locked-pen,
.mpx-locked-message {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
  border: 1px dashed rgba(79, 92, 103, 0.3);
  border-radius: var(--mpx-radius);
  color: var(--mpx-soft);
  background:
    repeating-linear-gradient(-45deg, rgba(44, 59, 71, 0.025) 0 7px, transparent 7px 14px),
    rgba(245, 247, 248, 0.76);
  text-align: center;
}

.mpx-lock-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(77, 88, 97, 0.2);
  border-radius: 50%;
  color: #68737d;
  background: rgba(255, 255, 255, 0.74);
  font-size: 1rem;
}

.mpx-locked-message strong {
  color: #394550;
  font-size: 0.8rem;
}

.mpx-locked-message span {
  color: var(--mpx-muted);
  font-size: 0.7rem;
}

/* Monster details + condensation status ---------------------------------- */

.mpx-progression-card {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 14px 0 4px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(78, 59, 139, 0.2);
  border-radius: var(--mpx-radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(138, 111, 224, 0.17), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(66, 203, 165, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.91), rgba(246, 246, 252, 0.88));
}

.mpx-progression-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--mpx-violet), var(--mpx-teal-bright));
}

.mpx-progression-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.mpx-progression-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mpx-progression-title h3 {
  margin: 0;
  color: var(--mpx-ink);
  font-size: 0.95rem;
  font-weight: 950;
}

.mpx-progression-title span {
  color: var(--mpx-muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.mpx-stage-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.mpx-stage {
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  color: var(--mpx-muted);
  background: rgba(255, 255, 255, 0.64);
  text-align: center;
}

.mpx-stage strong,
.mpx-stage span {
  display: block;
}

.mpx-stage strong {
  color: var(--mpx-ink);
  font-size: 0.77rem;
}

.mpx-stage span {
  margin-top: 2px;
  font-size: 0.62rem;
}

.mpx-stage-complete {
  border-color: rgba(22, 132, 102, 0.28);
  color: #2d6d59;
  background: rgba(66, 203, 165, 0.14);
}

.mpx-stage-current {
  border-color: rgba(114, 88, 201, 0.42);
  background: rgba(114, 88, 201, 0.12);
  box-shadow: inset 0 0 0 1px rgba(114, 88, 201, 0.09);
}

.mpx-stage-locked {
  opacity: 0.6;
}

.mpx-progress-meter {
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(35, 44, 53, 0.1);
  border-radius: 999px;
  background: rgba(28, 38, 48, 0.09);
}

.mpx-progress-meter > i {
  display: block;
  width: var(--mpx-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mpx-violet), var(--mpx-teal-bright));
  transition: width 260ms ease;
}

.mpx-progression-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mpx-progression-stat {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  background: rgba(255, 255, 255, 0.62);
}

.mpx-progression-stat span,
.mpx-progression-stat strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-progression-stat span {
  color: var(--mpx-muted);
  font-size: 0.61rem;
  font-weight: 850;
  text-transform: uppercase;
}

.mpx-progression-stat strong {
  margin-top: 2px;
  color: var(--mpx-teal);
  font-size: 0.86rem;
  font-weight: 950;
}

.mpx-progression-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mpx-pve-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--mpx-muted);
  font-size: 0.66rem;
  font-weight: 800;
}

/* Condensation modal ------------------------------------------------------ */

.mpx-condense-card {
  width: min(780px, 96vw);
  max-height: min(760px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  padding: clamp(14px, 2.4vw, 22px);
  color: var(--mpx-ink);
  background:
    radial-gradient(circle at 90% -10%, rgba(117, 87, 207, 0.19), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 247, 251, 0.95));
  border: 1px solid rgba(31, 38, 49, 0.17);
  border-radius: var(--mpx-radius);
  box-shadow: var(--mpx-shadow);
}

.mpx-condense-hero {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mpx-condense-portrait {
  width: 76px;
  height: 76px;
  padding: 4px;
  object-fit: contain;
  border: 1px solid rgba(114, 88, 201, 0.2);
  border-radius: var(--mpx-radius);
  background:
    radial-gradient(circle, rgba(154, 131, 230, 0.18), transparent 68%),
    rgba(255, 255, 255, 0.72);
  filter: drop-shadow(0 7px 9px rgba(27, 25, 49, 0.13));
}

.mpx-condense-hero-copy {
  min-width: 0;
}

.mpx-condense-hero-copy h2,
.mpx-condense-hero-copy h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--mpx-ink);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 950;
}

.mpx-condense-hero-copy p {
  margin: 4px 0 0;
  color: var(--mpx-soft);
  font-size: 0.76rem;
  line-height: 1.4;
}

.mpx-condense-requirement {
  display: grid;
  justify-items: end;
  min-width: 90px;
  padding: 8px 10px;
  border: 1px solid rgba(114, 88, 201, 0.2);
  border-radius: var(--mpx-radius-small);
  background: var(--mpx-violet-wash);
}

.mpx-condense-requirement strong {
  color: #48358e;
  font-size: 1.12rem;
}

.mpx-condense-requirement span {
  color: #695d8b;
  font-size: 0.62rem;
  font-weight: 850;
  text-transform: uppercase;
}

.mpx-condense-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid rgba(185, 66, 61, 0.22);
  border-radius: var(--mpx-radius-small);
  color: #74302c;
  background: var(--mpx-danger-wash);
  font-size: 0.73rem;
  font-weight: 750;
  line-height: 1.4;
}

.mpx-condense-warning strong {
  color: #8c2e28;
}

.mpx-donor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mpx-donor-toolbar strong {
  color: var(--mpx-ink);
  font-size: 0.84rem;
}

.mpx-donor-count {
  color: var(--mpx-violet);
  font-size: 0.72rem;
  font-weight: 950;
}

.mpx-donor-list {
  flex: 1 1 auto;
  min-height: 112px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 2px 3px 2px 0;
  overscroll-behavior: contain;
}

.mpx-donor-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  color: var(--mpx-ink);
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 100ms ease;
}

.mpx-donor-row:hover,
.mpx-donor-row:focus-within {
  border-color: rgba(114, 88, 201, 0.37);
  background: rgba(246, 242, 255, 0.84);
}

.mpx-donor-selected {
  border-color: rgba(114, 88, 201, 0.52);
  background: rgba(232, 224, 255, 0.64);
  box-shadow: inset 3px 0 0 var(--mpx-violet);
}

.mpx-donor-disabled {
  cursor: not-allowed;
  filter: grayscale(0.45);
  opacity: 0.54;
}

.mpx-donor-row img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.mpx-donor-info {
  min-width: 0;
}

.mpx-donor-info strong,
.mpx-donor-info span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-donor-info strong {
  font-size: 0.79rem;
}

.mpx-donor-info span {
  margin-top: 2px;
  color: var(--mpx-muted);
  font-size: 0.65rem;
}

.mpx-donor-check {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--mpx-line-strong);
  border-radius: 50%;
  color: transparent;
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.74rem;
  font-weight: 950;
}

.mpx-donor-selected .mpx-donor-check {
  color: #fff;
  background: var(--mpx-violet);
  border-color: var(--mpx-violet);
}

.mpx-donor-empty {
  display: grid;
  place-items: center;
  min-height: 126px;
  padding: 16px;
  border: 1px dashed var(--mpx-line-strong);
  border-radius: var(--mpx-radius);
  color: var(--mpx-muted);
  background: rgba(255, 255, 255, 0.54);
  font-size: 0.76rem;
  line-height: 1.45;
  text-align: center;
}

.mpx-condense-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--mpx-line);
}

.mpx-condense-footer-copy {
  color: var(--mpx-soft);
  font-size: 0.7rem;
  line-height: 1.35;
}

/* Soul Charm dashboard ---------------------------------------------------- */

.mpx-soul-card {
  width: min(1040px, 97vw);
  max-height: min(820px, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow: hidden;
  padding: clamp(13px, 2vw, 20px);
  color: var(--mpx-ink);
  background:
    radial-gradient(circle at 10% -10%, rgba(52, 206, 199, 0.17), transparent 38%),
    radial-gradient(circle at 95% 5%, rgba(125, 82, 210, 0.15), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 249, 0.96));
  border: 1px solid rgba(24, 49, 56, 0.17);
  border-radius: var(--mpx-radius);
  box-shadow: var(--mpx-shadow);
}

.mpx-soul-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mpx-soul-head-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mpx-soul-head-copy h2 {
  margin: 0;
  color: var(--mpx-ink);
  font-family: inherit;
  font-size: clamp(1.2rem, 2.7vw, 1.62rem);
  font-weight: 950;
  letter-spacing: -0.025em;
}

.mpx-soul-head-copy p {
  margin: 0;
  color: var(--mpx-soft);
  font-size: 0.76rem;
  line-height: 1.4;
}

.mpx-shard-balances {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.mpx-shard-balance {
  display: grid;
  grid-template-columns: 30px minmax(50px, auto);
  align-items: center;
  gap: 7px;
  min-width: 94px;
  padding: 6px 8px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  background: rgba(255, 255, 255, 0.72);
}

.mpx-shard-balance img {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(50, 74, 85, 0.2));
}

.mpx-shard-balance span {
  color: var(--mpx-muted);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.mpx-shard-balance strong {
  color: var(--mpx-ink);
  font-size: 0.86rem;
  line-height: 1;
}

.mpx-shard-whisper {
  border-color: rgba(47, 168, 165, 0.21);
  background: rgba(218, 251, 247, 0.64);
}

.mpx-shard-resonant {
  border-color: rgba(196, 58, 52, 0.24);
  background: rgba(255, 229, 226, 0.68);
}

.mpx-shard-crown {
  border-color: rgba(173, 116, 17, 0.22);
  background: rgba(255, 244, 209, 0.68);
}

.mpx-soul-dashboard {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(480px, 1.6fr);
  gap: 10px;
}

.mpx-soul-party-panel,
.mpx-soul-tuning-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius);
  background: rgba(255, 255, 255, 0.65);
}

.mpx-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mpx-panel-heading h3 {
  margin: 0;
  color: var(--mpx-ink);
  font-size: 0.87rem;
  font-weight: 950;
}

.mpx-panel-heading span {
  color: var(--mpx-muted);
  font-size: 0.63rem;
  font-weight: 850;
}

.mpx-party-selector {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  padding-right: 2px;
}

.mpx-party-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 62px;
  padding: 7px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  color: var(--mpx-ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  cursor: pointer;
  text-align: left;
}

.mpx-party-card:hover,
.mpx-party-card:focus-visible {
  border-color: rgba(22, 132, 102, 0.34);
  background: rgba(226, 249, 241, 0.74);
  outline: none;
}

.mpx-party-selected,
.mpx-party-selected:hover,
.mpx-party-selected:focus-visible {
  border-color: rgba(22, 132, 102, 0.48);
  background: rgba(208, 245, 233, 0.76);
  box-shadow: inset 3px 0 0 var(--mpx-teal);
}

.mpx-party-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 5px 7px rgba(16, 43, 36, 0.15));
}

.mpx-party-info {
  min-width: 0;
}

.mpx-party-info strong,
.mpx-party-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-party-info strong {
  font-size: 0.75rem;
}

.mpx-party-info span {
  margin-top: 2px;
  color: var(--mpx-muted);
  font-size: 0.62rem;
}

.mpx-party-investment {
  display: grid;
  justify-items: end;
  color: var(--mpx-violet);
  font-size: 0.65rem;
  font-weight: 950;
}

.mpx-soul-monster-head {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--mpx-line);
}

.mpx-soul-monster-head img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.mpx-soul-monster-copy {
  min-width: 0;
}

.mpx-soul-monster-copy strong,
.mpx-soul-monster-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-soul-monster-copy strong {
  color: var(--mpx-ink);
  font-size: 0.9rem;
}

.mpx-soul-monster-copy span {
  margin-top: 3px;
  color: var(--mpx-muted);
  font-size: 0.65rem;
}

.mpx-soul-total {
  display: grid;
  justify-items: end;
  gap: 1px;
}

.mpx-soul-total strong {
  color: var(--mpx-teal);
  font-size: 1rem;
}

.mpx-soul-total span {
  color: var(--mpx-muted);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
}

.mpx-soul-stat-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  padding-right: 2px;
}

.mpx-soul-stat-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.52fr) minmax(182px, 1.8fr) 72px 36px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  background: rgba(255, 255, 255, 0.75);
}

.mpx-soul-stat-name {
  min-width: 0;
}

.mpx-soul-stat-name strong,
.mpx-soul-stat-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-soul-stat-name strong {
  color: var(--mpx-ink);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.mpx-soul-stat-name span {
  margin-top: 2px;
  color: var(--mpx-muted);
  font-size: 0.59rem;
}

.mpx-soul-track {
  display: grid;
  grid-template-columns: repeat(13, minmax(5px, 1fr));
  gap: 3px;
  min-width: 0;
}

.mpx-soul-pip {
  position: relative;
  height: 14px;
  overflow: hidden;
  border: 1px solid rgba(35, 49, 58, 0.17);
  border-radius: 3px;
  background: rgba(35, 49, 58, 0.08);
  box-shadow: inset 0 1px 2px rgba(18, 30, 37, 0.08);
}

.mpx-soul-pip-filled {
  border-color: rgba(23, 132, 103, 0.38);
  background: linear-gradient(180deg, #7fe2c5, #34b991);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 0 5px rgba(52, 185, 145, 0.25);
}

.mpx-soul-pip-gold {
  border-color: rgba(160, 107, 14, 0.36);
  background: linear-gradient(180deg, #ffe699, #e9ad32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    0 0 6px rgba(226, 167, 49, 0.25);
}

.mpx-soul-pip-locked {
  border-color: rgba(84, 73, 51, 0.2);
  background:
    repeating-linear-gradient(-45deg, rgba(84, 73, 51, 0.12) 0 2px, transparent 2px 4px),
    rgba(236, 231, 219, 0.58);
  opacity: 0.68;
}

.mpx-soul-pip-next {
  animation: mpx-pip-pulse 1.7s ease-in-out infinite;
}

.mpx-soul-cost {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  color: var(--mpx-soft);
  font-size: 0.64rem;
  font-weight: 900;
  white-space: nowrap;
}

.mpx-soul-cost img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.mpx-plus-button {
  width: 34px;
  min-width: 34px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
}

.mpx-soul-maxed {
  color: var(--mpx-gold);
  font-size: 0.66rem;
  font-weight: 950;
  text-align: right;
}

.mpx-soul-lock-note {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid rgba(167, 114, 24, 0.19);
  border-radius: var(--mpx-radius-small);
  color: #6c5424;
  background: rgba(255, 244, 211, 0.65);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.35;
}

@keyframes mpx-pip-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(69, 202, 163, 0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(69, 202, 163, 0.18);
  }
}

/* Prismatic Binding / Apex crafting -------------------------------------- */

.mpx-craft-card {
  width: min(760px, 96vw);
  max-height: min(720px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: clamp(15px, 2.4vw, 22px);
  color: var(--mpx-ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(101, 221, 218, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 249, 0.96));
  border: 1px solid rgba(21, 62, 66, 0.18);
  border-radius: var(--mpx-radius);
  box-shadow: var(--mpx-shadow);
}

.mpx-craft-head {
  display: grid;
  gap: 4px;
  text-align: center;
}

.mpx-craft-head h2 {
  margin: 0;
  color: var(--mpx-ink);
  font-family: inherit;
  font-size: clamp(1.24rem, 3vw, 1.7rem);
  font-weight: 950;
}

.mpx-craft-head p {
  max-width: 570px;
  margin: 0 auto;
  color: var(--mpx-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.mpx-craft-recipe {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr)) 42px minmax(138px, 1.15fr);
  align-items: stretch;
  gap: 8px;
}

.mpx-recipe-node,
.mpx-recipe-result {
  position: relative;
  min-width: 0;
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.mpx-recipe-node img,
.mpx-recipe-result img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(17, 59, 64, 0.17));
}

.mpx-recipe-node strong,
.mpx-recipe-result strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--mpx-ink);
  font-size: 0.76rem;
}

.mpx-recipe-node span,
.mpx-recipe-result span {
  color: var(--mpx-muted);
  font-size: 0.64rem;
  font-weight: 850;
}

.mpx-recipe-result {
  border-color: rgba(191, 132, 28, 0.3);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 222, 119, 0.32), transparent 57%),
    rgba(255, 249, 230, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 226, 139, 0.35);
}

.mpx-recipe-result::after {
  content: "";
  position: absolute;
  inset: -70%;
  pointer-events: none;
  background: conic-gradient(from 0deg, transparent, rgba(255, 225, 132, 0.25), transparent 22%);
  animation: mpx-craft-glint 6s linear infinite;
}

.mpx-recipe-result > * {
  position: relative;
  z-index: 1;
}

.mpx-recipe-arrow {
  display: grid;
  place-items: center;
  color: var(--mpx-gold);
  font-size: 1.55rem;
  font-weight: 950;
}

.mpx-recipe-owned,
.mpx-recipe-missing {
  display: inline-flex;
  justify-content: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
}

.mpx-recipe-owned {
  color: #176247;
  background: rgba(75, 199, 159, 0.14);
}

.mpx-recipe-missing {
  color: #963f37;
  background: rgba(206, 83, 73, 0.11);
}

.mpx-craft-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  background: rgba(255, 255, 255, 0.66);
}

.mpx-craft-summary-copy {
  min-width: 0;
}

.mpx-craft-summary-copy strong,
.mpx-craft-summary-copy span {
  display: block;
}

.mpx-craft-summary-copy strong {
  color: var(--mpx-ink);
  font-size: 0.81rem;
}

.mpx-craft-summary-copy span {
  margin-top: 2px;
  color: var(--mpx-muted);
  font-size: 0.66rem;
}

@keyframes mpx-craft-glint {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive behavior ---------------------------------------------------- */

@media (max-width: 900px) {
  .mpx-farm-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mpx-soul-head {
    display: grid;
  }

  .mpx-shard-balances {
    justify-content: flex-start;
  }

  .mpx-soul-dashboard {
    grid-template-columns: minmax(180px, 0.68fr) minmax(410px, 1.5fr);
  }

  .mpx-soul-stat-row {
    grid-template-columns: 70px minmax(154px, 1fr) 62px 34px;
    gap: 6px;
  }

  .mpx-craft-recipe {
    grid-template-columns: repeat(3, minmax(94px, 1fr)) 34px minmax(118px, 1.05fr);
    gap: 6px;
  }
}

@media (max-width: 720px) {
  .mpx-farm-banner-head,
  .mpx-farm-actions,
  .mpx-progression-head,
  .mpx-progression-actions,
  .mpx-condense-footer,
  .mpx-craft-summary {
    align-items: stretch;
    display: grid;
  }

  .mpx-farm-tier {
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
    align-items: baseline;
    gap: 7px;
  }

  .mpx-farm-action-group {
    justify-content: stretch;
  }

  .mpx-farm-action-group > * {
    flex: 1 1 auto;
  }

  .mpx-progression-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mpx-condense-hero {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .mpx-condense-portrait {
    width: 66px;
    height: 66px;
  }

  .mpx-condense-requirement {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    align-items: baseline;
    justify-content: start;
    justify-items: start;
    gap: 6px;
  }

  .mpx-soul-card {
    max-height: calc(100dvh - 12px);
  }

  .mpx-soul-dashboard {
    overflow: auto;
    grid-template-columns: 1fr;
    align-content: start;
  }

  .mpx-soul-party-panel,
  .mpx-soul-tuning-panel {
    overflow: visible;
  }

  .mpx-party-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .mpx-soul-stat-list {
    overflow: visible;
  }

  .mpx-soul-stat-row {
    grid-template-columns: 72px minmax(142px, 1fr) 64px 34px;
  }

  .mpx-craft-recipe {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mpx-recipe-arrow {
    grid-column: 1 / -1;
    min-height: 24px;
    transform: rotate(90deg);
  }

  .mpx-recipe-result {
    grid-column: 1 / -1;
    min-height: 124px;
  }
}

@media (max-width: 520px) {
  .mpx-farm-summary,
  .mpx-progression-stats {
    grid-template-columns: 1fr 1fr;
  }

  .mpx-page-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mpx-page-button {
    width: 100%;
  }

  .mpx-stage-track {
    grid-template-columns: 1fr;
  }

  .mpx-stage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
  }

  .mpx-stage span {
    margin-top: 0;
  }

  .mpx-donor-toolbar {
    align-items: flex-start;
    display: grid;
  }

  .mpx-donor-row {
    grid-template-columns: 40px minmax(0, 1fr) 24px;
  }

  .mpx-donor-row img {
    width: 40px;
    height: 40px;
  }

  .mpx-shard-balances {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mpx-shard-balance {
    grid-template-columns: 24px minmax(0, 1fr);
    min-width: 0;
    padding: 5px;
  }

  .mpx-shard-balance img {
    width: 24px;
    height: 24px;
  }

  .mpx-party-selector {
    grid-template-columns: 1fr;
  }

  .mpx-soul-stat-row {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 6px 8px;
  }

  .mpx-soul-stat-name {
    grid-column: 1;
  }

  .mpx-soul-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .mpx-soul-cost {
    grid-column: 1;
    grid-row: 3;
    justify-content: flex-start;
  }

  .mpx-plus-button,
  .mpx-soul-maxed {
    grid-column: 2;
    grid-row: 1;
  }

  .mpx-craft-recipe {
    grid-template-columns: 1fr;
  }

  .mpx-recipe-node,
  .mpx-recipe-result {
    grid-column: auto;
    min-height: 112px;
  }

  .mpx-recipe-arrow {
    grid-column: auto;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .mpx-condense-card,
  .mpx-soul-card,
  .mpx-craft-card {
    width: min(1060px, calc(100vw - 12px));
    max-height: calc(100dvh - 12px);
    padding: 10px;
  }

  .mpx-soul-head {
    display: flex;
  }

  .mpx-soul-dashboard {
    grid-template-columns: minmax(180px, 0.66fr) minmax(440px, 1.6fr);
    overflow: hidden;
  }

  .mpx-soul-party-panel,
  .mpx-soul-tuning-panel,
  .mpx-party-selector,
  .mpx-soul-stat-list {
    overflow: auto;
  }

  .mpx-party-selector {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mpx-recipe-node,
  .mpx-recipe-result {
    min-height: 116px;
  }

  .mpx-recipe-node img,
  .mpx-recipe-result img {
    width: 54px;
    height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mpx-progress-meter > i,
  .mpx-donor-row {
    transition: none;
  }

  .mpx-soul-pip-next,
  .mpx-recipe-result::after {
    animation: none;
  }
}

/*
 * Runtime markup alignment -------------------------------------------------
 *
 * The expansion script intentionally keeps its injected HTML compact. These
 * selectors map that live structure onto the component language above without
 * requiring extra wrapper elements or leaking styles into the base game.
 */

.mpx-farm-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(24, 121, 91, 0.2);
  border-radius: var(--mpx-radius);
  background:
    radial-gradient(circle at 92% -18%, rgba(78, 206, 164, 0.3), transparent 43%),
    radial-gradient(circle at 8% 130%, rgba(241, 189, 79, 0.2), transparent 48%),
    linear-gradient(180deg, rgba(251, 255, 253, 0.95), rgba(239, 249, 244, 0.9));
  box-shadow: 0 10px 26px rgba(29, 89, 68, 0.09);
}

.mpx-farm-title > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mpx-farm-title strong {
  overflow-wrap: anywhere;
  color: var(--mpx-ink);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.mpx-farm-talents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mpx-farm-talents > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid rgba(112, 79, 190, 0.2);
  border-radius: 999px;
  color: #433574;
  background: rgba(237, 230, 255, 0.72);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.25;
}

.mpx-farm-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mpx-page-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.mpx-page-tabs > button,
.mpx-farm-controls > [data-mpx-collect-all],
.mpx-condense-open,
.mpx-condense-footer > button {
  min-height: 36px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  padding: 0 11px;
  color: var(--mpx-ink);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 950;
}

.mpx-page-tabs > button {
  min-width: 42px;
}

.mpx-page-tabs > button:hover,
.mpx-page-tabs > button:focus-visible,
.mpx-condense-footer > button:hover,
.mpx-condense-footer > button:focus-visible {
  border-color: rgba(22, 132, 102, 0.34);
  background: var(--mpx-teal-wash);
  outline: none;
}

.mpx-page-tabs > button.is-active,
.mpx-page-tabs > button.is-active:hover,
.mpx-page-tabs > button.is-active:focus-visible {
  color: #0a3e31;
  background: rgba(91, 212, 176, 0.28);
  border-color: rgba(22, 132, 102, 0.42);
  box-shadow: inset 0 -2px 0 rgba(22, 132, 102, 0.52);
}

.mpx-farm-controls > [data-mpx-collect-all],
.mpx-condense-open,
.mpx-condense-commit {
  color: #08271f;
  background: linear-gradient(180deg, #8ae4ca, #51c49f);
  border-color: rgba(17, 82, 66, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 5px 12px rgba(31, 119, 92, 0.14);
}

.mpx-farm-controls > [data-mpx-collect-all]::before {
  content: "\2726";
  margin-right: 6px;
}

.mpx-farm-controls > [data-mpx-collect-all]:hover,
.mpx-farm-controls > [data-mpx-collect-all]:focus-visible,
.mpx-condense-open:hover,
.mpx-condense-open:focus-visible,
.mpx-condense-commit:hover,
.mpx-condense-commit:focus-visible {
  border-color: rgba(17, 82, 66, 0.5);
  background: linear-gradient(180deg, #9defd6, #5cd1aa);
  outline: none;
}

.mpx-farm-controls > [data-mpx-collect-all]:disabled,
.mpx-condense-open:disabled,
.mpx-condense-commit:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.46;
}

.mpx-farm-max,
.mpx-maxed {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(164, 111, 17, 0.23);
  border-radius: 999px;
  color: #66440a;
  background: linear-gradient(180deg, #fff7d9, #fbe5a7);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.25;
}

.mpx-progression-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mpx-progression-head h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--mpx-ink);
  font-size: 0.95rem;
  font-weight: 950;
}

.mpx-stage-dot {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  color: var(--mpx-muted);
  background: rgba(255, 255, 255, 0.64);
  text-align: center;
}

.mpx-stage-dot b,
.mpx-stage-dot small {
  display: block;
}

.mpx-stage-dot b {
  color: var(--mpx-ink);
  font-size: 0.77rem;
}

.mpx-stage-dot small {
  font-size: 0.62rem;
}

.mpx-progression-stats > span {
  display: grid;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  color: var(--mpx-muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.2;
}

.mpx-progression-stats > span strong {
  color: var(--mpx-teal);
  font-size: 0.86rem;
  font-weight: 950;
}

.mpx-progression-card > p {
  margin: 0;
  color: var(--mpx-muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.4;
}

.mpx-condense-open {
  width: fit-content;
  max-width: 100%;
  min-height: 38px;
  white-space: normal;
}

.mpx-condense-hero {
  grid-template-columns: 76px minmax(0, 1fr);
}

.mpx-condense-hero > img {
  width: 76px;
  height: 76px;
  padding: 4px;
  object-fit: contain;
  border: 1px solid rgba(114, 88, 201, 0.2);
  border-radius: var(--mpx-radius);
  background:
    radial-gradient(circle, rgba(154, 131, 230, 0.18), transparent 68%),
    rgba(255, 255, 255, 0.72);
  filter: drop-shadow(0 7px 9px rgba(27, 25, 49, 0.13));
}

.mpx-condense-hero > div {
  min-width: 0;
}

.mpx-condense-hero h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--mpx-ink);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 950;
}

.mpx-condense-hero p {
  margin: 4px 0 0;
  color: var(--mpx-soft);
  font-size: 0.76rem;
  line-height: 1.4;
}

.mpx-condense-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mpx-condense-summary > span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(114, 88, 201, 0.15);
  border-radius: var(--mpx-radius-small);
  color: var(--mpx-muted);
  background: rgba(255, 255, 255, 0.64);
  font-size: 0.67rem;
  font-weight: 800;
  text-align: center;
}

.mpx-condense-summary strong {
  color: var(--mpx-violet);
  font-size: 0.82rem;
}

.mpx-donor-row > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.mpx-donor-row > span strong,
.mpx-donor-row > span small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-donor-row > span strong {
  font-size: 0.79rem;
}

.mpx-donor-row > span small {
  color: var(--mpx-muted);
  font-size: 0.65rem;
}

.mpx-donor-row > b {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--mpx-line-strong);
  border-radius: 50%;
  color: var(--mpx-violet);
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-weight: 950;
}

.mpx-donor-selected > b {
  color: #fff;
  background: var(--mpx-violet);
  border-color: var(--mpx-violet);
}

.mpx-rare-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(185, 66, 61, 0.22);
  border-radius: var(--mpx-radius-small);
  color: #74302c;
  background: var(--mpx-danger-wash);
  font-size: 0.71rem;
  font-weight: 750;
  line-height: 1.4;
}

.mpx-rare-confirm input {
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--mpx-danger);
}

.mpx-condense-footer > button {
  flex: 0 0 auto;
}

.mpx-soul-hero {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.mpx-soul-hero > img {
  width: 68px;
  height: 68px;
  padding: 4px;
  object-fit: contain;
  border: 1px solid rgba(52, 168, 165, 0.2);
  border-radius: var(--mpx-radius);
  background: rgba(227, 252, 248, 0.68);
  filter: drop-shadow(0 7px 10px rgba(42, 97, 91, 0.2));
}

.mpx-soul-hero > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mpx-soul-hero h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--mpx-ink);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  font-weight: 950;
  letter-spacing: -0.025em;
}

.mpx-soul-hero p {
  margin: 0;
  color: var(--mpx-soft);
  font-size: 0.75rem;
  line-height: 1.4;
}

.mpx-shard-wallet {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.mpx-shard-balance b,
.mpx-shard-balance small {
  display: block;
  min-width: 0;
}

.mpx-shard-balance b {
  color: var(--mpx-ink);
  font-size: 0.86rem;
  line-height: 1;
}

.mpx-shard-balance small {
  overflow: hidden;
  color: var(--mpx-muted);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mpx-soul-party,
.mpx-soul-tuning {
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius);
  background: rgba(255, 255, 255, 0.65);
}

.mpx-soul-party {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  overscroll-behavior: contain;
}

.mpx-soul-tuning {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
}

.mpx-party-card {
  grid-template-columns: 48px minmax(0, 1fr);
}

.mpx-party-card > span {
  min-width: 0;
}

.mpx-party-card > span strong,
.mpx-party-card > span small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-party-card > span strong {
  font-size: 0.75rem;
}

.mpx-party-card > span small {
  margin-top: 2px;
  color: var(--mpx-muted);
  font-size: 0.62rem;
}

.mpx-soul-target {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--mpx-line);
}

.mpx-soul-target > img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.mpx-soul-target > div {
  min-width: 0;
}

.mpx-soul-target strong,
.mpx-soul-target span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-soul-target strong {
  color: var(--mpx-ink);
  font-size: 0.9rem;
}

.mpx-soul-target span {
  margin-top: 3px;
  color: var(--mpx-muted);
  font-size: 0.65rem;
}

.mpx-soul-stat-label {
  min-width: 0;
}

.mpx-soul-stat-label strong,
.mpx-soul-stat-label span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-soul-stat-label strong {
  color: var(--mpx-ink);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.mpx-soul-stat-label span {
  margin-top: 2px;
  color: var(--mpx-muted);
  font-size: 0.59rem;
}

.mpx-soul-stat-row > .mpx-soul-stat-label {
  grid-column: 1;
}

.mpx-soul-stat-row > .mpx-soul-track {
  grid-column: 2;
}

.mpx-soul-stat-row > .mpx-soul-cost {
  grid-column: 3;
  grid-row: 1;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}

.mpx-soul-stat-row > .mpx-plus-button {
  grid-column: 4;
  grid-row: 1;
}

.mpx-pvp-note {
  margin: 0;
  padding: 8px 9px;
  border: 1px solid rgba(114, 88, 201, 0.15);
  border-radius: var(--mpx-radius-small);
  color: var(--mpx-muted);
  background: rgba(241, 238, 251, 0.64);
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .mpx-farm-controls {
    display: grid;
    align-items: stretch;
  }

  .mpx-page-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mpx-page-tabs > button,
  .mpx-farm-controls > [data-mpx-collect-all],
  .mpx-farm-controls > .mpx-upgrade-button {
    width: 100%;
  }

  .mpx-soul-party,
  .mpx-soul-tuning {
    overflow: visible;
  }

  .mpx-soul-party {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .mpx-farm-title {
    display: grid;
  }

  .mpx-farm-title .mpx-rank-badge {
    justify-self: start;
  }

  .mpx-farm-talents {
    display: grid;
  }

  .mpx-page-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mpx-stage-dot {
    grid-template-columns: auto auto;
    justify-content: space-between;
    text-align: left;
  }

  .mpx-condense-hero {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .mpx-condense-hero > img {
    width: 60px;
    height: 60px;
  }

  .mpx-condense-summary {
    gap: 4px;
  }

  .mpx-condense-summary > span {
    display: grid;
    padding: 6px 4px;
  }

  .mpx-condense-footer > button {
    width: 100%;
  }

  .mpx-soul-hero {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .mpx-soul-hero > img {
    width: 54px;
    height: 54px;
  }

  .mpx-shard-wallet {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mpx-shard-balance {
    min-width: 0;
  }

  .mpx-soul-party {
    grid-template-columns: 1fr;
  }

  .mpx-soul-stat-row > .mpx-soul-stat-label {
    grid-column: 1;
    grid-row: 1;
  }

  .mpx-soul-stat-row > .mpx-plus-button {
    grid-column: 2;
    grid-row: 1;
  }

  .mpx-soul-stat-row > .mpx-soul-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .mpx-soul-stat-row > .mpx-soul-cost {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .mpx-soul-party,
  .mpx-soul-tuning {
    overflow: auto;
  }

  .mpx-soul-party {
    grid-template-columns: 1fr;
  }
}

/* Charmwright runtime recipe --------------------------------------------- */

.mpx-craft-hero {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mpx-craft-hero > img {
  width: 76px;
  height: 76px;
  padding: 5px;
  object-fit: contain;
  border: 1px solid rgba(40, 155, 151, 0.22);
  border-radius: var(--mpx-radius);
  background:
    radial-gradient(circle, rgba(93, 226, 218, 0.24), transparent 68%),
    rgba(241, 255, 253, 0.76);
  filter: drop-shadow(0 8px 12px rgba(17, 82, 82, 0.2));
}

.mpx-craft-hero > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mpx-craft-hero h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--mpx-ink);
  font-family: inherit;
  font-size: clamp(1.2rem, 2.8vw, 1.62rem);
  font-weight: 950;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.mpx-craft-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--mpx-soft);
  font-size: 0.76rem;
  line-height: 1.42;
}

.mpx-craft-recipe {
  grid-template-columns:
    minmax(104px, 1fr) 24px
    minmax(104px, 1fr) 24px
    minmax(104px, 1fr) 28px
    minmax(124px, 1.12fr);
  align-items: stretch;
  gap: 6px;
}

.mpx-craft-recipe > div {
  position: relative;
  min-width: 0;
  min-height: 148px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  overflow: hidden;
  padding: 9px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.mpx-craft-recipe > div > img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(17, 59, 64, 0.17));
}

.mpx-craft-recipe > div > strong,
.mpx-craft-recipe > div > span {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.mpx-craft-recipe > div > strong {
  color: var(--mpx-ink);
  font-size: 0.78rem;
  font-weight: 950;
}

.mpx-craft-recipe > div > span {
  color: var(--mpx-muted);
  font-size: 0.63rem;
  font-weight: 850;
  line-height: 1.25;
}

.mpx-craft-recipe > b {
  display: grid;
  place-items: center;
  min-width: 0;
  color: var(--mpx-gold);
  font-size: 1.35rem;
  font-weight: 950;
}

.mpx-craft-recipe > .is-ready {
  border-color: rgba(22, 132, 102, 0.28);
  background:
    radial-gradient(circle at 50% 28%, rgba(83, 214, 174, 0.17), transparent 57%),
    rgba(239, 253, 248, 0.78);
  box-shadow: inset 0 -3px 0 rgba(22, 132, 102, 0.16);
}

.mpx-craft-recipe > .is-ready > strong {
  color: #176247;
}

.mpx-craft-recipe > .is-missing {
  border-color: rgba(185, 66, 61, 0.24);
  background:
    repeating-linear-gradient(-45deg, rgba(185, 66, 61, 0.025) 0 7px, transparent 7px 14px),
    rgba(255, 246, 245, 0.78);
  box-shadow: inset 0 -3px 0 rgba(185, 66, 61, 0.12);
}

.mpx-craft-recipe > .is-missing > strong {
  color: #963f37;
}

.mpx-craft-recipe > .is-result {
  border-color: rgba(191, 132, 28, 0.32);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 222, 119, 0.38), transparent 57%),
    rgba(255, 249, 230, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(255, 226, 139, 0.38),
    0 8px 22px rgba(177, 119, 21, 0.1);
}

.mpx-craft-recipe > .is-result::after {
  content: "";
  position: absolute;
  inset: -70%;
  pointer-events: none;
  background: conic-gradient(from 0deg, transparent, rgba(255, 225, 132, 0.25), transparent 22%);
  animation: mpx-craft-glint 6s linear infinite;
}

.mpx-craft-recipe > .is-result > * {
  position: relative;
  z-index: 1;
}

.mpx-craft-recipe > .is-result > strong {
  color: #8b5b09;
}

.mpx-craft-card .dialogue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.mpx-craft-card .dialogue-actions > button {
  min-height: 38px;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  padding: 0 13px;
  color: var(--mpx-ink);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: none;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 950;
}

.mpx-craft-card .dialogue-actions > [data-mpx-craft-apex] {
  color: #513800;
  background: linear-gradient(180deg, #ffe8a2, #efbd4d);
  border-color: rgba(143, 95, 10, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 5px 12px rgba(157, 105, 16, 0.13);
}

.mpx-craft-card .dialogue-actions > [data-mpx-craft-apex]:hover,
.mpx-craft-card .dialogue-actions > [data-mpx-craft-apex]:focus-visible {
  border-color: rgba(143, 95, 10, 0.5);
  background: linear-gradient(180deg, #fff0bd, #f5c960);
  outline: none;
}

.mpx-craft-card .dialogue-actions > [data-mpx-craft-close]:hover,
.mpx-craft-card .dialogue-actions > [data-mpx-craft-close]:focus-visible {
  border-color: rgba(22, 132, 102, 0.34);
  background: var(--mpx-teal-wash);
  outline: none;
}

.mpx-craft-card .dialogue-actions > button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.46;
}

@media (max-width: 720px) {
  .mpx-craft-recipe {
    grid-template-columns:
      minmax(0, 1fr) 24px
      minmax(0, 1fr) 24px
      minmax(0, 1fr);
  }

  .mpx-craft-recipe > div:nth-of-type(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .mpx-craft-recipe > b:nth-of-type(1) {
    grid-column: 2;
    grid-row: 1;
  }

  .mpx-craft-recipe > div:nth-of-type(2) {
    grid-column: 3;
    grid-row: 1;
  }

  .mpx-craft-recipe > b:nth-of-type(2) {
    grid-column: 4;
    grid-row: 1;
  }

  .mpx-craft-recipe > div:nth-of-type(3) {
    grid-column: 5;
    grid-row: 1;
  }

  .mpx-craft-recipe > b:nth-of-type(3) {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 24px;
  }

  .mpx-craft-recipe > div:nth-of-type(4) {
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: 126px;
  }
}

@media (max-width: 520px) {
  .mpx-craft-hero {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .mpx-craft-hero > img {
    width: 58px;
    height: 58px;
  }

  .mpx-craft-recipe {
    grid-template-columns: 1fr;
  }

  .mpx-craft-recipe > div:nth-of-type(n),
  .mpx-craft-recipe > b:nth-of-type(n) {
    grid-column: 1;
    grid-row: auto;
  }

  .mpx-craft-recipe > div {
    min-height: 112px;
  }

  .mpx-craft-recipe > div > img {
    width: 56px;
    height: 56px;
  }

  .mpx-craft-recipe > b {
    min-height: 18px;
  }

  .mpx-craft-card .dialogue-actions {
    display: grid;
  }

  .mpx-craft-card .dialogue-actions > button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mpx-craft-recipe > .is-result::after {
    animation: none;
  }
}

/* Title-page visual language + responsive progression surfaces ------------ */

:where(
  .mpx-shell,
  .mpx-farm-dashboard,
  .mpx-progression-card,
  .mpx-condense-card,
  .mpx-soul-card,
  .mpx-craft-card,
  .mpx-dv-card
) {
  --mpx-ink: #080808;
  --mpx-soft: #5f5d58;
  --mpx-muted: #77736c;
  --mpx-line: rgba(8, 8, 8, 0.17);
  --mpx-line-strong: rgba(8, 8, 8, 0.28);
  --mpx-paper: rgba(255, 255, 255, 0.95);
  --mpx-paper-soft: rgba(255, 255, 255, 0.84);
  --mpx-teal: #28745f;
  --mpx-teal-bright: #3fa47f;
  --mpx-teal-wash: rgba(47, 139, 108, 0.09);
  --mpx-violet: #6553a8;
  --mpx-violet-wash: rgba(101, 83, 168, 0.08);
  --mpx-gold: #a87520;
  --mpx-gold-bright: #c99536;
  --mpx-gold-wash: rgba(168, 117, 32, 0.09);
  --mpx-danger: #9d3731;
  --mpx-danger-wash: rgba(157, 55, 49, 0.07);
  --mpx-radius: 3px;
  --mpx-radius-small: 2px;
  --mpx-shadow: 0 18px 58px rgba(8, 8, 8, 0.09);
  --mpx-progression-art: url("assets/ui/monster-progression-backdrop.webp?v=progression-ui-20260723-1");
  color: var(--mpx-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard),
.modal.clean-world-modal:has(.mpx-condense-card),
.modal.clean-world-modal:has(.mpx-soul-card),
.modal.clean-world-modal:has(.mpx-craft-card),
.modal.clean-world-modal:has(.mpx-dv-card) {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.4vw, 32px);
  color-scheme: light;
  background-color: #fff;
  background-image:
    radial-gradient(ellipse 42% 44% at 50% 48%, rgba(255, 255, 255, 0.99) 0 56%, rgba(255, 255, 255, 0.72) 78%, rgba(255, 255, 255, 0.18) 100%),
    url("assets/ui/monster-progression-backdrop.webp?v=progression-ui-20260723-1");
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) > .nursery-card,
.modal.clean-world-modal:has(.mpx-condense-card) > .mpx-condense-card,
.modal.clean-world-modal:has(.mpx-soul-card) > .mpx-soul-card,
.modal.clean-world-modal:has(.mpx-craft-card) > .mpx-craft-card,
.modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card {
  position: relative;
  inset: auto;
  left: auto;
  top: auto;
  height: auto;
  max-height: calc(100dvh - clamp(24px, 4.8vw, 64px));
  overflow-x: hidden;
  padding: clamp(18px, 2.3vw, 28px);
  color: var(--mpx-ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--mpx-line);
  border-radius: 3px;
  box-shadow: var(--mpx-shadow);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) > .nursery-card {
  width: min(1180px, calc(100vw - clamp(24px, 4.8vw, 64px)));
}

.modal.clean-world-modal:has(.mpx-condense-card) > .mpx-condense-card {
  width: min(820px, calc(100vw - clamp(24px, 4.8vw, 64px)));
}

.modal.clean-world-modal:has(.mpx-soul-card) > .mpx-soul-card {
  width: min(980px, calc(100vw - clamp(24px, 4.8vw, 64px)));
}

.modal.clean-world-modal:has(.mpx-craft-card) > .mpx-craft-card {
  width: min(960px, calc(100vw - clamp(24px, 4.8vw, 64px)));
  overflow-y: auto;
}

.modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card {
  width: min(840px, calc(100vw - clamp(24px, 4.8vw, 64px)));
}

@media (min-width: 721px) {
  .modal.clean-world-modal:has(.mpx-soul-card) > .mpx-soul-card {
    height: min(820px, calc(100dvh - clamp(24px, 4.8vw, 64px)));
  }

  .modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card {
    height: min(720px, calc(100dvh - clamp(24px, 4.8vw, 64px)));
  }
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .world-modal-close,
.modal.clean-world-modal:has(.mpx-condense-card) .world-modal-close,
.modal.clean-world-modal:has(.mpx-soul-card) .world-modal-close,
.modal.clean-world-modal:has(.mpx-craft-card) .world-modal-close,
.modal.clean-world-modal:has(.mpx-dv-card) .world-modal-close {
  z-index: 20;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  color: #080808;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(8, 8, 8, 0.24);
  border-radius: 2px;
  box-shadow: none;
  font: 400 1.55rem/1 Georgia, "Times New Roman", serif;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .world-modal-close:hover,
.modal.clean-world-modal:has(.mpx-farm-dashboard) .world-modal-close:focus-visible,
.modal.clean-world-modal:has(.mpx-condense-card) .world-modal-close:hover,
.modal.clean-world-modal:has(.mpx-condense-card) .world-modal-close:focus-visible,
.modal.clean-world-modal:has(.mpx-soul-card) .world-modal-close:hover,
.modal.clean-world-modal:has(.mpx-soul-card) .world-modal-close:focus-visible,
.modal.clean-world-modal:has(.mpx-craft-card) .world-modal-close:hover,
.modal.clean-world-modal:has(.mpx-craft-card) .world-modal-close:focus-visible,
.modal.clean-world-modal:has(.mpx-dv-card) .world-modal-close:hover,
.modal.clean-world-modal:has(.mpx-dv-card) .world-modal-close:focus-visible {
  color: #fff;
  background: #080808;
  border-color: #080808;
}

.mpx-kicker {
  color: #4b4945;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.mpx-title,
.mpx-farm-title strong,
.mpx-progression-head h3,
.mpx-condense-hero h2,
.mpx-soul-hero h2,
.mpx-craft-hero h2 {
  color: #080808;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  text-shadow: none;
}

.mpx-copy,
.mpx-note,
.mpx-condense-hero p,
.mpx-soul-hero p,
.mpx-craft-hero p {
  color: var(--mpx-soft);
}

.mpx-badge,
.mpx-rank-badge,
.mpx-status-badge,
.mpx-farm-max,
.mpx-maxed,
.mpx-farm-talents > span {
  min-height: 28px;
  border: 1px solid var(--mpx-line);
  border-radius: 2px;
  color: #4b4945;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.mpx-rank-badge,
.mpx-status-badge,
.mpx-farm-max,
.mpx-maxed {
  color: #725017;
  background: rgba(249, 241, 221, 0.78);
  border-color: rgba(168, 117, 32, 0.22);
}

.mpx-primary-button,
.mpx-secondary-button,
.mpx-danger-button,
.mpx-plus-button,
.mpx-page-button,
.mpx-collect-all,
.mpx-upgrade-button,
.mpx-craft-button,
.mpx-condense-button,
.mpx-page-tabs > button,
.mpx-farm-controls > [data-mpx-collect-all],
.mpx-condense-open,
.mpx-condense-footer > button,
.mpx-craft-card .dialogue-actions > button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(8, 8, 8, 0.24);
  border-radius: 2px;
  color: #080808;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
  font: 800 0.76rem/1.2 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

.mpx-primary-button,
.mpx-collect-all,
.mpx-upgrade-button,
.mpx-craft-button,
.mpx-condense-button,
.mpx-farm-controls > [data-mpx-collect-all],
.mpx-condense-open,
.mpx-condense-commit,
.mpx-craft-card .dialogue-actions > [data-mpx-craft-prismatic],
.mpx-craft-card .dialogue-actions > [data-mpx-craft-apex] {
  color: #fff;
  background: #080808;
  border-color: #080808;
  box-shadow: none;
}

.mpx-primary-button:hover,
.mpx-primary-button:focus-visible,
.mpx-collect-all:hover,
.mpx-collect-all:focus-visible,
.mpx-upgrade-button:hover,
.mpx-upgrade-button:focus-visible,
.mpx-craft-button:hover,
.mpx-craft-button:focus-visible,
.mpx-condense-button:hover,
.mpx-condense-button:focus-visible,
.mpx-farm-controls > [data-mpx-collect-all]:hover,
.mpx-farm-controls > [data-mpx-collect-all]:focus-visible,
.mpx-condense-open:hover,
.mpx-condense-open:focus-visible,
.mpx-condense-commit:hover,
.mpx-condense-commit:focus-visible,
.mpx-craft-card .dialogue-actions > [data-mpx-craft-prismatic]:hover,
.mpx-craft-card .dialogue-actions > [data-mpx-craft-prismatic]:focus-visible,
.mpx-craft-card .dialogue-actions > [data-mpx-craft-apex]:hover,
.mpx-craft-card .dialogue-actions > [data-mpx-craft-apex]:focus-visible {
  color: #fff;
  background: #282725;
  border-color: #080808;
}

.mpx-secondary-button:hover,
.mpx-secondary-button:focus-visible,
.mpx-page-button:hover,
.mpx-page-button:focus-visible,
.mpx-page-tabs > button:hover,
.mpx-page-tabs > button:focus-visible,
.mpx-condense-footer > button:hover,
.mpx-condense-footer > button:focus-visible,
.mpx-craft-card .dialogue-actions > [data-mpx-craft-close]:hover,
.mpx-craft-card .dialogue-actions > [data-mpx-craft-close]:focus-visible {
  color: #080808;
  background: #f4f2ed;
  border-color: rgba(8, 8, 8, 0.42);
}

.mpx-page-tabs > button.is-active,
.mpx-page-tabs > button.is-active:hover,
.mpx-page-tabs > button.is-active:focus-visible {
  color: #fff;
  background: #080808;
  border-color: #080808;
  box-shadow: none;
}

:where(
  .mpx-primary-button,
  .mpx-secondary-button,
  .mpx-danger-button,
  .mpx-plus-button,
  .mpx-page-button,
  .mpx-collect-all,
  .mpx-upgrade-button,
  .mpx-craft-button,
  .mpx-condense-button,
  .mpx-page-tabs > button,
  .mpx-farm-controls > button,
  .mpx-donor-row,
  .mpx-party-card,
  .mpx-condense-footer > button,
  .mpx-craft-card .dialogue-actions > button
):focus-visible {
  outline: 2px solid #080808;
  outline-offset: 3px;
  box-shadow: none;
}

.mpx-primary-button:disabled,
.mpx-secondary-button:disabled,
.mpx-danger-button:disabled,
.mpx-plus-button:disabled,
.mpx-page-button:disabled,
.mpx-collect-all:disabled,
.mpx-upgrade-button:disabled,
.mpx-craft-button:disabled,
.mpx-condense-button:disabled,
.mpx-condense-open:disabled,
.mpx-condense-commit:disabled,
.mpx-craft-card .dialogue-actions > button:disabled {
  color: #7b7871;
  background: #eceae5;
  border-color: rgba(8, 8, 8, 0.13);
  filter: none;
  opacity: 0.68;
}

.mpx-farm-dashboard {
  gap: 10px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--mpx-line);
}

.mpx-farm-title {
  padding: 0 56px 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mpx-farm-title strong {
  font-size: clamp(1.25rem, 2.4vw, 1.72rem);
}

.mpx-farm-talents {
  gap: 6px;
}

.mpx-farm-talents > span {
  min-height: 30px;
  padding: 5px 9px;
  color: #56524c;
  font-size: 0.68rem;
}

.mpx-farm-controls {
  align-items: stretch;
}

.mpx-page-tabs {
  min-width: 0;
}

.mpx-page-tabs > button {
  min-width: 48px;
}

.mpx-progression-card {
  overflow: hidden;
  border: 1px solid rgba(8, 8, 8, 0.2);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.89)),
    var(--mpx-progression-art) center / cover no-repeat,
    #fff;
  box-shadow: 0 12px 34px rgba(8, 8, 8, 0.06);
}

.modal.clean-world-modal .monster-detail .mpx-progression-card,
.modal.clean-world-modal .monster-detail .mpx-progression-card h3,
.modal.clean-world-modal .monster-detail .mpx-progression-card strong,
.modal.clean-world-modal .monster-detail .mpx-progression-card p,
.modal.clean-world-modal .monster-detail .mpx-progression-card small {
  color: var(--mpx-ink) !important;
  text-shadow: none !important;
}

.modal.clean-world-modal .monster-detail .mpx-progression-card p,
.modal.clean-world-modal .monster-detail .mpx-progression-card small {
  color: var(--mpx-muted) !important;
}

.mpx-stage-dot,
.mpx-progression-stats > span,
.mpx-condense-summary > span,
.mpx-soul-party,
.mpx-soul-tuning,
.mpx-pvp-note,
.mpx-craft-recipe > div {
  border: 1px solid var(--mpx-line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

.mpx-stage-complete {
  color: #704c12;
  background: rgba(246, 236, 213, 0.83);
  border-color: rgba(168, 117, 32, 0.24);
}

.mpx-stage-current {
  background: rgba(237, 233, 247, 0.84);
  border-color: rgba(101, 83, 168, 0.28);
}

.mpx-condense-card,
.mpx-soul-card,
.mpx-craft-card {
  gap: 14px;
}

.mpx-condense-hero,
.mpx-soul-hero,
.mpx-craft-hero {
  padding-right: 52px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mpx-line);
}

.mpx-condense-hero > img,
.mpx-soul-hero > img,
.mpx-craft-hero > img {
  border: 1px solid var(--mpx-line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.72);
  filter: drop-shadow(0 6px 10px rgba(8, 8, 8, 0.1));
}

.mpx-condense-hero h2,
.mpx-soul-hero h2,
.mpx-craft-hero h2 {
  font-size: clamp(1.35rem, 3vw, 1.92rem);
}

.mpx-condense-hero h2:focus,
.mpx-soul-hero h2:focus,
.mpx-craft-hero h2:focus {
  outline: none;
}

.mpx-condense-summary > span {
  color: var(--mpx-muted);
}

.mpx-donor-list {
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.mpx-donor-row {
  min-height: 62px;
  border: 1px solid var(--mpx-line);
  border-radius: 2px;
  color: var(--mpx-ink);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

.mpx-donor-row:hover,
.mpx-donor-row:focus-visible {
  border-color: rgba(8, 8, 8, 0.4);
  background: #f7f5f0;
}

.mpx-donor-selected {
  border-color: rgba(101, 83, 168, 0.5);
  background: rgba(239, 236, 248, 0.9);
  box-shadow: inset 3px 0 0 var(--mpx-violet);
}

.mpx-donor-row > span small {
  white-space: normal;
}

.mpx-rare-confirm {
  border-radius: 2px;
}

.mpx-condense-footer {
  margin-top: 0;
  padding-top: 12px;
  background: rgba(255, 255, 255, 0.93);
  border-top: 1px solid var(--mpx-line);
}

.mpx-soul-dashboard {
  grid-template-columns: minmax(190px, 0.68fr) minmax(0, 1.55fr);
  min-height: 0;
  gap: 12px;
}

.mpx-soul-party,
.mpx-soul-tuning {
  padding: 10px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.mpx-party-card {
  min-height: 62px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--mpx-ink);
  background: transparent;
  box-shadow: none;
}

.mpx-party-card:hover,
.mpx-party-card:focus-visible {
  border-color: var(--mpx-line-strong);
  background: rgba(255, 255, 255, 0.78);
}

.mpx-party-selected {
  border-color: rgba(8, 8, 8, 0.38);
  background: #fff;
  box-shadow: inset 3px 0 0 #080808;
}

.mpx-shard-balance {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--mpx-line);
}

.mpx-soul-stat-row {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--mpx-line);
}

.mpx-soul-pip {
  border-radius: 1px;
}

.mpx-plus-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  color: #fff;
  background: #080808;
  border-color: #080808;
  font-size: 1.12rem;
}

.mpx-plus-button:hover,
.mpx-plus-button:focus-visible {
  color: #fff;
  background: #282725;
}

.mpx-pvp-note {
  color: #66635d;
}

.mpx-craft-recipe > div {
  min-height: 142px;
}

.mpx-craft-recipe > .is-ready {
  border-color: rgba(47, 139, 108, 0.27);
  background: rgba(239, 248, 244, 0.84);
  box-shadow: inset 0 -2px 0 rgba(47, 139, 108, 0.18);
}

.mpx-craft-recipe > .is-missing {
  border-color: rgba(157, 55, 49, 0.24);
  background: rgba(252, 244, 242, 0.84);
  box-shadow: inset 0 -2px 0 rgba(157, 55, 49, 0.12);
}

.mpx-craft-recipe > .is-result {
  border-color: rgba(168, 117, 32, 0.32);
  background: rgba(250, 244, 228, 0.88);
  box-shadow: inset 0 -2px 0 rgba(168, 117, 32, 0.2);
}

.mpx-craft-card .dialogue-actions {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--mpx-line);
}

.mpx-soul-card .dialogue-actions > button {
  min-height: 44px;
}

.mpx-soul-card .dialogue-actions > button:focus-visible {
  outline: 2px solid #080808;
  outline-offset: 3px;
}

html.is-touch .modal.clean-world-modal .monster-detail > .dialogue-actions > button {
  min-height: 44px;
}

/* Native Nursery pieces are part of the same feature and should not look
   like a dark legacy panel beneath the new farm dashboard. */
.modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-card > h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-body {
  gap: 14px;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) :where(
  .nursery-guide,
  .nursery-preview,
  .nursery-pen,
  .nursery-slot,
  .nursery-status,
  .nursery-candidate-row,
  .nursery-candidates .box-row
) {
  color: #080808;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--mpx-line);
  border-radius: 2px;
  box-shadow: none;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) :where(
  .nursery-overview > p,
  .nursery-slot span,
  .nursery-status span,
  .nursery-guide li,
  .nursery-preview > p
) {
  color: #5f5d58;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-slot .nursery-traits,
.modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-candidate-row .nursery-traits {
  color: #725017;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-training-bar {
  background: rgba(8, 8, 8, 0.14);
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-training-bar i {
  background: #28745f;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-dv-preview > div {
  border-radius: 2px;
  background: rgba(8, 8, 8, 0.05);
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .monster-search {
  color: #5f5d58;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .monster-search input {
  min-height: 44px;
  color: #080808;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--mpx-line);
  border-radius: 2px;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .monster-search input:focus {
  border-color: rgba(8, 8, 8, 0.48);
  outline: 2px solid #080808;
  outline-offset: 2px;
  box-shadow: none;
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .dialogue-actions {
  margin-top: 12px;
  padding-top: 12px;
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--mpx-line);
}

.modal.clean-world-modal:has(.mpx-farm-dashboard) .dialogue-actions > button {
  min-height: 44px;
  border-radius: 2px;
}

@media (max-width: 860px) {
  .mpx-farm-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mpx-page-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    width: 100%;
  }

  .mpx-page-tabs > button,
  .mpx-farm-controls > [data-mpx-collect-all],
  .mpx-farm-controls > .mpx-upgrade-button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .modal.clean-world-modal:has(.mpx-farm-dashboard),
  .modal.clean-world-modal:has(.mpx-condense-card),
  .modal.clean-world-modal:has(.mpx-soul-card),
  .modal.clean-world-modal:has(.mpx-craft-card) {
    padding: 0;
    background-position: center, center top;
    background-size: cover, 100% auto;
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) > .nursery-card,
  .modal.clean-world-modal:has(.mpx-condense-card) > .mpx-condense-card,
  .modal.clean-world-modal:has(.mpx-soul-card) > .mpx-soul-card,
  .modal.clean-world-modal:has(.mpx-craft-card) > .mpx-craft-card {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    padding:
      max(14px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) > .nursery-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-overview,
  .modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-picker,
  .modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-scroll {
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) .dialogue-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    flex: 0 0 auto;
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) .mobile-bottom-close,
  .modal.clean-world-modal:has(.mpx-soul-card) .mobile-bottom-close,
  .modal.clean-world-modal:has(.mpx-craft-card) .mobile-bottom-close {
    display: inline-flex;
  }

  .mpx-farm-title {
    display: grid;
    padding-right: 52px;
  }

  .mpx-farm-title .mpx-rank-badge {
    justify-self: start;
  }

  .mpx-farm-talents {
    display: grid;
  }

  .mpx-condense-card {
    overflow: hidden;
  }

  .mpx-donor-list {
    flex: 1 1 auto;
    overflow-y: auto;
  }

  .mpx-condense-footer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: 1fr;
    flex: 0 0 auto;
  }

  .mpx-condense-footer > button {
    width: 100%;
  }

  .mpx-soul-card,
  .mpx-craft-card {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .mpx-soul-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  .mpx-soul-party,
  .mpx-soul-tuning {
    overflow: visible;
  }

  .mpx-soul-party {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mpx-craft-recipe {
    grid-template-columns: 1fr;
  }

  .mpx-craft-recipe > div:nth-of-type(n),
  .mpx-craft-recipe > b:nth-of-type(n) {
    grid-column: 1;
    grid-row: auto;
  }

  .mpx-craft-recipe > b {
    min-height: 22px;
  }

  .mpx-craft-card .dialogue-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: 1fr;
    background: rgba(255, 255, 255, 0.96);
  }

  .mpx-craft-card .dialogue-actions > button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .mpx-condense-hero,
  .mpx-soul-hero,
  .mpx-craft-hero {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    padding-right: 48px;
  }

  .mpx-condense-hero > img,
  .mpx-soul-hero > img,
  .mpx-craft-hero > img {
    width: 56px;
    height: 56px;
  }

  .mpx-condense-summary {
    grid-template-columns: 1fr;
  }

  .mpx-shard-wallet {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mpx-soul-stat-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .mpx-soul-stat-row > .mpx-soul-stat-label {
    grid-column: 1;
    grid-row: 1;
  }

  .mpx-soul-stat-row > .mpx-plus-button {
    grid-column: 2;
    grid-row: 1;
  }

  .mpx-soul-stat-row > .mpx-soul-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .mpx-soul-stat-row > .mpx-soul-cost {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 479px) {
  .mpx-soul-party {
    grid-template-columns: 1fr;
  }
}

@media (pointer: coarse) {
  .mpx-page-tabs > button,
  .mpx-farm-controls > button,
  .mpx-condense-open,
  .mpx-condense-footer > button,
  .mpx-plus-button,
  .mpx-party-card,
  .mpx-craft-card .dialogue-actions > button,
  .modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-card button,
  .modal.clean-world-modal:has(.mpx-farm-dashboard) .monster-search input {
    min-height: 44px;
  }

  .mpx-plus-button {
    min-width: 44px;
  }
}

@media (min-width: 721px) and (max-height: 620px) and (orientation: landscape) {
  .modal.clean-world-modal:has(.mpx-farm-dashboard),
  .modal.clean-world-modal:has(.mpx-condense-card),
  .modal.clean-world-modal:has(.mpx-soul-card),
  .modal.clean-world-modal:has(.mpx-craft-card) {
    padding: 6px;
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) > .nursery-card,
  .modal.clean-world-modal:has(.mpx-condense-card) > .mpx-condense-card,
  .modal.clean-world-modal:has(.mpx-soul-card) > .mpx-soul-card,
  .modal.clean-world-modal:has(.mpx-craft-card) > .mpx-craft-card {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .mpx-soul-dashboard {
    grid-template-columns: minmax(160px, 0.58fr) minmax(0, 1.65fr);
    overflow-x: hidden;
  }

  .mpx-condense-hero,
  .mpx-soul-hero,
  .mpx-craft-hero {
    padding-bottom: 8px;
  }
}

/* Max-DV picker: expose the escalating spend before a player commits. */
.mpx-dv-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.mpx-dv-head {
  display: grid;
  gap: 4px;
  padding: 0 52px 12px 0;
  border-bottom: 1px solid var(--mpx-line);
}

.mpx-dv-head h2,
.mpx-dv-confirm h2 {
  margin: 0;
  color: #080808;
  font: 400 clamp(1.4rem, 3vw, 1.95rem)/1.08 Georgia, "Times New Roman", serif;
  letter-spacing: -0.015em;
}

.mpx-dv-head p,
.mpx-dv-confirm p {
  margin: 0;
  color: var(--mpx-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.mpx-dv-head h2:focus,
.mpx-dv-confirm h2:focus {
  outline: none;
}

.mpx-dv-card > .box-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.mpx-dv-card .bag-target-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.mpx-max-dv-row {
  min-height: 72px;
  color: #080808;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--mpx-line);
  border-radius: 2px;
  box-shadow: none;
}

.mpx-max-dv-row .monster-meta {
  color: var(--mpx-soft);
  white-space: normal;
}

.mpx-max-dv-row > button,
.mpx-dv-card .dialogue-actions > button {
  min-height: 44px;
  border: 1px solid rgba(8, 8, 8, 0.24);
  border-radius: 2px;
  color: #080808;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  font: 800 0.76rem/1.2 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.mpx-max-dv-row > button:not(:disabled),
.mpx-dv-confirm [data-mpx-maxdv-confirm] {
  color: #fff;
  background: #080808;
  border-color: #080808;
}

.mpx-max-dv-row > button:disabled {
  color: #7b7871;
  background: #eceae5;
  border-color: rgba(8, 8, 8, 0.13);
  opacity: 0.68;
}

.mpx-max-dv-row > button:focus-visible,
.mpx-dv-card .dialogue-actions > button:focus-visible {
  outline: 2px solid #080808;
  outline-offset: 3px;
}

.mpx-dv-card > .dialogue-actions {
  flex: 0 0 auto;
  margin-top: 0;
  padding-top: 12px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--mpx-line);
}

.mpx-dv-confirm {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  overflow-y: auto;
}

.mpx-dv-confirm > img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border: 1px solid var(--mpx-line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.76);
}

.mpx-dv-confirm > div:not(.dialogue-actions) {
  display: grid;
  gap: 5px;
}

.mpx-dv-confirm > .dialogue-actions {
  grid-column: 1 / -1;
}

html.is-touch .modal.clean-world-modal .mpx-dv-card .mpx-max-dv-row > button,
html.is-touch .modal.world-map-modal .mpx-dv-card .mpx-max-dv-row > button,
html.is-touch .modal.clean-world-modal .mpx-dv-card .dialogue-actions > button,
html.is-touch .modal.world-map-modal .mpx-dv-card .dialogue-actions > button {
  min-height: 44px !important;
  font-size: 0.72rem;
}

@media (max-width: 720px) {
  .modal.clean-world-modal:has(.mpx-dv-card) {
    padding: 0;
    background-position: center, center top;
    background-size: cover, 100% auto;
  }

  .modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    padding:
      max(14px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .modal.clean-world-modal:has(.mpx-dv-card) .mobile-bottom-close {
    display: inline-flex;
  }

  .mpx-dv-card > .dialogue-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
  }
}

@media (max-width: 480px) {
  html.is-touch .modal.clean-world-modal .mpx-dv-card .bag-target-list,
  html.is-touch .modal.world-map-modal .mpx-dv-card .bag-target-list,
  .mpx-dv-card .bag-target-list {
    grid-template-columns: 1fr !important;
  }

  .mpx-dv-confirm {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .mpx-dv-confirm > img {
    width: 58px;
    height: 58px;
  }

  .mpx-dv-confirm > .dialogue-actions {
    display: grid;
  }

  .mpx-dv-confirm > .dialogue-actions > button {
    width: 100%;
  }
}

@media (pointer: coarse) {
  html.is-touch .modal.clean-world-modal .mpx-dv-card .mpx-max-dv-row > button,
  html.is-touch .modal.world-map-modal .mpx-dv-card .mpx-max-dv-row > button,
  html.is-touch .modal.clean-world-modal .mpx-dv-card .dialogue-actions > button,
  html.is-touch .modal.world-map-modal .mpx-dv-card .dialogue-actions > button,
  .mpx-max-dv-row > button,
  .mpx-dv-card .dialogue-actions > button {
    min-height: 44px !important;
  }
}

@media (min-width: 721px) and (max-height: 620px) and (orientation: landscape) {
  .modal.clean-world-modal:has(.mpx-dv-card) {
    padding: 6px;
  }

  .modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }
}

@media (max-width: 720px) {
  .modal.clean-world-modal:has(.mpx-farm-dashboard) > .nursery-card,
  .modal.clean-world-modal:has(.mpx-condense-card) > .mpx-condense-card,
  .modal.clean-world-modal:has(.mpx-soul-card) > .mpx-soul-card,
  .modal.clean-world-modal:has(.mpx-craft-card) > .mpx-craft-card,
  .modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card {
    background:
      linear-gradient(rgba(255, 255, 255, 0.955), rgba(255, 255, 255, 0.955)),
      var(--mpx-progression-art) center / cover no-repeat,
      #fff;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .modal.clean-world-modal:has(.mpx-farm-dashboard),
  .modal.clean-world-modal:has(.mpx-condense-card),
  .modal.clean-world-modal:has(.mpx-soul-card),
  .modal.clean-world-modal:has(.mpx-craft-card) {
    padding: 6px;
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) > .nursery-card,
  .modal.clean-world-modal:has(.mpx-condense-card) > .mpx-condense-card,
  .modal.clean-world-modal:has(.mpx-soul-card) > .mpx-soul-card,
  .modal.clean-world-modal:has(.mpx-craft-card) > .mpx-craft-card {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    max-width: none;
    max-height: none;
    gap: 6px;
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) > .nursery-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .mpx-farm-dashboard {
    flex: 0 0 auto;
    gap: 6px;
    padding-bottom: 6px;
  }

  .mpx-farm-title {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 48px 0 0;
  }

  .mpx-farm-title strong {
    font-size: clamp(1.05rem, 3.4vw, 1.3rem);
  }

  .mpx-farm-title .mpx-rank-badge {
    align-self: center;
    justify-self: end;
  }

  .mpx-farm-talents {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .mpx-farm-talents > span {
    min-height: 30px;
    padding: 4px 7px;
  }

  .mpx-farm-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
  }

  .mpx-page-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    width: 100%;
  }

  .mpx-page-tabs > button,
  .mpx-farm-controls > [data-mpx-collect-all],
  .mpx-farm-controls > .mpx-upgrade-button {
    width: 100%;
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) .nursery-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .modal.clean-world-modal:has(.mpx-farm-dashboard) .dialogue-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 0 0 auto;
    gap: 8px;
    padding-top: 6px;
  }

  .mpx-condense-card {
    gap: 6px;
  }

  .mpx-condense-hero {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    padding-right: 48px;
    padding-bottom: 6px;
  }

  .mpx-condense-hero > img {
    width: 52px;
    height: 52px;
  }

  .mpx-condense-hero h2 {
    font-size: clamp(1.15rem, 3.8vw, 1.4rem);
  }

  .mpx-condense-hero p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.67rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .mpx-condense-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .mpx-condense-summary > span {
    min-height: 34px;
    padding: 4px 6px;
  }

  .mpx-rare-confirm {
    min-height: 34px;
    padding: 5px 7px;
    font-size: 0.62rem;
  }

  .mpx-rare-confirm > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mpx-condense-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 6px;
  }

  .mpx-soul-hero {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    padding-right: 48px;
    padding-bottom: 6px;
  }

  .mpx-soul-hero > img {
    width: 52px;
    height: 52px;
  }

  .mpx-soul-hero h2 {
    font-size: clamp(1.15rem, 3.8vw, 1.4rem);
  }

  .mpx-soul-hero p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.67rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .mpx-shard-wallet {
    gap: 5px;
  }

  .mpx-shard-balance {
    min-height: 36px;
    padding: 4px 7px;
  }

  .mpx-shard-balance img {
    width: 24px;
    height: 24px;
  }

  .mpx-soul-dashboard {
    grid-template-columns: minmax(155px, 0.58fr) minmax(0, 1.65fr);
    min-height: 0;
    gap: 8px;
    overflow: hidden;
  }

  .mpx-soul-party,
  .mpx-soul-tuning {
    padding: 7px;
  }

  .mpx-party-card {
    min-height: 52px;
  }

  .mpx-pvp-note {
    overflow: hidden;
    padding: 5px 7px;
    font-size: 0.6rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mpx-craft-card {
    gap: 6px;
  }

  .mpx-craft-hero {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    padding-right: 48px;
    padding-bottom: 6px;
  }

  .mpx-craft-hero > img {
    width: 52px;
    height: 52px;
  }

  .mpx-craft-hero h2 {
    font-size: clamp(1.15rem, 3.8vw, 1.4rem);
  }

  .mpx-craft-hero p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.67rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .mpx-craft-recipe {
    grid-template-columns:
      minmax(0, 1fr) 20px
      minmax(0, 1fr) 20px
      minmax(0, 1fr) 24px
      minmax(0, 1.1fr);
    gap: 5px;
  }

  .mpx-craft-recipe > div:nth-of-type(n),
  .mpx-craft-recipe > b:nth-of-type(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .mpx-craft-recipe > div {
    min-height: 100px;
    padding: 6px;
  }

  .mpx-craft-recipe > div > img {
    width: 48px;
    height: 48px;
  }

  .mpx-craft-recipe > b {
    min-height: 0;
  }

  .mpx-craft-card .dialogue-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 6px;
  }
}

/* Journal "Collection" panel --------------------------------------------- */
/* Permanent Wayfarer statue / catch effigy progress, injected below the
 * journal quest column by mpxShowJournalWrapped. Variables are declared
 * locally (parchment palette) because this block lives inside the core
 * journal modal, outside the shared mpx card scopes. */

.journal-modal .journal-panel-quest {
  overflow-y: auto;
}

.mpx-journal-collection {
  --mpx-ink: #080808;
  --mpx-soft: #5f5d58;
  --mpx-muted: #6b675f;
  --mpx-line: rgba(8, 8, 8, 0.17);
  --mpx-paper-soft: rgba(255, 255, 255, 0.84);
  --mpx-teal: #28745f;
  --mpx-radius-small: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mpx-collection-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mpx-collection-title > span {
  padding: 2px 8px;
  border: 1px solid var(--mpx-line);
  border-radius: 999px;
  color: var(--mpx-soft);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
}

/* Fourth journal-stats chip advertising the below-the-fold Collection block.
 * It inherits the core .journal-stats span pill look; the grids only reserve
 * three columns, so widen them when the chip is present. */
.journal-modal .journal-stats:has(.mpx-collection-chip) {
  grid-template-columns: repeat(4, max-content);
}

.mpx-collection-chip {
  cursor: pointer;
}

.mpx-collection-chip:focus-visible {
  outline: 2px solid #080808;
  outline-offset: 2px;
}

.mpx-collection-card {
  --mpx-set-accent: #a87520;
  --mpx-set-accent-text: #8a5f0a;
  --mpx-set-wash: rgba(201, 138, 28, 0.17);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 9px;
  padding: 8px 10px 8px 8px;
  border: 1px solid var(--mpx-line);
  border-left: 3px solid var(--mpx-set-accent);
  border-radius: var(--mpx-radius-small);
  background:
    linear-gradient(90deg, var(--mpx-set-wash), rgba(255, 255, 255, 0) 46%),
    var(--mpx-paper-soft);
}

.mpx-collection-card--effigy {
  --mpx-set-accent: #28745f;
  --mpx-set-accent-text: #28745f;
  --mpx-set-wash: rgba(40, 116, 95, 0.12);
}

.mpx-collection-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 60px;
  overflow: hidden;
  border: 1px solid var(--mpx-line);
  border-radius: var(--mpx-radius-small);
  background: radial-gradient(circle at 50% 82%, var(--mpx-set-wash), rgba(255, 255, 255, 0.62));
}

.mpx-collection-art > img {
  width: 40px;
  height: 54px;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 2px 3px rgba(8, 8, 8, 0.22));
}

.mpx-collection-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mpx-collection-bonus {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 7px;
  margin: 0;
}

.mpx-collection-bonus > b {
  color: var(--mpx-set-accent-text);
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.25;
}

.mpx-collection-bonus > span {
  color: var(--mpx-muted);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.25;
}

.mpx-collection-track {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  height: 6px;
  margin: 1px 0;
}

.mpx-collection-track > i {
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.11);
}

.mpx-collection-track > i.is-filled {
  background: var(--mpx-set-accent);
  box-shadow: 0 0 4px var(--mpx-set-wash);
}

.mpx-collection-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mpx-collection-head > strong {
  color: var(--mpx-ink);
  font-size: 0.8rem;
  line-height: 1.2;
}

.mpx-collection-count {
  color: var(--mpx-soft);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.mpx-collection-count > strong {
  color: var(--mpx-set-accent-text);
  font-size: 0.82rem;
}

.mpx-collection-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--mpx-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.mpx-collection-note {
  margin: 0;
  color: var(--mpx-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

/* Touch: match the journal's compressed card typography. */
@media (max-width: 960px), (pointer: coarse) {
  html.is-touch .journal-stats:has(.mpx-collection-chip) {
    grid-template-columns: repeat(4, max-content);
  }

  html.is-touch .mpx-collection-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 4px 8px;
    padding: 6px 7px 6px 6px;
  }

  html.is-touch .mpx-collection-title > span {
    font-size: clamp(0.48rem, 1.8dvh, 0.62rem);
  }

  html.is-touch .mpx-collection-art {
    min-height: 50px;
  }

  html.is-touch .mpx-collection-art > img {
    width: 34px;
    height: 46px;
  }

  html.is-touch .mpx-collection-body {
    gap: 3px;
  }

  html.is-touch .mpx-collection-head > strong {
    font-size: clamp(0.62rem, 2.25dvh, 0.78rem);
  }

  html.is-touch .mpx-collection-bonus > b {
    font-size: clamp(0.58rem, 2.1dvh, 0.72rem);
  }

  html.is-touch .mpx-collection-bonus > span {
    font-size: clamp(0.5rem, 1.85dvh, 0.62rem);
  }

  html.is-touch .mpx-collection-track {
    gap: 2px;
    height: 5px;
  }

  html.is-touch .mpx-collection-count {
    font-size: clamp(0.5rem, 1.8dvh, 0.62rem);
  }

  html.is-touch .mpx-collection-count > strong {
    font-size: clamp(0.58rem, 2.1dvh, 0.72rem);
  }

  html.is-touch .mpx-collection-foot {
    font-size: clamp(0.48rem, 1.8dvh, 0.62rem);
  }

  html.is-touch .mpx-journal-collection .mpx-rank-badge {
    min-height: 19px;
    padding: 2px 6px;
    font-size: clamp(0.48rem, 1.8dvh, 0.62rem);
  }

  html.is-touch .mpx-collection-note {
    font-size: clamp(0.46rem, 1.7dvh, 0.58rem);
  }
}

/* Single-column journal layouts scroll the whole dashboard - the quest panel
 * must flow naturally there, not nest a second scroller (the overflow-y: auto
 * above is for the fixed-height two-column layouts only). */
@media (max-width: 960px) and (max-height: 520px) and (orientation: landscape), (pointer: coarse) and (max-height: 520px) and (orientation: landscape) {
  html.is-touch .journal-modal .journal-panel-quest {
    overflow-y: visible;
    min-height: max-content;
  }

  html.is-touch .journal-stats:has(.mpx-collection-chip) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* Full-width cards: keep the rank pill and the next-rank hint as one
   * left-aligned cluster instead of splitting them across ~800px. */
  html.is-touch .mpx-collection-foot {
    justify-content: flex-start;
    gap: 12px;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  html.is-touch .journal-modal .journal-panel-quest {
    overflow-y: visible;
    min-height: max-content;
  }
}

/* Wayroot Seeds ---------------------------------------------------------- */

.modal.clean-world-modal .mpx-wayroot-open {
  display: inline-grid;
  grid-template-columns: repeat(2, auto) auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(215, 202, 115, 0.48);
  border-radius: 9px;
  color: #fff7d5;
  background:
    linear-gradient(135deg, rgba(113, 151, 63, 0.24), rgba(144, 69, 158, 0.22)),
    rgba(7, 10, 11, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 5px 14px rgba(0, 0, 0, 0.28);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
}

.beyond-stage-head > .mpx-wayroot-open {
  justify-self: start;
  margin-top: 4px;
}

.beyond-group-hero-actions > .mpx-wayroot-open {
  width: max-content;
  max-width: 92px;
}

.modal.clean-world-modal .mpx-wayroot-open:hover,
.modal.clean-world-modal .mpx-wayroot-open:focus-visible {
  border-color: rgba(247, 224, 127, 0.82);
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.mpx-wayroot-open > span {
  display: inline-grid;
  grid-template-columns: 19px auto;
  align-items: center;
  gap: 1px;
}

.mpx-wayroot-open img {
  width: 19px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.mpx-wayroot-open b {
  min-width: 1ch;
  color: #fff4bd;
  font-size: 0.68rem;
}

.mpx-wayroot-open em {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.57rem;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mpx-wayroot-menu {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
  color: #f9f4df;
}

.mpx-wayroot-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(213, 202, 119, 0.28);
  border-radius: 12px;
  background:
    radial-gradient(circle at 82% 10%, rgba(169, 85, 190, 0.18), transparent 32%),
    radial-gradient(circle at 22% 100%, rgba(125, 171, 68, 0.18), transparent 38%),
    linear-gradient(145deg, rgba(20, 28, 21, 0.96), rgba(13, 12, 21, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 22px rgba(0, 0, 0, 0.24);
}

.mpx-wayroot-title {
  min-width: 0;
}

.mpx-wayroot-title .mpx-kicker {
  display: block;
  margin-bottom: 2px;
  color: #c9df76;
  font-size: 0.57rem;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.mpx-wayroot-title h2 {
  margin: 0;
  color: #fff5cc;
  font-size: 1.05rem;
  line-height: 1.15;
}

.modal.clean-world-modal .modal-card.beyond-menu-card .mpx-wayroot-title h2 {
  color: #fff5cc;
  font-family: inherit;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.mpx-wayroot-title p {
  max-width: 68ch;
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.67rem;
  line-height: 1.35;
}

.modal.clean-world-modal .modal-card.beyond-menu-card .mpx-wayroot-title p {
  color: rgba(255, 255, 255, 0.74) !important;
}

.mpx-wayroot-wallet {
  display: grid;
  grid-template-columns: repeat(2, minmax(66px, auto));
  gap: 6px;
}

.mpx-wayroot-wallet > span {
  display: grid;
  grid-template-columns: 30px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 5px;
  min-height: 48px;
  padding: 5px 8px;
  border: 1px solid rgba(194, 218, 103, 0.28);
  border-radius: 9px;
  background: rgba(73, 103, 43, 0.18);
}

.mpx-wayroot-wallet > span + span {
  border-color: rgba(219, 132, 227, 0.3);
  background: rgba(116, 50, 128, 0.17);
}

.mpx-wayroot-wallet img {
  grid-row: 1 / 3;
  width: 30px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.48));
}

.mpx-wayroot-wallet b {
  color: #fff2b4;
  font-size: 0.93rem;
  line-height: 1;
}

.mpx-wayroot-wallet small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1;
}

.mpx-wayroot-roster {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 1px 3px 8px 1px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.mpx-wayroot-unit {
  display: grid;
  grid-template-columns: 54px minmax(150px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--class-color) 27%, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--class-color) 11%, transparent), transparent 38%),
    rgba(8, 11, 14, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.mpx-wayroot-unit.is-caught-up {
  border-color: rgba(195, 214, 125, 0.22);
}

.mpx-wayroot-portrait.beyond-member-portrait {
  width: 52px;
  height: 52px;
  border-color: color-mix(in srgb, var(--class-color) 52%, rgba(255, 255, 255, 0.16));
}

.mpx-wayroot-unit__copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mpx-wayroot-unit__copy > strong {
  overflow: hidden;
  color: #fff8df;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-wayroot-unit__copy > small,
.mpx-wayroot-unit__copy > em {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.63rem;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpx-wayroot-unit__copy > em {
  color: #c7d98a;
  font-weight: 750;
}

.mpx-wayroot-unit.is-caught-up .mpx-wayroot-unit__copy > em {
  color: rgba(213, 226, 169, 0.62);
}

.mpx-wayroot-unit__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(78px, auto));
  gap: 5px;
}

.modal.clean-world-modal .mpx-wayroot-unit__actions button {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 7px;
  border-radius: 8px;
  border-color: rgba(190, 217, 105, 0.42);
  color: #f6f0d0;
  background: linear-gradient(180deg, rgba(95, 129, 54, 0.78), rgba(48, 67, 32, 0.86));
  font-size: 0.61rem;
  font-weight: 900;
  white-space: nowrap;
}

.modal.clean-world-modal .mpx-wayroot-unit__actions button[data-mpx-use-insight] {
  border-color: rgba(224, 132, 229, 0.42);
  background: linear-gradient(180deg, rgba(120, 59, 132, 0.8), rgba(65, 34, 76, 0.88));
}

.modal.clean-world-modal .mpx-wayroot-unit__actions button:disabled {
  opacity: 0.38;
  filter: grayscale(0.42);
}

.mpx-wayroot-unit__actions img {
  width: 19px;
  height: 21px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.48));
}

@media (max-width: 760px), (pointer: coarse) {
  .mpx-wayroot-menu {
    gap: 6px;
  }

  .mpx-wayroot-head {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
    padding: 7px 46px 7px 7px;
  }

  .mpx-wayroot-title h2 {
    font-size: clamp(0.82rem, 2.8dvh, 1rem);
  }

  .mpx-wayroot-title p {
    font-size: clamp(0.54rem, 1.85dvh, 0.66rem);
  }

  .mpx-wayroot-wallet {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mpx-wayroot-wallet > span {
    min-height: 36px;
    padding: 3px 7px;
  }

  .mpx-wayroot-wallet img {
    width: 25px;
    height: 29px;
  }

  .mpx-wayroot-unit {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 56px;
    padding: 5px 7px;
  }

  .mpx-wayroot-portrait.beyond-member-portrait {
    width: 42px;
    height: 42px;
  }

  .mpx-wayroot-unit__actions {
    grid-template-columns: repeat(2, minmax(66px, auto));
    gap: 4px;
  }

  .modal.clean-world-modal .mpx-wayroot-unit__actions button {
    min-height: 28px;
    padding: 3px 5px;
    font-size: clamp(0.51rem, 1.75dvh, 0.61rem);
  }
}

@media (max-width: 540px) and (orientation: portrait) {
  .mpx-wayroot-head {
    grid-template-columns: 1fr;
    padding-right: 46px;
  }

  .mpx-wayroot-head .beyond-group-back {
    justify-self: start;
  }

  .mpx-wayroot-wallet {
    grid-column: auto;
  }

  .mpx-wayroot-unit {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .mpx-wayroot-unit__actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal.clean-world-modal .mpx-wayroot-open {
    transition: none;
  }
}

/* ==========================================================================
 * BLOOMRIDGE FARM DESK · 2026-08-25
 * ==========================================================================
 * The farm desk IS the core Nursery v2 card (same Ledger leaf, same container,
 * same components). mpxDecorateNursery only adds: the capacity kicker, the
 * talent sub-line, the wing-upgrade button and the locked-pen tiles in the
 * overview strip. Everything below styles those extras.
 * ========================================================================== */
.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 40px;
  padding: 4px 12px;
  border-color: var(--nv-gold);
  color: var(--nv-gold-deep);
  background: var(--nv-paper);
  line-height: 1.1;
  text-align: left;
}

.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade:hover:not(:disabled) {
  background: var(--nv-gold-wash);
  border-color: var(--nv-gold-deep);
}

.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade small {
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--nv-mute);
  font-variant-numeric: tabular-nums;
}

.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-tile.is-locked {
  border-style: dashed;
  border-color: var(--nv-rule);
  color: var(--nv-mute);
  background: transparent;
  --p: 0%;
}

/* locked tile: number + a small padlock in the corner */
.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-tile.is-locked::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 4px;
  width: 5px;
  height: 4px;
  border: 1.5px solid var(--nv-mute);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  box-sizing: content-box;
}

.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-tile.is-locked::after {
  left: auto;
  right: 3px;
  top: 8px;
  bottom: auto;
  width: 8px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--nv-mute);
}

/* touch: labelled at >= 800px, icon-only below */
.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade-touch {
  flex-direction: row;
  align-items: center;
  gap: 5px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
}

.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade-touch i {
  font-size: 1.1rem;
  font-style: normal;
  line-height: 1;
}

.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade-touch span { font-size: clamp(0.58rem, 1.9dvh, 0.68rem); white-space: nowrap; }

@media (max-width: 799px) {
  .modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade-touch { width: 40px; padding: 0; justify-content: center; }
  .modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade-touch span { display: none; }
}

/* locked tile: padlock sits where the live tiles carry their progress bar */
.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-tile.is-locked::before {
  top: auto;
  bottom: 8px;
  right: auto;
  left: 50%;
  width: 6px;
  height: 4px;
  margin-left: -5px;
  border-width: 2px;
}

.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-tile.is-locked::after {
  top: auto;
  bottom: 3px;
  right: auto;
  left: 50%;
  width: 11px;
  height: 6px;
  margin-left: -5.5px;
}

.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-tile.is-locked b { margin-bottom: 8px; }

.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-tile.is-locked:hover,
.modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-tile.is-locked:focus-visible {
  border-color: var(--nv-gold);
  color: var(--nv-gold-deep);
}

html.is-touch .modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade {
  min-height: 40px;
  padding: 3px 10px;
}

html.is-touch .modal.clean-world-modal .modal-card.nursery-card--v2 .nursery-btn--upgrade span {
  font-size: clamp(0.56rem, 1.9dvh, 0.66rem);
}


/* ---- DV Crystals picker · touch landscape (2026-08-25) --------------------
   Shares the Bag picker shell from styles.css (.bag-target-card) and only
   re-pins what the :has() rules above out-specify: the card becomes the full
   leaf, the kicker + title sit left with the rules paragraph beside them,
   the roster tiles three-up, Back is a slim footer. */
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) { padding: 0; }
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding:
    max(6px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 1px;
  align-items: center;
  margin: 2px 52px 6px 0;
  padding: 0 0 6px;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head .mpx-kicker {
  grid-column: 1;
  grid-row: 1;
  font-size: clamp(0.5rem, 1.75dvh, 0.58rem);
  letter-spacing: 0.16em;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head h2 {
  grid-column: 1;
  grid-row: 2;
  font-size: clamp(1.04rem, 4.9dvh, 1.34rem);
  line-height: 1.05;
  white-space: nowrap;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  overflow: hidden;
  font-size: clamp(0.56rem, 1.95dvh, 0.64rem);
  line-height: 1.28;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card > .box-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 3px 8px 1px;
  overflow: auto;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-card .bag-target-list {
  grid-template-columns: repeat(auto-fill, minmax(clamp(236px, 30vw, 330px), 1fr));
  gap: 7px;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-max-dv-row > button {
  min-height: clamp(32px, 8.8dvh, 38px) !important;
  font-size: clamp(0.6rem, 2.2dvh, 0.7rem);
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-max-dv-row.is-maxed > button:disabled {
  color: var(--mpx-gold, #a87520);
  border-style: solid;
  border-color: rgba(168, 117, 32, 0.5);
  background: var(--mpx-gold-wash, rgba(168, 117, 32, 0.09));
  opacity: 1;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card > .dialogue-actions {
  position: static;
  flex: 0 0 auto;
  margin: 6px 0 0;
  padding-top: 6px;
  background: transparent;
  border-top: 1px solid var(--mpx-line);
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-card .dialogue-actions > button {
  min-height: clamp(32px, 8.8dvh, 36px) !important;
  font-size: clamp(0.62rem, 2.2dvh, 0.7rem);
}

/* ---- DV Crystals picker · touch landscape · round 4: joins the Ledger leaf --
   Same bone paper, ink binding + gold thread, diamond masthead and subtitle
   row as the other Bag pickers; the desktop backdrop art stays desktop-only. */
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) {
  background: var(--mw-leaf, #f6f2e7);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card {
  color: var(--mw-ink, #14110c);
  font-family: inherit;
  background-color: var(--mw-leaf, #f6f2e7);
  background-image:
    linear-gradient(rgba(253, 251, 244, 0.93), rgba(253, 251, 244, 0.93)),
    var(--mw-watermark),
    linear-gradient(179deg, #fdfbf4 0%, #f3efe2 100%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: 100% 100%, cover, 100% 100%;
  background-position: 0 0, 50% 12%, 0 0;
  background-blend-mode: normal, multiply, normal;
  box-shadow:
    inset 5px 0 0 var(--mw-ink, #14110c),
    inset 8px 0 0 var(--mw-gold, #a8801f),
    inset 0 0 0 10px var(--mw-leaf, #f6f2e7),
    inset 0 0 0 11px var(--mw-rule, rgba(20, 17, 12, 0.2));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding-left: max(12px, env(safe-area-inset-left));
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 3px 52px 7px 0;
  padding: 0;
  border-bottom: 0;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head .mpx-kicker { display: none; }
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 3px 0 7px;
  color: var(--mw-ink, #14110c);
  font: 400 clamp(1.04rem, 4.9dvh, 1.34rem)/1.05 var(--mw-serif, Georgia, serif);
  letter-spacing: 0;
  white-space: nowrap;
  background:
    linear-gradient(var(--mw-gold, #a8801f), var(--mw-gold, #a8801f)) 21px 100% / 48px 2px no-repeat,
    linear-gradient(var(--mw-hair, rgba(20, 17, 12, 0.1)), var(--mw-hair, rgba(20, 17, 12, 0.1))) 0 100% / 100% 1px no-repeat;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head h2::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  align-self: center;
  background: var(--mw-gold, #a8801f);
  transform: rotate(45deg) translate(1.4px, 1.4px);
  box-shadow: inset -1px -1px 0 rgba(20, 17, 12, 0.35);
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 4px 0 0;
  overflow: hidden;
  font-size: clamp(0.58rem, 2dvh, 0.66rem);
  line-height: 1.28;
  color: var(--mw-mute-strong, rgba(20, 17, 12, 0.68));
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-max-dv-row > button,
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-card .dialogue-actions > button {
  font-family: inherit;
  font-weight: 800;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) > .mpx-dv-card > .dialogue-actions {
  border-top-color: var(--mw-hair, rgba(20, 17, 12, 0.1));
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-max-dv-row > button:focus-visible,
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-card .dialogue-actions > button:focus-visible {
  outline-color: var(--mw-gold, #a8801f);
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .world-modal-close {
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  color: var(--mw-ink, #14110c);
  background: var(--mw-leaf-bright, #fdfbf4);
  border: 1px solid var(--mw-rule-strong, rgba(20, 17, 12, 0.38));
  border-radius: 10px;
  box-shadow: 2px 2px 0 0 rgba(20, 17, 12, 0.16);
  font: 900 1.32rem/1 inherit;
}

/* ---- DV Crystals picker · round 5: left-aligned masthead ------------------- */
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head,
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head h2,
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head p {
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head h2 {
  align-items: baseline;
  align-self: stretch;
}
html.is-touch .modal.clean-world-modal:has(.mpx-dv-card) .mpx-dv-head p { align-self: stretch; }
