.mmpc-root {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #243241;
  border-radius: 8px;
  background: #f4f7f6;
  color: #101820;
  box-shadow: 0 18px 42px rgba(8, 17, 27, 0.16);
}

.mmpc-controls {
  display: grid;
  grid-template-columns: minmax(240px, 0.92fr) minmax(300px, 1.45fr);
  border-bottom: 1px solid #243241;
}

.mmpc-panel {
  min-width: 0;
  background: repeating-linear-gradient(0deg, rgba(36, 50, 65, 0.035), rgba(36, 50, 65, 0.035) 1px, transparent 1px, transparent 12px);
}

.mmpc-panel + .mmpc-panel {
  border-left: 1px solid #243241;
}

.mmpc-panel-bar {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 0.9rem;
  border-bottom: 1px solid #243241;
  background: #101820;
  color: #e9fff5;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mmpc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.9rem;
}

.mmpc-root label {
  display: grid;
  gap: 0.36rem;
  min-width: 0;
  color: #45515d;
  font-size: 0.78rem;
  font-weight: 800;
}

.mmpc-root input,
.mmpc-root select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #7b8791;
  border-radius: 4px;
  background: #fff;
  color: #101820;
  padding: 0 0.62rem;
  font: inherit;
  font-weight: 850;
}

.mmpc-topline {
  display: grid;
  grid-template-columns: 1fr minmax(96px, 0.42fr);
  gap: 0.75rem;
  padding: 0 0.9rem 0.9rem;
}

.mmpc-topline > div {
  display: grid;
  gap: 0.36rem;
  color: #45515d;
  font-size: 0.78rem;
  font-weight: 800;
}

.mmpc-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 40px;
  border: 1px solid #7b8791;
  border-radius: 4px;
  background: #dfe6e6;
  padding: 0.2rem;
}

.mmpc-segment button {
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #45515d;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.mmpc-segment button[aria-pressed="true"] {
  background: #101820;
  color: #e9fff5;
}

.mmpc-transition-head,
.mmpc-transition {
  display: grid;
  grid-template-columns: minmax(116px, 1fr) minmax(116px, 1fr) 74px 56px;
  gap: 0.65rem;
  align-items: center;
}

.mmpc-transition-head {
  padding: 0.72rem 0.9rem 0.25rem;
  color: #45515d;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mmpc-transition-list {
  display: grid;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem 0.9rem;
}

.mmpc-color-picker {
  display: grid;
  grid-template-columns: repeat(4, 24px);
  gap: 0.28rem;
}

.mmpc-color {
  width: 24px;
  aspect-ratio: 1;
  border: 2px solid rgba(16, 24, 32, 0.28);
  border-radius: 50%;
  background: var(--mmpc-color);
  cursor: pointer;
}

.mmpc-color[aria-pressed="true"] {
  border-color: #101820;
  box-shadow: 0 0 0 3px #f24f35;
}

.mmpc-transition output {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid #243241;
  border-radius: 4px;
  background: #101820;
  color: #e9fff5;
  font-size: 0.78rem;
  font-weight: 900;
}

.mmpc-dashboard {
  display: grid;
  gap: 0;
  background: #fff;
}

.mmpc-ratio {
  padding: 1rem;
  border-bottom: 1px solid #243241;
}

.mmpc-ratio-labels,
.mmpc-ratio-values {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mmpc-ratio-values {
  margin-top: 0.45rem;
  color: #45515d;
}

.mmpc-loadbar {
  display: flex;
  height: 74px;
  margin-top: 0.55rem;
  overflow: hidden;
  border: 1px solid #101820;
  background: #101820;
}

.mmpc-loadbar i {
  display: block;
  height: 100%;
  transition: width 160ms ease;
}

#mmpc-object-bar {
  background: linear-gradient(90deg, #23a36f, #7dd08e);
}

#mmpc-purge-bar {
  background: repeating-linear-gradient(135deg, #f24f35 0, #f24f35 12px, #ffb000 12px, #ffb000 24px);
}

.mmpc-dashboard[data-severity="high"] #mmpc-purge-bar {
  animation: mmpc-pulse 0.9s infinite alternate;
}

