/* Market map (the Lab). Built on the shared tokens, so Light, Dark and Paper all work. */
.reports.mm { max-width: 1280px; }
.mm-hero { max-width: 860px; padding-bottom: 18px; }
.mm-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.mm-date-wrap { min-width: 170px; }

.mm-section { margin-top: 30px; }
.mm-section > h2 { margin: 0 0 10px; font-family: var(--mono); font-size: 12px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.mm-muted { color: var(--muted); }
.mm-small { font-size: 12.5px; line-height: 1.55; }

/* What stands out */
.mm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mm-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--card-top), var(--card-bottom)); }
.mm-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.mm-kicker, .mm-f-title { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); font-weight: 600; }
.mm-card-title { color: var(--ink); font-size: 17px; font-weight: 650; line-height: 1.3; }
button.mm-go { all: unset; margin-top: auto; padding-top: 6px; cursor: pointer; font-family: var(--mono);
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--link, var(--accent)); }
button.mm-go:hover { text-decoration: underline; }
button.mm-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* controls */
.mm-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  margin-bottom: 10px; scroll-margin-top: 80px; }
.mm-explore { scroll-margin-top: 76px; }
.seg.mm-seg { display: inline-flex; width: auto; }
.seg.mm-seg label { padding: 7px 12px; letter-spacing: .04em; }
.mm-btn, button.mm-btn { width: auto; padding: 6px 10px; margin-left: 4px; font-size: 12px; letter-spacing: .02em;
  border-radius: 8px; line-height: 1.2; }
button.mm-btn.primary { margin-left: 0; }
.mm-wide, button.mm-wide { width: 100%; margin: 10px 0 4px; padding: 10px 12px; }

/* the stage: graph (or table) on the left, details on the right */
.mm-stage { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; }
.mm-graph { position: relative; height: min(76vh, 760px); min-height: 460px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--panel); overflow: hidden; }
.mm-pane { position: absolute; inset: 0; display: flex; flex-direction: column;
  visibility: hidden; pointer-events: none; z-index: -1; }
.mm-pane.is-shown { visibility: visible; pointer-events: auto; z-index: 1; }
.mm-canvas { position: relative; flex: 1; min-height: 0; }
.mm-side { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 14px 16px;
  height: min(76vh, 760px); min-height: 460px; overflow-y: auto; font-size: 13.5px; line-height: 1.5; }
.mm-side h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.mm-side h4 { margin: 16px 0 6px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--dim); }
.mm-side p { margin: 6px 0; }
.mm-panel-head { display: flex; align-items: center; gap: 10px; }
.mm-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--line-strong); }
.mm-findings { display: grid; gap: 8px; margin: 12px 0 4px; }
.mm-finding { border-left: 3px solid var(--accent); padding: 6px 10px; background: var(--raise);
  border-radius: 0 8px 8px 0; color: var(--ink); }
.mm-chart { margin: 0 -6px; }

/* toolbar row above each graph: never drawn over the canvas */
.mm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--raise); position: relative; z-index: 5; }
.mm-hover { flex: 1 1 220px; min-width: 0; color: var(--muted); font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-hover-row { flex: none; padding: 5px 12px; border-bottom: 1px solid var(--line-soft); }
.mm-tools { display: flex; flex-wrap: wrap; align-items: center; margin-left: auto; }
.mm-search { flex: 1 1 240px; min-width: 200px; }
.mm-dd { position: relative; display: inline-block; }
.mm-dd > summary { list-style: none; cursor: pointer; display: inline-block; }
.mm-dd > summary::-webkit-details-marker { display: none; }
.mm-dd > summary.mm-btn { background: var(--raise); border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.mm-dd-body { position: absolute; right: 0; top: calc(100% + 6px); width: 320px; max-width: 80vw; z-index: 20;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 12.5px; line-height: 1.5; display: grid; gap: 4px; }
.mm-sw-line { display: inline-block; width: 20px; height: 0; margin-right: 8px; vertical-align: middle; }
.mm-sw-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.mm-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12.5px;
  border-bottom: 1px solid var(--line); background: var(--accent-soft, var(--raise)); color: var(--ink); }

/* links table */
.mm-pane-links { overflow: hidden; }
.mm-link-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); background: var(--raise); }
.mm-kind { flex: 2 1 260px; }
.mm-input { flex: 1 1 140px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); font-size: 13px; }
.mm-table-wrap { flex: 1; overflow: auto; padding: 4px 8px 12px; }
.mm-table { width: 100%; }
.mm-table th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.mm-table td, .mm-table th { padding: 7px 6px; }
.mm-side .mm-table td, .mm-side .mm-table th { padding: 4px 4px; }
.mm-links tr.is-selected td { background: var(--accent-soft, var(--raise)); }
.mm-links tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.mm-links tbody tr:hover td { background: var(--raise); }
button.mm-pair { all: unset; cursor: pointer; white-space: nowrap; font-family: var(--mono); font-weight: 700; color: var(--link, var(--accent)); }
button.mm-pair:hover { text-decoration: underline; }
button.mm-pair:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mm-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-family: var(--sans); font-size: 11.5px;
  font-weight: 600; border: 1px solid var(--line-strong); color: var(--ink); white-space: nowrap; }
.mm-specific-bridge { border-color: #d62728; } .mm-embedded-link { border-color: #ff7f0e; }
.mm-interchangeable { border-color: #2ca02c; } .mm-fragile { border-color: var(--dim); color: var(--muted); }
.mm-tagrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.mm-rules { padding-left: 18px; font-size: 12.5px; } .mm-rules li { margin: 6px 0; }
abbr[title] { text-decoration: underline dotted; cursor: help; }

/* method notes */
.mm-method { border-top: 1px solid var(--line); padding: 10px 0; max-width: 820px; }
.mm-method summary { cursor: pointer; font-weight: 650; font-size: 15px; color: var(--ink); }
.mm-method p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 8px 0 0; }

/* Dash 4 dropdowns in the site's colours */
.mm { --Dash-Fill-Inverse-Strong: var(--panel); --Dash-Text-Strong: var(--ink); --Dash-Text-Primary: var(--ink);
  --Dash-Text-Weak: var(--muted); --Dash-Text-Disabled: var(--dim); --Dash-Fill-Interactive-Strong: var(--accent);
  --Dash-Fill-Interactive-Weak: var(--raise); --Dash-Fill-Primary-Hover: var(--raise);
  --Dash-Fill-Primary-Active: var(--raise-hover); --Dash-Fill-Disabled: var(--raise);
  --Dash-Stroke-Strong: var(--line-strong); --Dash-Stroke-Weak: var(--line); }
.mm .dash-dropdown { font-size: 13px; }
.mm .dash-dropdown-search { background: var(--panel); color: var(--ink); }

@media (max-width: 980px) {
  .mm-stage { grid-template-columns: minmax(0, 1fr); }
  .mm-side { height: auto; min-height: 0; max-height: none; }
  .mm-graph { height: 64vh; min-height: 380px; }
}
@media (max-width: 640px) {
  .reports.mm { padding: 0 14px 40px; }
  .mm-hero { padding-top: 26px; }
  .seg.mm-seg { width: 100%; }
  .seg.mm-seg label { padding: 7px 4px; font-size: 11.5px; }
  .mm-returns { width: 100%; }
  .mm-graph { height: 62vh; }
  .mm-toolbar .mm-hover { flex-basis: 100%; }
  .mm-tools { margin-left: 0; }
  .mm-links th:nth-child(2), .mm-links td:nth-child(2), .mm-links th:nth-child(5), .mm-links td:nth-child(5) { display: none; }
}
