.mpm-root {
  --mpm-bg: #061012;
  --mpm-panel: #0b1b1f;
  --mpm-panel-2: #0f2529;
  --mpm-line: #1f4d55;
  --mpm-ink: #e8fbff;
  --mpm-muted: #8db5bd;
  --mpm-cyan: #3ee8ff;
  --mpm-green: #44e6a4;
  --mpm-orange: #f5a24a;
  --mpm-red: #ff7a5f;
  --mpm-market-spread: 0%;

  display: grid;
  grid-template-columns: minmax(310px, 1fr) minmax(330px, 0.95fr);
  gap: clamp(14px, 2.4vw, 22px);
  border: 1px solid var(--mpm-line);
  border-radius: 8px;
  padding: clamp(14px, 2.2vw, 22px);
  color: var(--mpm-ink);
  background:
    linear-gradient(rgba(62, 232, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 232, 255, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 18% 5%, rgba(62, 232, 255, 0.18), transparent 32%),
    var(--mpm-bg);
  background-size: 28px 28px, 28px 28px, auto, auto;
  box-shadow: 0 24px 70px rgba(0, 22, 27, 0.35);
  color-scheme: dark;
}

.theme-dark .mpm-root {
  color-scheme: dark;
}

.mpm-console,
.mpm-results {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid rgba(62, 232, 255, 0.24);
  border-radius: 8px;
  padding: clamp(14px, 2vw, 18px);
  background: color-mix(in srgb, var(--mpm-panel) 88%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.mpm-topline,
.mpm-money-grid,
.mpm-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mpm-root span,
.mpm-mode legend,
.mpm-factor em {
  color: var(--mpm-muted);
}

.mpm-root label > span,
.mpm-mode legend,
.mpm-primary span,
.mpm-kpis span {
  display: block;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mpm-currency,
.mpm-money-grid label,
.mpm-factor,
.mpm-sliders label {
  display: grid;
  gap: 8px;
}

.mpm-root input,
.mpm-root select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--mpm-line);
  border-radius: 7px;
  padding: 10px;
  color: var(--mpm-ink);
  background: #071418;
  font: inherit;
  font-weight: 850;
}

.mpm-money-grid b,
.mpm-factor b {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--mpm-line);
  border-radius: 7px;
  background: #071418;
}

.mpm-money-grid b input,
.mpm-factor b input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mpm-money-grid small,
.mpm-factor small {
  padding: 0 10px;
  color: var(--mpm-cyan);
  font-weight: 900;
  white-space: nowrap;
}

.mpm-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.mpm-mode legend {
  grid-column: 1 / -1;
}

.mpm-mode label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  border: 1px solid var(--mpm-line);
  border-radius: 7px;
  padding: 0 10px;
  background: #071418;
  font-weight: 900;
}

.mpm-mode input {
  width: 16px;
  min-height: auto;
  accent-color: var(--mpm-cyan);
}

.mpm-sliders {
  display: grid;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(62, 232, 255, 0.2);
  border-radius: 8px;
  background: var(--mpm-panel-2);
}

.mpm-sliders output {
  color: var(--mpm-cyan);
  font-size: 1.05rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.mpm-sliders output b {
  color: var(--mpm-ink);
}

.mpm-root input[type="range"] {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--mpm-cyan);
}

.mpm-factor em {
  font-size: 0.82rem;
  line-height: 1.35;
}

.mpm-primary {
  border: 1px solid rgba(62, 232, 255, 0.42);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 28px);
  background: linear-gradient(135deg, rgba(62, 232, 255, 0.12), rgba(68, 230, 164, 0.08));
}

.mpm-primary strong {
  display: block;
  margin-top: 8px;
  color: var(--mpm-cyan);
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 0.94;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.mpm-root[data-market="above"] .mpm-primary strong,
.mpm-root[data-market="above"] .mpm-kpis article:nth-child(3) strong,
.mpm-root[data-market="above"] .mpm-kpis article:nth-child(4) strong {
  color: var(--mpm-orange);
}

.mpm-kpis article {
  min-width: 0;
  border: 1px solid rgba(62, 232, 255, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(7, 20, 24, 0.86);
}

.mpm-kpis strong {
  display: block;
  margin-top: 7px;
  color: var(--mpm-green);
  font-size: clamp(1rem, 2.1vw, 1.25rem);
  overflow-wrap: anywhere;
}

.mpm-market {
  position: relative;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid var(--mpm-line);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(68, 230, 164, 0.2), rgba(62, 232, 255, 0.16) 50%, rgba(245, 162, 74, 0.22));
}

.mpm-market::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(232, 251, 255, 0.7);
  content: "";
}

.mpm-market i {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: calc(50% - (var(--mpm-market-spread) / 2));
  width: var(--mpm-market-spread);
  min-width: 3px;
  border-radius: 999px;
  background: var(--mpm-green);
}

.mpm-root[data-market="above"] .mpm-market i {
  left: 50%;
  background: var(--mpm-orange);
}

.mpm-formulas {
  display: grid;
  gap: 8px;
}

.mpm-formulas code {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid rgba(62, 232, 255, 0.18);
  border-radius: 7px;
  padding: 10px;
  color: var(--mpm-muted);
  background: #071418;
}

.mpm-copy {
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  color: #041013;
  background: var(--mpm-cyan);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.mpm-copy:hover,
.mpm-copy:focus-visible {
  filter: brightness(1.08);
}

@media (max-width: 880px) {
  .mpm-root,
  .mpm-topline,
  .mpm-money-grid,
  .mpm-kpis {
    grid-template-columns: 1fr;
  }
}
