.mc-controls, .mc-results, .mc-calc, .mc-related { min-width: 0; }
.mc-controls h2, .mc-results h2, .mc-calc h2, .mc-related h2 { margin: 0; }
.mc-note { margin: 5px 0 0; color: var(--muted); font-size: var(--t-sm); overflow-wrap: anywhere; }
#rp .mc-form { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; gap: 12px 16px; }
#rp .mc-form :is(input, select), #rp .mc-calc :is(input, select) { width: 100%; min-width: 0; }
#rp .mc-form .btn { justify-self: start; min-width: 8rem; }
.mc-results, .mc-error, .mc-calc { scroll-margin-top: 10rem; }
.mc-error { padding: 14px 18px; color: var(--error); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.mc-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin: 18px 0; }
.mc-metric { min-width: 0; padding: 14px; background: var(--wash); border: 1px solid var(--line); border-radius: var(--r-lg); }
.mc-metric dt { font-size: var(--t-sm); font-weight: 650; overflow-wrap: anywhere; }
.mc-metric dd { margin: 4px 0 0; }
.mc-metric .mc-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.mc-metric .num { font-size: var(--t-xl); }
.mc-change { font-weight: 650; }
.mc-change.gain { color: var(--good); }
.mc-change.loss { color: var(--error); }
.mc-measure { color: var(--muted); font-size: var(--t-xs); }
.mc-results .wc-chart { --muted: #b1c2d2; padding: 16px; background: var(--chart-bg); color: #f3f6fa; border-radius: var(--r-lg); }
.mc-results .wc-chead h2 { color: #f3f6fa; font-size: var(--t-sm); margin: 0 0 8px; }
.mc-results .cplot { min-width: 0; height: clamp(230px, 32vw, 380px); }
.mc-results .chart-legend { display: flex; gap: 8px 20px; flex-wrap: wrap; padding: 0; margin: 12px 0 0; list-style: none; }
.mc-results .chart-legend li { display: flex; align-items: center; gap: 6px; font-size: var(--t-sm); }
.mc-results .chart-legend .sw { width: 16px; height: 3px; border-radius: var(--r-sm); background: var(--c); }
.mc-results .chart-legend .sw.dash { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
.mc-results .chartcredit { margin: 8px 0 0; color: var(--muted); font-size: var(--t-xs); line-height: 1.4; }
.mc-results .chartcredit a { color: inherit; }
.mc-calc .wm-out { min-width: 0; overflow-wrap: anywhere; }
.mc-calc .wm-sub { display: inline-block; }
.mc-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 10px; }
.mc-links a { font-weight: 650; }
@media (max-width: 720px) {
  #rp .mc-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  #rp .mc-form .fld:has(input), #rp .mc-form .btn { grid-column: 1 / -1; }
  #rp .mc-form .btn { width: 100%; }
  .mc-results .wc-chart { padding: 12px; }
}
@media (max-width: 375px) {
  #rp .mc-form { grid-template-columns: minmax(0, 1fr); }
}
