/* Muscle map concept — dark charcoal + orange accent. Variables/fonts come from marketing.css (read-only).
   No tan/beige/cream anywhere. */
.mm {
  --mm-bg: var(--bg, #0a0b0d);
  --mm-surface: var(--surface, #16191e);
  --mm-surface-2: var(--surface-2, #1c2026);
  --mm-line: var(--line-2, rgba(255,255,255,.14));
  --mm-text: var(--text, #f3f4f6);
  --mm-muted: var(--muted, #a7acb6);
  --mm-accent: var(--accent, #ff5a1f);
  --mm-accent-2: var(--accent-2, #ff7a45);
  --mm-display: var(--display, "Barlow Condensed", "Arial Narrow", Impact, sans-serif);
  --mm-sans: var(--sans, "Inter", system-ui, sans-serif);
  margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--mm-bg); color: var(--mm-text); font-family: var(--mm-sans); font-size: 15px; line-height: 1.45;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  -webkit-text-size-adjust: 100%;
}
.mm *, .mm *::before, .mm *::after { box-sizing: border-box; }
.mm button { font: inherit; color: inherit; cursor: pointer; }
.mm .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mm-skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--mm-accent); color: #0a0b0d; padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.mm-skip:focus { top: 8px; }

/* header */
.mm-top { flex: none; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 14px 10px; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); background: linear-gradient(#0f1114, #0a0b0d); }
.mm-brand { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mm-muted); }
.mm-brand a { color: var(--mm-muted); text-decoration: none; font-weight: 600; }
.mm-brand a.mm-back { display: inline-flex; align-items: center; min-height: 44px; padding-right: 8px; color: var(--mm-text); }
.mm-brand a:hover { color: var(--mm-text); }
.mm-tag { border: 1px solid var(--mm-line); border-radius: 99px; padding: 1px 9px; font-size: 11px; letter-spacing: .08em; color: var(--mm-accent-2); }
.mm-title { margin: 0; font-family: var(--mm-display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: .01em; text-transform: uppercase; }
.mm-modes { display: flex; gap: 0; background: var(--mm-surface); border: 1px solid var(--mm-line); border-radius: 12px; padding: 3px; grid-column: 1 / -1; }
.mm-mode { flex: 1; min-height: 44px; padding: 0 10px; border: 0; background: transparent; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--mm-muted); white-space: nowrap; }
.mm-mode[aria-pressed="true"] { background: var(--mm-accent); color: #0a0b0d; }
.mm-mode:not([aria-pressed="true"]):hover { color: var(--mm-text); background: var(--mm-surface-2); }
.mm :focus-visible { outline: 2px solid var(--mm-accent-2); outline-offset: 2px; border-radius: 6px; }

/* layout: phone/portrait = stage over a bottom sheet; wide = stage + side panel */
.mm-app { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
.mm-stage { position: relative; min-height: 0; min-width: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 38%, #1b2028 0%, #101317 55%, #0a0b0d 100%); }
.mm-view { position: absolute; inset: 0; outline-offset: -3px; }
.mm-canvas-el { display: block; }
.mm-tools { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.mm-tool { width: 48px; min-height: 48px; border-radius: 14px; border: 1px solid var(--mm-line); background: rgba(22,25,30,.88); display: grid; place-items: center; padding: 0; backdrop-filter: blur(6px); }
.mm-tool svg { width: 22px; height: 22px; }
.mm-tool:hover { border-color: var(--mm-accent); }
.mm-flip { width: 48px; flex-direction: column; gap: 0; align-content: center; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mm-accent-2); }
.mm-flip svg { width: 20px; height: 20px; }
.mm-legend { position: absolute; left: 10px; bottom: 10px; z-index: 3; display: flex; flex-direction: column; gap: 6px; max-width: calc(100% - 80px); font-size: 12px; color: var(--mm-muted); background: rgba(10,11,13,.72); border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 12px; padding: 8px 10px; pointer-events: none; }
.mm-legend:empty { display: none; }
.mm-legend-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mm-sw { width: 16px; height: 16px; border-radius: 5px; display: inline-block; flex: none; border: 2px solid var(--mm-accent); }
.mm-sw.p { background: var(--mm-accent); }
.mm-sw.s { background: #ff9a6a; box-shadow: inset 0 0 0 2px rgba(10,11,13,.35); }
.mm-sw.o { background: #3b4350; border-color: #3b4350; }
.mm-ramp { width: 150px; height: 10px; border-radius: 6px; background: linear-gradient(90deg, #2e343d, #a63a14, #ff5a1f, #ff8a3d); }
.mm-ramp-lab { display: flex; justify-content: space-between; width: 150px; font-size: 11px; }
.mm-hint { position: absolute; top: 12px; left: 12px; margin: 0; z-index: 2; font-size: 12px; color: var(--mm-muted); background: rgba(10,11,13,.6); padding: 4px 10px; border-radius: 99px; max-width: calc(100% - 90px); pointer-events: none; transition: opacity .4s; }
.mm-hint.gone { opacity: 0; }
.mm-tip { position: fixed; z-index: 40; pointer-events: none; background: #0a0b0d; border: 1px solid var(--mm-accent); color: var(--mm-text); font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 8px; transform: translate(12px, -34px); white-space: nowrap; }

/* panel */
.mm-panel { background: var(--mm-surface); border-top: 1px solid var(--mm-line); display: flex; flex-direction: column; min-height: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -12px 32px rgba(0,0,0,.45); transition: height .28s cubic-bezier(.2,.7,.2,1); overflow: hidden; padding-bottom: env(safe-area-inset-bottom); }
.mm-panel[data-sheet="peek"] { height: 66px; }
.mm-panel[data-sheet="open"] { height: min(48dvh, 560px); }
.mm-handle { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 66px; width: 100%; background: transparent; border: 0; padding: 8px 16px; }
.mm-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--mm-line); }
.mm-handle-label { font-family: var(--mm-display); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: .02em; }
.mm-panel-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 16px 20px; }
.mm-panel[data-sheet="peek"] .mm-panel-body { visibility: hidden; }

@media (min-width: 900px), (orientation: landscape) and (max-height: 520px) {
  .mm-app { grid-template-columns: minmax(0, 1fr) clamp(340px, 36vw, 440px); grid-template-rows: minmax(0, 1fr); }
  .mm-panel, .mm-panel[data-sheet] { height: auto; border-radius: 0; border-top: 0; border-left: 1px solid var(--mm-line); box-shadow: none; }
  .mm-panel[data-sheet="peek"] .mm-panel-body { visibility: visible; }
  .mm-handle { display: none; }
  .mm-panel-body { padding-top: 16px; }
  .mm-top { grid-template-columns: auto 1fr auto; padding: 10px 20px; }
  .mm-brand { grid-column: auto; order: 0; }
  .mm-title { order: 1; text-align: left; }
  .mm-modes { grid-column: auto; order: 2; min-width: 340px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .mm-top { padding: 6px 12px; } .mm-title { font-size: 26px; } .mm-brand { display: none; }
  .mm-mode { min-height: 44px; }
}

/* panel content */
.mm-panel h2 { margin: 0; font-family: var(--mm-display); font-weight: 800; font-size: 32px; line-height: 1; text-transform: uppercase; letter-spacing: .01em; }
.mm-panel h3 { margin: 18px 0 6px; font-family: var(--mm-display); font-weight: 800; font-size: 20px; line-height: 1; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.mm-panel h3 .mm-sw { width: 14px; height: 14px; }
.mm-ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.mm-clear { min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--mm-line); background: transparent; border-radius: 10px; color: var(--mm-muted); font-size: 13px; }
.mm-fn { margin: 6px 0 10px; color: #d6d9df; }
.mm-fn b, .mm-k { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mm-accent-2); font-weight: 700; margin-bottom: 2px; }
.mm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; padding: 0; list-style: none; }
.mm-chip { min-height: 44px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--mm-line); background: var(--mm-surface-2); color: var(--mm-text); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; }
.mm-chip[aria-pressed="true"] { background: var(--mm-accent); border-color: var(--mm-accent); color: #0a0b0d; font-weight: 700; }
.mm-chip.sm { min-height: 44px; padding: 0 11px; font-size: 13px; }
.mm-chip.static { cursor: default; min-height: 30px; font-size: 13px; padding: 0 11px; }
.mm-chip.pri { background: var(--mm-accent); color: #0a0b0d; border-color: var(--mm-accent); font-weight: 700; }
.mm-chip.sec { background: transparent; color: #ff9a6a; border-color: var(--mm-accent); }
.mm-count { margin: 10px 0 0; font-size: 14px; color: var(--mm-muted); }
.mm-count b { color: var(--mm-text); }
.mm-select, .mm-input { width: 100%; min-height: 48px; background: var(--mm-surface-2); color: var(--mm-text); border: 1px solid var(--mm-line); border-radius: 12px; padding: 0 12px; font: inherit; font-size: 16px; }
.mm-label { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mm-muted); margin: 12px 0 6px; font-weight: 600; }
.mm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mm-ex { background: var(--mm-surface-2); border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 12px; }
.mm-ex-row { display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px 12px; min-height: 52px; }
.mm-ex-main { flex: 1; min-width: 0; padding: 6px 0; }
.mm-ex-name { color: var(--mm-text); font-weight: 600; text-decoration: none; display: flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.mm-ex-name:hover { color: var(--mm-accent-2); text-decoration: underline; }
.mm-ex-meta { display: block; font-size: 12px; color: var(--mm-muted); }
.mm-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; padding: 0; color: var(--mm-accent-2); }
.mm-ic span { width: 24px; height: 24px; border: 1.8px solid currentColor; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--mm-sans); font-style: italic; font-family: Georgia, serif; }
.mm-ic[aria-expanded="true"] span { background: var(--mm-accent); color: #0a0b0d; border-color: var(--mm-accent); }
.mm-ic.show span { font-style: normal; font-family: var(--mm-sans); font-size: 12px; }
.mm-det { padding: 4px 14px 14px; font-size: 14px; color: #d6d9df; border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.mm-det p { margin: 8px 0 6px; }
.mm-det ol, .mm-det ul { margin: 4px 0 8px; padding-left: 20px; }
.mm-det li { margin: 2px 0; }
.mm-det a { color: var(--mm-accent-2); }
.mm-empty { color: var(--mm-muted); padding: 10px 0; }
.mm-note { font-size: 12px; color: var(--mm-muted); margin: 10px 0 0; }
.mm-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--mm-accent); color: var(--mm-accent-2); }
.mm-card { background: var(--mm-surface-2); border: 1px solid var(--mm-line); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.mm-card h2 { font-size: 28px; }
.mm-bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.mm-bar { display: grid; grid-template-columns: 136px 1fr 38px; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 8px; background: transparent; border: 0; border-radius: 10px; text-align: left; }
.mm-bar:hover, .mm-bar[aria-pressed="true"] { background: var(--mm-surface-2); }
.mm-bar[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--mm-line); }
.mm-bar-l { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-bar-t { height: 10px; border-radius: 6px; background: #232830; overflow: hidden; }
.mm-bar-f { display: block; height: 100%; border-radius: 6px; background: var(--mm-accent); }
.mm-bar-v { font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; color: var(--mm-muted); }
.mm-noscript { padding: 20px; }

@media (min-width: 700px) and (max-width: 899px) and (orientation: portrait) {
  .mm-panel[data-sheet="open"] { height: min(46dvh, 620px); }
  .mm-panel-body { padding: 0 24px 24px; }
  .mm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { .mm-panel, .mm-hint { transition: none; } }
@media (max-width: 400px) { .mm-bar { grid-template-columns: 118px 1fr 34px; } }
@media (max-width: 520px) and (orientation: portrait) {
  .mm-top { grid-template-columns: 1fr auto; gap: 8px 10px; padding: 8px 12px; }
  .mm-brand { grid-column: 2; grid-row: 1; justify-self: end; } .mm-brand a:not(.mm-back) { display: none; }
  .mm-title { grid-column: 1; grid-row: 1; font-size: 30px; }
  .mm-modes { grid-row: 2; }
}