.mmpc-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #243241;
}

.mmpc-kpis div {
  padding: 0.95rem;
  border-right: 1px solid #243241;
}

.mmpc-kpis div:last-child {
  border-right: 0;
}

.mmpc-kpis span {
  display: block;
  color: #45515d;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mmpc-kpis b {
  display: block;
  margin-top: 0.24rem;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.mmpc-alert {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #243241;
  background: #edf8f0;
}

.mmpc-dashboard[data-severity="high"] .mmpc-alert {
  background: #3b1010;
  color: #fff7ed;
}

.mmpc-alert b {
  display: block;
  font-size: 0.94rem;
}

.mmpc-alert p {
  margin: 0.25rem 0 0;
  color: inherit;
  font-size: 0.88rem;
}

.mmpc-table-wrap {
  overflow-x: auto;
}

.mmpc-table-wrap table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.mmpc-table-wrap caption {
  padding: 0.8rem 1rem;
  text-align: left;
  font-weight: 900;
  text-transform: uppercase;
}

.mmpc-table-wrap th,
.mmpc-table-wrap td {
  padding: 0.72rem 1rem;
  border-top: 1px solid rgba(36, 50, 65, 0.22);
  text-align: left;
}

.mmpc-table-wrap th {
  color: #45515d;
  font-size: 0.74rem;
}

@keyframes mmpc-pulse {
  from { filter: saturate(1); }
  to { filter: saturate(1.7) brightness(1.08); }
}

.theme-dark .mmpc-root {
  border-color: #7d8b99;
  background: #0c1218;
  color: #eef7f8;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.theme-dark .mmpc-controls,
.theme-dark .mmpc-panel + .mmpc-panel,
.theme-dark .mmpc-panel-bar,
.theme-dark .mmpc-ratio,
.theme-dark .mmpc-kpis,
.theme-dark .mmpc-kpis div,
.theme-dark .mmpc-alert {
  border-color: #516170;
}

.theme-dark .mmpc-panel,
.theme-dark .mmpc-dashboard {
  background-color: #0f171f;
}

.theme-dark .mmpc-panel-bar,
.theme-dark .mmpc-segment button[aria-pressed="true"],
.theme-dark .mmpc-transition output {
  background: #d7fff0;
  color: #081018;
}

.theme-dark .mmpc-root label,
.theme-dark .mmpc-topline > div,
.theme-dark .mmpc-transition-head,
.theme-dark .mmpc-ratio-values,
.theme-dark .mmpc-kpis span,
.theme-dark .mmpc-table-wrap th {
  color: #b7c5cf;
}

.theme-dark .mmpc-root input,
.theme-dark .mmpc-root select,
.theme-dark .mmpc-segment {
  border-color: #516170;
  background: #071018;
  color: #eef7f8;
}

.theme-dark .mmpc-color {
  border-color: #d7fff0;
  box-shadow: 0 0 0 1px rgba(8, 16, 24, 0.9);
}

.theme-dark .mmpc-color[aria-pressed="true"] {
  border-color: #fff;
  box-shadow: 0 0 0 3px #ffb000, 0 0 0 5px rgba(8, 16, 24, 0.95);
}

.theme-dark .mmpc-segment button {
  color: #b7c5cf;
}

.theme-dark .mmpc-alert {
  background: #123121;
}

.theme-dark .mmpc-dashboard[data-severity="high"] .mmpc-alert {
  background: #551515;
}

@media (max-width: 840px) {
  .mmpc-controls {
    grid-template-columns: 1fr;
  }

  .mmpc-panel + .mmpc-panel {
    border-left: 0;
    border-top: 1px solid #243241;
  }

  .mmpc-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mmpc-kpis div {
    border-bottom: 1px solid #243241;
  }
}

@media (max-width: 560px) {
  .mmpc-grid,
  .mmpc-topline,
  .mmpc-transition-head,
  .mmpc-transition {
    grid-template-columns: 1fr;
  }

  .mmpc-transition-head {
    display: none;
  }

  .mmpc-color-picker {
    grid-template-columns: repeat(8, 24px);
  }

  .mmpc-loadbar {
    height: 58px;
  }
}
