.mp-page {
  color: #17243a;
}

.mp-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 20px;
  border-bottom: 1px solid #dce5f1;
}

.mp-page-head h3 {
  margin: 3px 0 7px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.mp-page-head p {
  margin: 0;
  color: #66758d;
}

.mp-page-head .eyebrow {
  color: #e62543;
  font-size: 12px;
  font-weight: 800;
}

.mp-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.mp-toolbar label {
  display: grid;
  gap: 5px;
  color: #5f6f87;
  font-size: 12px;
}

.mp-toolbar input,
.mp-editor select,
.mp-editor input {
  height: 36px;
  border: 1px solid #cdd9e8;
  border-radius: 6px;
  background: #fff;
  color: #17243a;
  padding: 0 10px;
  box-sizing: border-box;
}

.mp-toolbar .search {
  width: 230px;
}

.mp-summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 14px 0;
  color: #64748b;
  font-size: 13px;
}

.mp-summary-line strong {
  color: #1f4d99;
  font-size: 16px;
}

.mp-config-wrap,
.mp-result-wrap {
  overflow: auto;
  border: 1px solid #dce5f1;
  border-radius: 6px;
}

.mp-result-wrap {
  max-height: calc(100vh - 245px);
  min-height: 360px;
  scroll-padding-top: 82px;
}

.mp-result-table thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 42px;
  box-sizing: border-box;
}

.mp-result-table thead tr:nth-child(2) th {
  position: sticky;
  top: 42px;
  z-index: 4;
  height: 42px;
  box-sizing: border-box;
}

.mp-result-table thead th[rowspan="2"] {
  z-index: 6;
}

.mp-config-table,
.mp-result-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.mp-config-table {
  min-width: 1100px;
}

.mp-result-table {
  width: 2051px;
  min-width: 2051px;
}

