.mp-analysis { display: grid; gap: 13px; min-width: 0; }
.mp-report-period { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.mp-report-period .mp-filter-label { margin: 0; }
.mp-analysis-charts, .mp-analysis-breakdown { display: grid; gap: 10px; align-items: start; min-width: 0; }
.mp-analysis-charts { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.mp-analysis-breakdown { grid-template-columns: repeat(2, minmax(0,1fr)); }
.mp-analysis-charts :is(.mp-section-head, .mp-legend) { margin-bottom: 7px; }
.mp-equity-chart .mp-chart { height: 215px; }
.mp-equity-chart .mp-monitor-note, .mp-analysis-breakdown .mp-monitor-note { margin-top: 6px; }
.mp-analysis-end { min-height: 20px; margin: 0 0 6px; color: var(--mp-muted); }
.mp-analysis-end b { margin-inline-start: 4px; }
.mp-month-list { display: grid; gap: 4px; }
.mp-dashboard .mp-month {
  display: grid; width: 100%; grid-template-columns: 48px minmax(0, 1fr) 63px;
  justify-items: stretch; text-align: left; gap: 8px;
}
.mp-month strong { text-align: right; white-space: nowrap; }
.mp-month-track { display: block; height: 5px; border-radius: 3px; background: var(--mp-border); }
.mp-month-fill { fill: var(--positive); }
.mp-month-fill.is-down { fill: var(--harm); }
.mp-months > .mp-monitor-note { margin-top: 7px; }
.mp-month-detail { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; margin: 8px 0 0; }
.mp-month-detail > div { min-width: 0; padding: 4px 6px; border: 1px solid var(--mp-border); border-radius: 5px; }
.mp-month-detail dt { color: var(--mp-muted); font-size: 11px; }
.mp-month-detail dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.mp-dashboard .mp-row-link[aria-pressed="true"] { color: var(--accent); }

.mp-report-flow { display: grid; gap: 10px; min-width: 0; }
.mp-monitor-section { min-width: 0; }
.mp-report-flow .mp-section-head { margin-bottom: 2px; }
.mp-report-flow h2, .mp-chart-card > h2 { font-size: 16px; }
.mp-report-toolbar { display: flex; flex-wrap: wrap; gap: 7px 14px; align-items: end; }
.mp-inline-form { display: flex; flex-wrap: wrap; gap: 5px; align-items: end; min-width: 0; }
.mp-inline-form label { display: grid; gap: 2px; min-width: 0; color: var(--mp-muted); }
.mp-inline-form input, #mp-goal-form input {
  min-width: 0; width: 100%; max-width: 245px; min-height: 33px; padding: 4px 6px;
  background: var(--mp-header); border: 1px solid var(--mp-border); border-radius: 6px; color: var(--text); font: inherit;
}
#mp-ledger-search label { width: min(68vw, 235px); }
#mp-goal-form input { width: clamp(58px, 12vw, 145px); }
.mp-dashboard .mp-scroll-table { overflow-x: auto; max-width: 100%; }
.mp-scroll-table table { min-width: max-content; }
.mp-scroll-table table th, .mp-scroll-table table td { white-space: nowrap; }
.mp-scroll-table [data-ledger-kind] th { min-width: 155px; }
.mp-scroll-table [data-ledger-kind] td:last-child { max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.mp-scroll-table small { display: block; color: var(--mp-muted); }
.mp-cash-row { background: color-mix(in srgb, var(--amber) 11%, var(--mp-surface)); }
.mp-cash-row :is(th, td) { color: var(--amber); }
.mp-hit-stop { background: color-mix(in srgb, var(--harm) 20%, var(--mp-surface)); }
.mp-hit-stop small { color: var(--harm); }
.mp-sort { background: transparent; }
.mp-dashboard button.mp-choice:disabled { opacity: .5; cursor: default; transform: none; }
.mp-metric-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 5px; padding: 0; margin: 0; min-width: 0;
}
.mp-metric-grid > div { background: var(--mp-header); border: 1px solid var(--mp-border); padding: 6px 8px; border-radius: 6px; min-width: 0; }
.mp-metric-grid dt { color: var(--mp-muted); font-size: 11px; overflow-wrap: anywhere; }
.mp-metric-grid dd { margin: 3px 0 0; font-weight: 680; overflow-wrap: anywhere; }
.mp-details .mp-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.mp-plot-layers { margin: 6px 0; }
.mp-plot-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; }
.mp-plot-dot-accent { background: var(--accent); }
.mp-plot-dot-amber { background: var(--amber); }
.mp-plot-dot-positive { background: var(--positive); }
.mp-plot-dot-harm { background: var(--harm); }
.mp-chart-readout { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--mp-muted); }
.mp-chart-readout input { min-width: 80px; max-width: 210px; accent-color: var(--accent); }
.mp-chart-readout output { color: var(--text); }
.mp-months > .mp-filter-buttons { margin-bottom: 6px; }
.mp-month-extra { display: grid; gap: 8px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.mp-month-extra > p { grid-column: 1 / -1; }
.mp-calendar { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; min-width: 0; }
.mp-calendar > b { text-align: center; }
.mp-calendar .mp-calendar-day {
  display: grid; align-content: start; justify-items: start; justify-content: stretch;
  padding: 4px 6px; gap: 2px; min-height: 70px; text-align: left; overflow-wrap: anywhere;
}
.mp-calendar-day.mp-up { background: color-mix(in srgb,var(--positive) 11%,var(--mp-header)); }
.mp-calendar-day.mp-down { background: color-mix(in srgb,var(--harm) 13%,var(--mp-header)); }
.mp-calendar-day.mp-up span { color: var(--positive); }
.mp-calendar-day.mp-down span { color: var(--harm); }
.mp-calendar-day small { color: var(--mp-muted); font-size: 10px; }
.mp-cal-blank { padding: 5px; opacity: .5; color: var(--mp-muted); }
.mp-win-loss { display: block; background: var(--mp-border); border-radius: 4px; overflow: hidden; }
.mp-win-segment, .mp-report-streak { fill: var(--positive); }
.mp-loss-segment { fill: var(--harm); }
.mp-report-bar,.mp-time-bars { display: grid; grid-template-columns: 80px minmax(0,1fr) 40px; gap: 8px; align-items: center; padding: 4px 0; }
.mp-report-streak { display: block; border-radius: 3px; }
.mp-time-bars { grid-template-columns: 65px minmax(0,1fr) 38px 83px; padding: 0; }
.mp-time-bars > b { text-align: end; }
.mp-monitor-section td > .mp-win-loss { margin-top: 4px; min-width: 55px; }
.mp-analysis, .mp-report-flow { scroll-margin-top: 150px; }

@media (max-width: 1080px) {
  .mp-analysis-charts, .mp-analysis-breakdown, .mp-month-extra { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 700px) {
  body.mp-home .shell > .main { width: 100%; min-width: 0; max-width: 100%; }
  body.mp-home .workspace .topbar { top: var(--gs-nav-height); padding-inline: 10px; }
  #main:has(.mp-dashboard) { padding-inline: 10px; }
  .mp-dashboard { gap: 12px; }
  .mp-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mp-kpi { padding: 8px 9px; }
  .mp-kpi:nth-child(3) { border-inline-start: none; }
  .mp-kpi:nth-child(n+3) { border-top: 1px solid var(--mp-border); }
  .mp-dashboard :is(.mp-choice, .mp-quiet, .mp-dialog button, .mp-row-link, .mp-switch button, .mp-create) { min-height: 44px; }
  .mp-dashboard table :is(th,td) { padding-inline: 6px; }
  .mp-dashboard table .mp-secondary { display: none; }
  .mp-dashboard table .mp-center { width: 38px; }
  .mp-scope { grid-template-columns: minmax(0, 1fr); }
  .mp-monitor-section table [data-holding] th { min-width: 0; }
  .mp-monitor-section table .mp-number { white-space: normal; }
  .mp-monitor-section table small.mp-mobile-order { display: block; margin-top: 3px; }
  .mp-monitor .mp-dialog button, .mp-header-actions > button { min-height: 44px; }
  .mp-equity-chart .mp-chart { height: 165px; }
  .mp-calendar { gap: 2px; }
  .mp-calendar .mp-calendar-day { min-height: 62px; padding-inline: 3px; font-size: 10px; }
  .mp-calendar-day small { font-size: 9px; }
  .mp-inline-form input { min-height: 42px; }
  .mp-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 375px) {
  .mp-dashboard .mp-create { padding-inline: 7px; }
  .mp-header h1 { font-size: 24px; }
  .mp-dialog { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .mp-dashboard .mp-choice, .mp-dialog label.mp-choice { transition: none; }
  .mp-dashboard .mp-choice:hover, .mp-dialog label.mp-choice:hover { transform: none; }
}

#mp-chart-title, .mp-monitor-tabs .mp-choice { scroll-margin-block-start: 112px; }
#mp-chart-title { scroll-margin-block-end: 110px; }
@media (max-width: 1023px) {
  #mp-chart-title, .mp-monitor-tabs .mp-choice { scroll-margin-block-start: calc(var(--gs-nav-height) + 72px); }
}
