.yld-mcs {
  color: #1d2733;
  margin: 32px 0;
}

.yld-mcs *,
.yld-mcs *::before,
.yld-mcs *::after {
  box-sizing: border-box;
}

.yld-mcs .screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.yld-mcs__header {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.yld-mcs__bar {
  background: linear-gradient(180deg, #9fd0f3 0%, #2f89db 100%);
  display: block;
  flex: 0 0 auto;
  height: 48px;
  width: 10px;
}

.yld-mcs__eyebrow {
  color: #5a6b7f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.yld-mcs__title {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.yld-mcs__form {
  margin: 0;
}

.yld-mcs__input-band {
  background: #f1f8fd;
  border: 1px solid #b9daf3;
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px 26px;
}

.yld-mcs__control-section {
  display: grid;
  gap: 14px;
}

.yld-mcs__control-section + .yld-mcs__control-section {
  border-top: 1px solid #cfe5f7;
  padding-top: 18px;
}

.yld-mcs__section-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: space-between;
}

.yld-mcs__control-section h3,
.yld-mcs__table-section h3 {
  color: #1d2733;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}

.yld-mcs__grid {
  display: grid;
  gap: 12px;
}

.yld-mcs__grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.yld-mcs__field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.yld-mcs__field span,
.yld-mcs__checks span {
  color: #24384f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.yld-mcs input,
.yld-mcs select {
  background: #fff;
  border: 1px solid #b9c7d6;
  border-radius: 4px;
  color: #17283a;
  font: inherit;
  min-height: 38px;
  padding: 7px 10px;
  width: 100%;
}

.yld-mcs select {
  cursor: pointer;
}

.yld-mcs input[type="checkbox"] {
  accent-color: #147cff;
  min-height: auto;
  width: auto;
}

.yld-mcs input:disabled,
.yld-mcs select:disabled {
  background: #eef3f8;
  color: #7a8795;
  cursor: not-allowed;
}

.yld-mcs__fineprint {
  color: #5d6f83;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  margin: -2px 0 0;
}

.yld-mcs__asset-table {
  background: #fff;
  border: 1px solid #b9c7d6;
  border-radius: 4px;
  overflow: hidden;
}

.yld-mcs__asset-row {
  display: grid;
  gap: 1px;
  grid-template-columns: minmax(150px, 1.4fr) repeat(3, minmax(92px, 1fr));
}

.yld-mcs__asset-row + .yld-mcs__asset-row {
  border-top: 1px solid #e1ebf4;
}

.yld-mcs__asset-row--head {
  background: #e7f3fd;
}

.yld-mcs__asset-row--head span {
  color: #1f3d5f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  padding: 8px 10px;
}

.yld-mcs__asset-row label {
  min-width: 0;
}

.yld-mcs__asset-row input {
  border: 0;
  border-radius: 0;
  min-height: 40px;
}

.yld-mcs__asset-name input {
  font-weight: 800;
}

.yld-mcs__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.yld-mcs__checks label {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  min-height: 30px;
}

.yld-mcs__preset-buttons,
.yld-mcs__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yld-mcs__actions--standalone {
  border-top: 1px solid #cfe5f7;
  padding-top: 18px;
}

.yld-mcs__mini-button,
.yld-mcs__secondary-button,
.yld-mcs__primary-button {
  border-radius: 4px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  min-height: 34px;
}

.yld-mcs__mini-button,
.yld-mcs__secondary-button {
  background: #fff;
  border: 1px solid #9cb4cc;
  color: #173a5e;
  padding: 7px 10px;
}

.yld-mcs__primary-button {
  background: #147cff;
  border: 1px solid #147cff;
  color: #fff;
  min-width: 180px;
  padding: 9px 16px;
}

.yld-mcs__mini-button:hover,
.yld-mcs__secondary-button:hover {
  background: #eaf5ff;
}

.yld-mcs__primary-button:hover {
  background: #0d66d1;
  border-color: #0d66d1;
}

.yld-mcs__secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.yld-mcs__status {
  background: linear-gradient(135deg, #eef7ff 0%, #f7fbff 58%, #fff8eb 100%);
  border: 1px solid #bdd8f0;
  border-left: 5px solid #147cff;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(42, 91, 130, 0.08);
  color: #264a6f;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 14px;
  min-height: 1.5em;
  padding: 12px 14px;
}

.yld-mcs__status:empty {
  display: none;
}

.yld-mcs__results[hidden] {
  display: none;
}

.yld-mcs__summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0 24px;
}

.yld-mcs__metric {
  --yld-mcs-metric-accent: #147cff;
  --yld-mcs-metric-border: #cfe0f1;
  --yld-mcs-metric-bg: #ffffff;
  --yld-mcs-metric-soft: #eef7ff;
  background:
    linear-gradient(180deg, var(--yld-mcs-metric-soft) 0%, var(--yld-mcs-metric-bg) 52%, #fff 100%);
  border: 1px solid var(--yld-mcs-metric-border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(26, 54, 85, 0.08);
  display: grid;
  gap: 4px;
  min-height: 92px;
  overflow: hidden;
  padding: 16px 16px 15px;
  position: relative;
}

.yld-mcs__metric::before {
  background: var(--yld-mcs-metric-accent);
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.yld-mcs__metric--success {
  --yld-mcs-metric-accent: #16a34a;
  --yld-mcs-metric-border: #b7e2c4;
  --yld-mcs-metric-soft: #edfdf3;
}

.yld-mcs__metric--balance {
  --yld-mcs-metric-accent: #147cff;
  --yld-mcs-metric-border: #bfd7ff;
  --yld-mcs-metric-soft: #eef6ff;
}

.yld-mcs__metric--real {
  --yld-mcs-metric-accent: #0f766e;
  --yld-mcs-metric-border: #b8ded8;
  --yld-mcs-metric-soft: #ecfbf8;
}

.yld-mcs__metric--return {
  --yld-mcs-metric-accent: #4f46e5;
  --yld-mcs-metric-border: #c9c7fb;
  --yld-mcs-metric-soft: #f1f1ff;
}

.yld-mcs__metric--risk {
  --yld-mcs-metric-accent: #f59e0b;
  --yld-mcs-metric-border: #f5d78a;
  --yld-mcs-metric-soft: #fff8e7;
}

.yld-mcs__metric--drawdown {
  --yld-mcs-metric-accent: #dc2626;
  --yld-mcs-metric-border: #f1b8b8;
  --yld-mcs-metric-soft: #fff0f0;
}

.yld-mcs__metric--withdrawal {
  --yld-mcs-metric-accent: #c2410c;
  --yld-mcs-metric-border: #f0c4a8;
  --yld-mcs-metric-soft: #fff3eb;
}

.yld-mcs__metric--tax {
  --yld-mcs-metric-accent: #be185d;
  --yld-mcs-metric-border: #efb8cf;
  --yld-mcs-metric-soft: #fff0f6;
}

.yld-mcs__metric--count {
  --yld-mcs-metric-accent: #475569;
  --yld-mcs-metric-border: #c8d1dc;
  --yld-mcs-metric-soft: #f3f6f9;
}

.yld-mcs__metric-label {
  color: #33465c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  padding-top: 3px;
}

.yld-mcs__metric-value {
  color: #0f172a;
  font-size: clamp(22px, 2.1vw, 31px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
  overflow-wrap: normal;
  white-space: nowrap;
}

.yld-mcs__metric-note {
  color: #5d7087;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.yld-mcs__insight {
  background: #fffaf0;
  border: 1px solid #f3d28d;
  border-left: 5px solid #f59e0b;
  border-radius: 6px;
  color: #3f2f14;
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 24px;
  padding: 13px 15px;
}

.yld-mcs__insight-title {
  color: #1d2733;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 5px;
}

.yld-mcs__insight ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 1.25em;
}

.yld-mcs__chart-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.yld-mcs__chart-block {
  border: 1px solid #d5e2ee;
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto minmax(0, 1fr);
  margin: 0;
  min-height: 340px;
  padding: 18px;
  position: relative;
}

.yld-mcs__chart-block--balance {
  grid-column: 1 / -1;
  min-height: 560px;
}

.yld-mcs__chart-block figcaption {
  color: #1f3d5f;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.yld-mcs__chart-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  min-height: 24px;
}

.yld-mcs__legend-item {
  align-items: center;
  color: #263e5a;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  gap: 6px;
  line-height: 1.25;
  white-space: nowrap;
}

.yld-mcs__legend-line {
  background: var(--yld-mcs-line, #147cff);
  border-radius: 999px;
  display: inline-block;
  height: 4px;
  width: 24px;
}

.yld-mcs__legend-line.is-dashed {
  background: repeating-linear-gradient(
    90deg,
    var(--yld-mcs-line, #147cff) 0 6px,
    transparent 6px 10px
  );
  height: 5px;
}

.yld-mcs__chart-block canvas {
  height: 290px;
  min-height: 0;
  width: 100%;
}

.yld-mcs__chart-block--balance canvas {
  height: 470px;
}

.yld-mcs__tooltip {
  background: rgba(15, 23, 42, 0.94);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  max-width: min(320px, calc(100% - 24px));
  opacity: 0;
  padding: 10px 12px;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 0.12s ease;
  z-index: 4;
}

.yld-mcs__tooltip.is-visible {
  opacity: 1;
}

.yld-mcs__tooltip-title {
  font-weight: 900;
  margin-bottom: 6px;
}

.yld-mcs__tooltip-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 14px minmax(0, 1fr) auto;
}

.yld-mcs__tooltip-swatch {
  background: var(--yld-mcs-line, #147cff);
  border-radius: 999px;
  height: 3px;
  width: 14px;
}

.yld-mcs__tooltip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yld-mcs__tooltip-value {
  font-weight: 900;
  white-space: nowrap;
}

.yld-mcs__table-stack {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.yld-mcs__table-section {
  display: grid;
  gap: 10px;
}

.yld-mcs__table-wrap {
  border: 1px solid #d5e2ee;
  border-radius: 6px;
  overflow-x: auto;
}

.yld-mcs__table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
  width: 100%;
}

.yld-mcs__table th,
.yld-mcs__table td {
  border-bottom: 1px solid #e6eef5;
  padding: 9px 10px;
  text-align: right;
  vertical-align: middle;
}

.yld-mcs__table th:first-child,
.yld-mcs__table td:first-child {
  color: #24384f;
  font-weight: 800;
  position: sticky;
  left: 0;
  text-align: left;
}

.yld-mcs__table th:first-child {
  background: #e7f3fd;
}

.yld-mcs__table td:first-child {
  background: #fff;
}

.yld-mcs__table th {
  background: #e7f3fd;
  color: #1f3d5f;
  font-weight: 900;
  white-space: nowrap;
}

.yld-mcs__table tr:last-child td {
  border-bottom: 0;
}

.yld-mcs__disclaimer {
  border-top: 1px solid #d9e3ee;
  color: #526173;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 28px;
  padding-top: 18px;
}

.yld-mcs__disclaimer-title {
  color: #1d2733;
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 8px;
}

.yld-mcs__disclaimer ul {
  margin: 0;
  padding-left: 1.25em;
}

.yld-mcs__disclaimer li + li {
  margin-top: 4px;
}

@media (max-width: 980px) {
  .yld-mcs__summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yld-mcs__chart-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .yld-mcs__input-band {
    padding: 18px;
  }

  .yld-mcs__grid--three {
    grid-template-columns: 1fr;
  }

  .yld-mcs__asset-table {
    overflow-x: auto;
  }

  .yld-mcs__asset-row {
    min-width: 620px;
  }

  .yld-mcs__summary-grid {
    grid-template-columns: 1fr;
  }

  .yld-mcs__metric-value {
    font-size: clamp(22px, 8vw, 32px);
  }

  .yld-mcs__primary-button,
  .yld-mcs__secondary-button {
    flex: 1 1 100%;
  }

  .yld-mcs__chart-block {
    min-height: 320px;
  }

  .yld-mcs__chart-block--balance {
    min-height: 430px;
  }

  .yld-mcs__chart-block canvas {
    height: 270px;
  }

  .yld-mcs__chart-block--balance canvas {
    height: 360px;
  }
}