.mp-config-table th,
.mp-config-table td,
.mp-result-table th,
.mp-result-table td {
  padding: 11px 12px;
  border-right: 1px solid #e4ebf4;
  border-bottom: 1px solid #e4ebf4;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.mp-config-table th,
.mp-result-table th {
  background: #f1f5fa;
  color: #42536b;
  font-weight: 700;
  text-align: left;
}

.mp-config-table tr:last-child td,
.mp-result-table tr:last-child td {
  border-bottom: 0;
}

.mp-config-table th:last-child,
.mp-config-table td:last-child,
.mp-result-table th:last-child,
.mp-result-table td:last-child {
  border-right: 0;
}

.mp-config-table th:nth-child(1) { width: 110px; }
.mp-config-table th:nth-child(2) { width: 135px; }
.mp-config-table th:nth-child(3) { width: 150px; }
.mp-config-table th:nth-child(5) { width: 110px; }
.mp-config-table th:nth-child(6) { width: 90px; }

.mp-formula {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  line-height: 1.7;
}

.mp-formula-part b {
  margin-right: 3px;
}

.mp-formula-plus {
  color: #94a3b8;
}

.mp-factor-1 { color: #245fbd; }
.mp-factor-2 { color: #167259; }
.mp-factor-3 { color: #9a5c05; }

.mp-status {
  display: inline-block;
  min-width: 72px;
  padding: 4px 7px;
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
}

.mp-status.is-ready {
  color: #12664d;
  background: #edf8f4;
}

.mp-status.is-empty,
.mp-unconfigured {
  color: #8a6470;
  background: #f8f1f3;
}

.mp-editor {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 39, 61, 0.34);
}

.mp-editor.hidden {
  display: none;
}

.mp-editor-panel {
  width: min(700px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border: 1px solid #cdd9e8;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 36, 58, 0.2);
}

.mp-editor-panel > header,
.mp-editor-panel > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.mp-editor-panel > header {
  border-bottom: 1px solid #e4ebf4;
}

.mp-editor-panel > header p,
.mp-editor-panel > header h4,
.mp-editor-panel > header span {
  margin: 0;
}

.mp-editor-panel > header p,
.mp-editor-panel > header span {
  color: #6b7b91;
  font-size: 12px;
}

.mp-editor-panel > header h4 {
  margin: 3px 0;
  font-size: 20px;
}

.mp-editor-rows {
  padding: 16px 18px 0;
}

.mp-editor-row {
  display: grid;
  grid-template-columns: 32px minmax(240px, 1fr) 150px;
  gap: 12px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f6;
}

.mp-editor-row > b {
  align-self: center;
  font-size: 20px;
}

.mp-editor-row label {
  display: grid;
  gap: 5px;
  color: #63738a;
  font-size: 12px;
}

.mp-editor-row select,
.mp-editor-row input {
  width: 100%;
}

.mp-weight > div {
  position: relative;
}

.mp-weight em {
  position: absolute;
  right: 10px;
  top: 9px;
  color: #76869c;
  font-style: normal;
}

.mp-editor-preview {
  margin: 16px 18px 0;
  padding: 13px 14px;
  background: #f5f8fc;
  border-left: 3px solid #2f6fed;
}

.mp-editor-preview span,
.mp-editor-preview strong,
.mp-editor-preview em {
  display: block;
}

.mp-editor-preview span,
.mp-editor-preview em {
  color: #66758d;
  font-size: 12px;
}

.mp-editor-preview strong {
  margin: 5px 0;
}

.mp-editor-preview em {
  color: #c13a52;
  font-style: normal;
}

.mp-editor-preview em.is-valid {
  color: #13785b;
}

.mp-editor-panel > footer {
  justify-content: flex-end;
}

.mp-result-table th:nth-child(1) { width: 72px; }
.mp-result-table th:nth-child(2) { width: 82px; }
.mp-result-table th:nth-child(3) { width: 90px; }
.mp-result-table th:nth-child(4) { width: 100px; }
.mp-result-table th:nth-child(5) { width: 360px; }
.mp-result-table th:nth-child(6) { width: 145px; }

.mp-result-table thead tr:first-child th:nth-child(-n+6),
.mp-result-table tbody td:nth-child(-n+6) {
  position: sticky;
  z-index: 3;
}

.mp-result-table thead tr:first-child th:nth-child(-n+6) {
  z-index: 8;
  background: #f1f5fa;
}

.mp-result-table tbody td:nth-child(-n+6) {
  background: #fff;
}

.mp-result-table tbody tr:nth-child(even) td:nth-child(-n+6) {
  background: #fbfdff;
}

.mp-result-table thead tr:first-child th:nth-child(1),
.mp-result-table tbody td:nth-child(1) { left: 0; }
.mp-result-table thead tr:first-child th:nth-child(2),
.mp-result-table tbody td:nth-child(2) { left: 72px; }
.mp-result-table thead tr:first-child th:nth-child(3),
.mp-result-table tbody td:nth-child(3) { left: 154px; }
.mp-result-table thead tr:first-child th:nth-child(4),
.mp-result-table tbody td:nth-child(4) { left: 244px; }
.mp-result-table thead tr:first-child th:nth-child(5),
.mp-result-table tbody td:nth-child(5) { left: 344px; }
.mp-result-table thead tr:first-child th:nth-child(6),
.mp-result-table tbody td:nth-child(6) {
  left: 704px;
  box-shadow: 5px 0 8px rgba(43, 61, 84, 0.12);
}

.mp-result-table thead tr:nth-child(2) th:nth-child(3n+1),
.mp-result-table thead tr:nth-child(2) th:nth-child(3n+2) {
  width: 132px;
  min-width: 132px;
}

.mp-result-table thead tr:nth-child(2) th:nth-child(3n) {
  width: 104px;
  min-width: 104px;
}

.mp-result-table td:nth-child(n+7) {
  min-width: 104px;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.mp-result-table thead tr:first-child th:nth-child(n+7),
.mp-result-table thead tr:nth-child(2) th {
  text-align: center;
}

.mp-result-table td:nth-child(n+7) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mp-result-table td small {
  display: block;
  margin-top: 4px;
  color: #7b8799;
}

.mp-final {
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.mp-final.is-good { color: #087e5b; }
.mp-final.is-watch { color: #aa6800; }
.mp-final.is-low { color: #d52d49; }
.mp-final.is-pending { color: #8592a5; }

.mp-mom {
  display: block;
  font-size: 13px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.mp-mom.is-up { color: #d52d49; }
.mp-mom.is-down { color: #087e5b; }
.mp-mom.is-flat { color: #7b8799; }

.mp-detail-empty {
  color: #a6b0bf;
  text-align: center !important;
}

@media (max-width: 900px) {
  .mp-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mp-toolbar {
    align-items: stretch;
  }

  .mp-toolbar label,
  .mp-toolbar .search,
  .mp-toolbar button {
    width: 100%;
  }

  .mp-editor-row {
    grid-template-columns: 30px 1fr;
  }

  .mp-editor-row .mp-weight {
    grid-column: 2;
  }
}


.mp-factor-help-modal{position:fixed;inset:0;z-index:10030;display:grid;place-items:center;padding:24px;background:rgba(25,39,61,.38)}
.mp-factor-help-panel{width:min(760px,calc(100vw - 40px));max-height:min(760px,calc(100vh - 48px));overflow:hidden;border:1px solid #d7e2ef;border-radius:12px;background:#fff;box-shadow:0 24px 70px rgba(22,40,70,.22)}
.mp-factor-help-panel>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:20px 24px;border-bottom:1px solid #e4ebf4;background:#f8fbff}
.mp-factor-help-panel>header p{margin:0 0 4px;color:#e62543;font-size:11px;font-weight:800;letter-spacing:.08em}
.mp-factor-help-panel>header h4{margin:0 0 6px;color:#17243a;font-size:22px}
.mp-factor-help-panel>header span{color:#687992;font-size:13px}
.mp-factor-help-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:calc(min(760px,100vh - 48px) - 108px);overflow:auto;padding:18px 22px}
.mp-factor-help-card{padding:13px 14px;border:1px solid #e1e9f2;border-radius:8px;background:#fff}
.mp-factor-help-card h5{margin:0 0 7px;color:#213d69;font-size:14px}
.mp-factor-help-card p{margin:0 0 8px;color:#4d6079;font-size:13px;line-height:1.65}
.mp-factor-help-card small{color:#93a0b2;font-size:11px;word-break:break-all}
@media (max-width:720px){.mp-factor-help-list{grid-template-columns:1fr}.mp-factor-help-panel>header{padding:16px}.mp-factor-help-list{padding:14px}}
