/* ── Reset & Tokens ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Background layers ── */
  --bg:        #0d1117;
  --surface:   #161b27;
  --surface2:  #1f2535;
  --border:    #2a3050;

  /* ── Accent — Multimeter (meter yellow) ── */
  --accent:    #facc15;
  --accent-lo: rgba(250,204,21,.22);

  /* ── Semantic colours — DO NOT CHANGE ── */
  --green:     #3ddc84;
  --red:       #ff5555;
  --gold:      #f5c842;

  /* ── Typography ── */
  --text:      #dde3f0;
  --text-dim:  #6b7a99;
  --font:      'Segoe UI', system-ui, sans-serif;
  --mono:      'Courier New', monospace;

  /* ── Layout ── */
  --radius:    12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  padding: 0 16px;
}

#app { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

/* ── Header ─── */
header { text-align: center; padding: 4px 0; }
header h1 {
  font-size: 1.8rem; font-weight: 700;
  background: linear-gradient(120deg, #60a5fa 0%, #e8793a 55%, #22c55e 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.subtitle { color: var(--text-dim); font-size: 0.85rem; margin-top: 3px; }

/* ── Controls bar ─── */
.controls-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.ctrl-group  { display: flex; align-items: center; gap: 8px; }
.ctrl-label  { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); white-space: nowrap; }
.ctrl-value  { font-size: 0.82rem; color: var(--accent); font-weight: 600; min-width: 40px; }

/* ── Pill tabs ─── */
.pill-tabs { display: flex; background: var(--bg); border-radius: 8px; padding: 3px; gap: 2px; }
.pill {
  padding: 5px 13px; border: none; background: transparent; color: var(--text-dim);
  border-radius: 6px; cursor: pointer; font-size: 0.81rem;
  transition: background .18s, color .18s, box-shadow .18s;
}
.pill.active { background: var(--accent); color: #fff; box-shadow: 0 0 12px var(--accent-lo); }
.pill:hover:not(.active) { background: var(--surface2); color: var(--text); }

/* ── Buttons ─── */
.btn { padding: 8px 18px; border: none; border-radius: 8px; cursor: pointer; font-size: 0.84rem; font-weight: 600; transition: filter .18s, box-shadow .18s, opacity .18s; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:not(:disabled):hover { filter: brightness(1.12); box-shadow: 0 0 12px var(--accent-lo); }
.btn-ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }

/* ── Sliders ─── */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 120px; height: 6px;
  background: var(--surface2); border-radius: 3px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: 0 0 6px var(--accent-lo);
}

/* ── Canvas card ─── */
.canvas-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
  overflow-x: clip;
}
.canvas-card canvas { display: block; width: 100%; height: auto; touch-action: pan-y; }

/* ── Readout panel ─── */
.readout-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.readout-cell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.readout-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.readout-value { font-size: 1.05rem; font-weight: 700; color: var(--text); font-family: var(--mono); }

/* ── Explore panel ─── */
.explore-tabs {
  display: flex; background: var(--bg); border-radius: 8px; padding: 3px; gap: 2px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.concept-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  transition: border-color .2s;
}
.concept-card:hover { border-color: var(--accent); }
.concept-card h3 { font-size: 0.95rem; color: var(--accent); margin-bottom: 4px; }
.concept-card .cc-formula {
  font-family: var(--mono); font-size: 0.82rem;
  background: var(--surface2); padding: 6px 10px; border-radius: 6px;
  margin: 8px 0; color: var(--gold);
}
.concept-card .cc-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.45; }
.concept-card .cc-example {
  margin-top: 10px; padding: 10px; background: var(--bg);
  border-radius: 8px; border-left: 3px solid var(--accent);
}
.concept-card .cc-example-title { font-size: 0.72rem; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.concept-card .cc-example p { font-size: 0.8rem; color: var(--text-dim); margin: 2px 0; }

/* ── Practice panel ─── */
.practice-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.practice-prompt { font-size: 0.9rem; flex: 1 1 100%; margin-bottom: 4px; line-height: 1.5; }
.practice-input-group { display: flex; align-items: center; gap: 6px; }
.practice-input-group input {
  width: 120px; padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-size: 0.9rem; font-family: var(--mono);
}
.practice-unit { font-size: 0.82rem; color: var(--text-dim); }
.pbar-score { font-size: 0.84rem; color: var(--text-dim); margin-left: auto; }
.pbar-score span { color: var(--text); font-weight: 700; }
.feedback { margin-top: 6px; padding: 0 16px; min-height: 22px; }
.feedback.ok  { color: var(--green); font-size: 0.88rem; font-weight: 600; }
.feedback.err { color: var(--red);   font-size: 0.88rem; font-weight: 600; }
.solution-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  font-size: 0.85rem; line-height: 1.6; color: var(--text-dim);
}
.solution-panel .step { margin: 4px 0; }
.solution-panel .step-num { color: var(--accent); font-weight: 600; }

/* ── Quiz panel ─── */
.quiz-bar {
  padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.quiz-counter { font-size: 0.78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.quiz-prompt { display: block; font-size: 0.95rem; margin: 10px 0; line-height: 1.5; }
.quiz-options { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.quiz-opt {
  padding: 10px 14px; border-radius: 8px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 0.88rem; transition: border-color .2s;
  text-align: left;
}
.quiz-opt:hover { border-color: var(--accent); }
.quiz-opt.selected { border-color: var(--accent); background: var(--accent-lo); }
.quiz-opt.correct { border-color: var(--green); background: rgba(61,220,132,.15); }
.quiz-opt.wrong { border-color: var(--red); background: rgba(255,85,85,.15); }
.quiz-input-group { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.quiz-input-group input {
  width: 140px; padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-size: 0.9rem; font-family: var(--mono);
}
.quiz-unit { font-size: 0.82rem; color: var(--text-dim); }
.quiz-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ── Quiz result ─── */
.quiz-result {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
}
.qr-header { text-align: center; margin-bottom: 16px; }
.qr-score { font-size: 2rem; font-weight: 700; }
.qr-score.perfect { color: var(--gold); }
.qr-score.good    { color: var(--green); }
.qr-score.poor    { color: var(--red); }
.qr-stars { font-size: 1.4rem; margin-top: 4px; }
.qr-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.qr-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 8px; background: var(--surface2);
  font-size: 0.84rem;
}
.qr-row.ok  { border-left: 3px solid var(--green); }
.qr-row.err { border-left: 3px solid var(--red); }
.qr-row .qr-q { flex: 1; color: var(--text-dim); }
.qr-row .qr-a { color: var(--text); font-weight: 600; margin: 0 10px; }
.qr-row .qr-icon { font-size: 1rem; }
.qr-retry { text-align: center; margin-top: 14px; }

/* ── SEO article ─── */
.seo-article {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px; line-height: 1.7;
}
.seo-article h2 { font-size: 1.3rem; color: var(--accent); margin-bottom: 12px; }
.seo-article h3 { font-size: 1.05rem; color: var(--text); margin: 18px 0 8px; }
.seo-article p { font-size: 0.92rem; color: var(--text-dim); margin-bottom: 10px; }
.seo-article a { color: var(--accent); text-decoration: none; }
.seo-article a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
  .readout-panel { grid-template-columns: repeat(3, 1fr); }
  .controls-bar { gap: 10px; }
  input[type="range"] { width: 90px; }
  .concept-grid { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  header h1 { font-size: 1.4rem; }
  .subtitle  { font-size: 0.78rem; }
  .controls-bar { padding: 10px 12px; gap: 8px; }
  .pill { padding: 5px 10px; font-size: 0.76rem; }
  .readout-panel { grid-template-columns: repeat(2, 1fr); }
  input[type="range"] { width: 70px; }
  .practice-bar { flex-direction: column; align-items: stretch; }
  .pbar-score { margin-left: 0; }
}

/* INTERLINK-START  header quick-links */
.head-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:wrap;justify-content:flex-end;}
.btn-link{display:inline-flex;align-items:center;gap:7px;padding:5px 12px;border-radius:8px;font-size:.82rem;font-weight:700;text-decoration:none;cursor:pointer;background:var(--surface2,#1f2535);color:var(--text,#dde3f0);border:1.5px solid var(--border,#2a3050);white-space:nowrap;transition:border-color .18s,background .18s,color .18s;}
.btn-link:hover{border-color:var(--accent,#4fc3f7);background:var(--accent-lo,rgba(79,195,247,.18));color:#fff;}
.btn-link img{width:20px;height:20px;border-radius:4px;flex:none;}
.btn-link .lbl{line-height:1;}
@media(max-width:560px){.btn-link .lbl{display:none;}.btn-link{padding:5px 9px;}}
/* With a third quick-link (Gearbox) the row overflowed by ~17 px and
   wrapped under the mode tabs — at every width, since #app caps the bar.
   Share keeps its icon and word; only the trailing "your setup" goes, as
   site.css already does below 640 px. */
.head-actions .btn-share-ext { display: none; }
/* ...and on a 1024-1100 px window it still did not fit, so the quick-links
   go icon-only there (title + aria-label keep the name), as they already
   do below 560 px. Wider than 1100 px the labels return. */
@media (max-width: 1100px) { .btn-link .lbl { display: none; } .btn-link { padding: 5px 9px; } }
/* INTERLINK-END */

/* ── Display Controls — collapsible overlay pinned to the canvas ── */
.canvas-toggles {
  position: absolute; top: 16px; left: 16px; z-index: 4;
  background: rgba(13,17,23,0.88);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  max-width: calc(100% - 32px);
}
.canvas-toggles > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: center; gap: 0;
  padding: 0; white-space: nowrap;
  width: 34px; height: 34px;
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text); border-radius: 9px; transition: background .12s, color .12s;
}
.canvas-toggles > summary .cvt-title,
.canvas-toggles > summary .cvt-caret { display: none; }
.canvas-toggles .cvt-ico { width: 17px; height: 17px; }
/* Opened, it earns its caption back — the user has chosen to cover the canvas. */
.canvas-toggles[open] > summary {
  width: auto; height: auto; min-height: 30px;
  padding: 6px 10px; gap: 7px; justify-content: flex-start;
}
.canvas-toggles[open] > summary .cvt-title { display: inline; }
.canvas-toggles[open] > summary .cvt-caret { display: inline; }
.canvas-toggles > summary::-webkit-details-marker { display: none; }
.canvas-toggles > summary::marker { content: ''; }
.canvas-toggles > summary:hover { background: var(--accent-lo); color: var(--accent); }
.canvas-toggles > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.canvas-toggles .cvt-ico { flex-shrink: 0; color: var(--accent); }
.canvas-toggles .cvt-caret {
  margin-left: auto; padding-left: 4px; color: var(--text-dim);
  font-size: 0.7rem; transition: transform .2s;
}
.canvas-toggles[open] > summary .cvt-caret { transform: rotate(180deg); color: var(--accent); }
.canvas-toggles[open] > summary {
  border-bottom: 1px solid var(--border); border-radius: 9px 9px 0 0;
}
.canvas-toggles .cvt-body {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 11px 10px; max-height: 60vh; overflow-y: auto;
}
.canvas-toggles .cvt-group {
  font-size: 0.58rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent);
  margin-top: 4px; padding-bottom: 2px; border-bottom: 1px solid var(--border);
}
.canvas-toggles .cvt-group:first-child { margin-top: 0; }
.canvas-toggles .cvt-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--text-dim); cursor: pointer;
  white-space: nowrap; transition: color .12s;
}
.canvas-toggles .cvt-item:hover { color: var(--text); }
.canvas-toggles .cvt-item input[type="checkbox"] {
  accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; flex-shrink: 0;
}
.canvas-toggles .cvt-reset {
  margin-top: 7px; padding: 5px 9px; min-height: 28px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; cursor: pointer;
  transition: border-color .12s, color .12s;
}
.canvas-toggles .cvt-reset:hover { border-color: var(--accent); color: var(--accent); }
.canvas-toggles .cvt-reset:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Calculation modal ── */
.calc-modal {
  display: none; position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto;
}
.calc-modal.open { display: flex; }
.calc-modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 780px; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  max-height: calc(100vh - 48px); overflow: hidden;
}
.calc-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface2); flex-shrink: 0;
}
.calc-modal-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.calc-modal-close {
  width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text-dim);
  font-size: 1.4rem; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.calc-modal-close:hover { border-color: var(--accent); color: var(--text); background: var(--surface2); }
.calc-modal-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
/* ── Learning panels ── */
.learn-panels {
  padding: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.learn-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.learn-head-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.learn-head-actions { display: flex; gap: 8px; }
.learn-toggle-all {
  padding: 6px 12px; min-height: 32px;
  background: var(--accent-lo); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px;
  font-family: var(--font); font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.learn-toggle-all:hover { background: var(--surface2); border-color: var(--accent); }
.learn-toggle-all:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.learn-card {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); margin-bottom: 10px; overflow: hidden;
  transition: border-color .2s;
}
.learn-card:last-child { margin-bottom: 0; }
.learn-card[open] { border-color: var(--accent); }
.learn-card > summary {
  list-style: none; cursor: pointer;
  padding: 11px 14px; min-height: 44px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.88rem; font-weight: 700; color: var(--text);
  user-select: none; transition: background .15s;
}
.learn-card > summary::-webkit-details-marker { display: none; }
.learn-card > summary::marker { content: ''; }
.learn-card > summary:hover { background: var(--accent-lo); }
.learn-card > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.learn-card > summary::after {
  content: '\25BE'; margin-left: auto; color: var(--text-dim);
  font-size: 0.78rem; transition: transform .2s;
}
.learn-card[open] > summary::after { transform: rotate(180deg); color: var(--accent); }
.lp-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent-lo); font-size: 0.9rem; flex-shrink: 0;
}
.lp-sub { color: var(--text-dim); font-weight: 500; font-size: 0.78rem; }
.learn-body { padding: 12px 14px 14px; }
.eq-line { margin: 8px 0; overflow-x: auto; overflow-y: hidden; font-size: 0.95rem; }
.lp-note { font-size: 0.8rem; line-height: 1.6; color: var(--text-dim); margin: 10px 0 0; }
.lp-note strong { color: var(--text); }

/* ── Canvas context menu ── */
.ctx-menu {
  position: fixed; z-index: 1300; min-width: 210px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 10px 26px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 2px;
}
.ctx-item {
  text-align: left; padding: 8px 11px; min-height: 38px;
  background: transparent; border: none; border-radius: 6px;
  color: var(--text); font-family: var(--font); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.ctx-item:hover { background: var(--surface2); }
.ctx-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.ctx-sep { height: 1px; background: var(--border); margin: 3px 6px; }

/* ═══ Touch: the collapsed chip grows to the 44px minimum. Must stay LAST
   so it wins over the .canvas-toggles rules above. ═══ */
@media (max-width: 768px) {
  .canvas-toggles > summary { width: 44px; height: 44px; }
  .canvas-toggles .cvt-ico { width: 18px; height: 18px; }
  .canvas-toggles[open] > summary { width: auto; height: auto; padding: 7px 10px; }
}


/* ═══ Multimeter — the bench workspace ═══════════════════════════
   One workspace: the circuits above the picture, the picture with the probe chips on it, the task coach
   under it, and the meter panel beside it (a remote for everything on the meter's face). */
#sim-panel { display: flex; flex-direction: column; gap: 12px; }
.mm-work { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 14px; align-items: start; }
.mm-stagecol { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* circuits */
.scene-bar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.scen-btn { position: relative; display: flex; align-items: center; gap: 8px; text-align: left; padding: 7px 10px; min-height: 50px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; font-family: var(--font); transition: border-color .15s, background .15s, color .15s; min-width: 0; }
.scen-btn svg { flex: 0 0 auto; color: var(--text-dim); transition: color .15s; }
.scen-txt { display: flex; flex-direction: column; min-width: 0; }
.scen-txt strong { font-size: .84rem; line-height: 1.15; color: var(--text); }
.scen-btn:hover { border-color: rgba(250,204,21,.55); color: var(--text); }
.scen-btn.active { border-color: var(--accent); background: linear-gradient(180deg, rgba(250,204,21,.16), rgba(250,204,21,.05)); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.scen-btn.active svg { color: var(--accent); }
.scen-done { position: absolute; top: 4px; right: 6px; font-size: .62rem; font-weight: 800; color: var(--text-dim); }
.scen-done.all { color: var(--green); }
.scen-done.all::before { content: '✓ '; }

/* the picture */
.canvas-card { position: relative; padding: 0; background: #17140f; }
.canvas-card canvas#mm-canvas { display: block; width: 100%; touch-action: none; border-radius: var(--radius) var(--radius) 0 0; }
.canvas-card canvas#mm-canvas[hidden] { display: none; }
#mm-canvas:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.mm3d-stage { position: relative; width: 100%; aspect-ratio: 16 / 9.6; min-height: 380px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.mm3d-stage[hidden] { display: none; }
.mm3d-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mm3d-hud { touch-action: none; cursor: move; }
.mm-note { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 10px;
  background: rgba(13,17,23,.92); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px 8px 14px; font-size: .8rem; color: var(--text); max-width: calc(100% - 24px); }
.mm-note[hidden] { display: none; }
.mm-note button { background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; flex-shrink: 0; }

/* the probe chips in the dock: which probe a click on a test point places */
.probe-chips { display: flex; gap: 6px; }
.pchip { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 4px 12px 4px 9px; border-radius: 999px; cursor: pointer; font-family: var(--font);
  background: var(--bg); border: 1.5px solid var(--border); color: var(--text-dim); font-size: .76rem; transition: border-color .15s, background .15s, box-shadow .15s; }
.pchip b { color: var(--text); font-weight: 800; }
.pchip-dot { width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 -2px 3px rgba(0,0,0,.4); }
.pchip-r .pchip-dot { background: #e5323a; }
.pchip-b .pchip-dot { background: #24262b; border: 1.5px solid #d9dee6; }
.pchip-at { max-width: 9.5em; display: inline-block; vertical-align: bottom; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pchip.placed .pchip-at { color: #8ff0b6; }
.pchip:hover { border-color: rgba(255,255,255,.35); }
.pchip-r.on { border-color: #ff5a5a; box-shadow: 0 0 0 3px rgba(255,90,90,.22); background: rgba(60,12,14,.9); }
.pchip-b.on { border-color: #e6eaf0; box-shadow: 0 0 0 3px rgba(230,234,240,.18); background: rgba(30,33,40,.94); }
.pchip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* the dock under the picture */
.canvas-dock { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px 10px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.dock-sep { width: 1px; align-self: stretch; min-height: 32px; background: var(--border); margin: 0 2px; }
.canvas-dock .btn { min-height: 38px; padding: 6px 12px; font-size: .8rem; white-space: nowrap; }
.canvas-dock .dock-reset { margin-left: auto; }
.vt-tabs { display: flex; background: rgba(13,17,23,.88); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
#cam-tabs[hidden] { display: none; }
.cam-float { position: absolute; top: 10px; right: 10px; z-index: 6; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.vt-pill { min-width: 40px; height: 32px; padding: 0 11px; border: none; border-radius: 7px; background: transparent; color: var(--text-dim); font-weight: 800; font-size: .78rem; cursor: pointer; font-family: var(--font); }
.vt-pill.vt-icon { min-width: 32px; padding: 0; font-size: 1.05rem; }
.vt-pill.active { background: var(--accent); color: #1b1606; }
.vt-pill:hover:not(.active) { color: var(--text); background: var(--surface2); }
.vt-pill:focus-visible, .scen-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-explain { background: rgba(253,230,138,.12); color: #fde68a; border: 1px solid rgba(253,230,138,.45); }
.btn-explain:hover, .btn-explain.on { background: rgba(253,230,138,.24); }

/* the task coach */
.coach { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.coach-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.coach-kicker { font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.coach-tasks { display: flex; gap: 5px; }
.ct-btn { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--bg); color: var(--text-dim); font-weight: 800; font-size: .8rem; cursor: pointer; font-family: var(--font); transition: border-color .15s, background .15s; }
.ct-btn:hover { border-color: var(--accent); color: var(--text); }
.ct-btn.on { border-color: var(--accent); background: var(--accent); color: #1b1606; }
.ct-btn.done { border-color: var(--green); color: var(--green); }
.ct-btn.done.on { background: var(--green); color: #0b1a10; }
.ct-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.coach-progress { margin-left: auto; font-size: .74rem; color: var(--text-dim); }
.coach-title { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.35; margin: 0; }
.coach-ok { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(61,220,132,.16); color: var(--green); font-size: .74rem; font-weight: 800; vertical-align: 2px; }
.coach-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin: 0; padding: 0; }
.coach-steps li { min-width: 0; }
.cs-btn, .cs-plain { width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; min-height: 40px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: var(--font); font-size: .82rem; line-height: 1.3; }
.cs-btn { cursor: pointer; transition: border-color .15s, background .15s; }
.cs-btn:hover { border-color: rgba(250,204,21,.6); }
.cs-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cs-tick { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; color: var(--text-dim); }
.coach-steps li.ok .cs-btn, .coach-steps li.ok .cs-plain { color: var(--text-dim); border-color: rgba(61,220,132,.28); }
.coach-steps li.ok .cs-tick { background: var(--green); border-color: var(--green); color: #0b1a10; }
.coach-steps li.next .cs-btn, .coach-steps li.next .cs-plain { border-color: var(--accent); background: rgba(250,204,21,.07); }
.coach-steps li.next .cs-tick { border-color: var(--accent); color: var(--accent); }
.cs-txt { min-width: 0; }
.scene-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--border); }
.scene-opts[hidden] { display: none; }
.opt-lab { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.scene-opts .pill-row { background: var(--bg); border-radius: 8px; padding: 3px; }
.fault-box { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.prow-note { font-size: .8rem; color: var(--text-dim); line-height: 1.4; }
.fault-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fault-btn { min-height: 40px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: .76rem; font-weight: 600; text-align: left; cursor: pointer; font-family: var(--font); }
.fault-btn:hover { border-color: var(--accent); }
.fault-btn.ok { border-color: var(--green); background: rgba(61,220,132,.16); }
.fault-btn.bad { border-color: var(--red); background: rgba(255,85,85,.16); }
.status-line { font-size: .86rem; line-height: 1.5; color: var(--text); background: var(--bg); border-left: 3px solid var(--accent); border-radius: 8px; padding: 8px 12px; min-height: 38px; margin: 0; }

/* the meter panel */
.meter-panel { position: sticky; top: 12px; background: linear-gradient(180deg, #1c2130, var(--surface)); border: 1px solid var(--border); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 11px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.mp-type { background: var(--bg); border-radius: 9px; padding: 3px; }
.mp-type .pill { min-height: 34px; font-weight: 700; }
.mp-screen { position: relative; background: #0f1114; border-radius: 12px; padding: 8px; border: 1px solid #2a2f3a; box-shadow: inset 0 2px 8px rgba(0,0,0,.6); }
#mp-lcd { display: block; width: 100%; height: auto; aspect-ratio: 300 / 112; border-radius: 6px; }
.mp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mp-sec { display: flex; flex-direction: column; gap: 6px; }
.mp-sec[hidden] { display: none; }
.mp-h { display: flex; align-items: baseline; gap: 8px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }
.mp-h2 { margin-top: 4px; }
.mp-hint { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .7rem; color: #5f6c88; }
.mp-kbd { margin-left: auto; font-family: var(--mono); font-size: .66rem; color: #5f6c88; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.dial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.dial-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 46px; padding: 4px 2px; border-radius: 9px; border: 1px solid #343a4a;
  background: linear-gradient(180deg, #2a303d, #222733); color: var(--text); cursor: pointer; font-family: var(--font); transition: border-color .12s, background .12s, transform .08s; }
.dial-btn b { font-size: .95rem; font-weight: 800; line-height: 1.1; }
.dial-btn small { font-size: .62rem; color: var(--text-dim); white-space: nowrap; }
.dial-btn:hover { border-color: rgba(250,204,21,.6); }
.dial-btn:active { transform: translateY(1px); }
.dial-btn.on { border-color: var(--accent); background: linear-gradient(180deg, rgba(250,204,21,.28), rgba(250,204,21,.12)); box-shadow: 0 0 0 1px var(--accent) inset; }
.dial-btn.on b { color: #fde68a; }
.dial-btn.on small { color: var(--text); }
.dial-btn.off b { font-size: .8rem; color: var(--text-dim); }
.dial-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.vom-rows { display: flex; flex-direction: column; gap: 5px; }
.vom-row { display: flex; align-items: center; gap: 4px; }
.vom-lab { flex: 0 0 40px; font-size: .68rem; font-weight: 800; color: var(--text-dim); }
.vom-lab.vom-acv { color: #ff8a80; } .vom-lab.vom-ohm { color: #8fe3a8; }
.dial-btn.vom { flex: 1 1 0; min-height: 34px; min-width: 0; }
.dial-btn.vom b { font-size: .78rem; }
.dial-btn.vom.off { flex: 0 0 auto; padding: 0 14px; }
.mp-jacks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.mp-jack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 48px; padding: 5px 2px 4px; border-radius: 9px; border: 1px solid #343a4a; background: #1b1f29; color: var(--text); cursor: pointer; font-family: var(--font); }
.mp-jack::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: #090a0c; border: 2.5px solid #7a2530; margin-bottom: 2px; }
.mp-jack b { font-size: .76rem; font-weight: 800; }
.mp-jack small { font-size: .6rem; color: var(--text-dim); }
.mp-jack:hover { border-color: rgba(250,204,21,.6); }
.mp-jack.on { border-color: #e5323a; background: rgba(229,50,58,.14); }
.mp-jack.on::before { background: #e5323a; border-color: #ff9a9a; box-shadow: 0 0 6px rgba(255,90,90,.7); }
.mp-jack.want { border-color: var(--accent); border-style: dashed; animation: mpPulse 1.2s ease-in-out infinite; }
.mp-jack.bad { border-color: var(--red); background: rgba(255,85,85,.2); }
.mp-jack.blown small { color: var(--red); }
.mp-jack.blown small::after { content: ' · fuse blown'; }
.mp-jack:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mp-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.mp-btn { min-height: 34px; border-radius: 8px; border: 1px solid #3a4150; background: linear-gradient(180deg, #3b4150, #2e3340); color: #d9dee6; font-weight: 800; font-size: .7rem; letter-spacing: .03em; cursor: pointer; font-family: var(--font); box-shadow: 0 2px 0 #14171d; }
.mp-btn[data-btn="select"] { color: #fbbf24; }
.mp-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #14171d; }
.mp-btn.on { border-color: var(--accent); color: #fde68a; background: linear-gradient(180deg, #4a4630, #3a3624); }
.mp-btn:disabled { opacity: .35; cursor: default; }
.mp-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#mp-zero { width: 100%; accent-color: var(--accent); }
.mp-probe { display: flex; align-items: center; gap: 8px; }
.mp-pdot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.mp-probe-r .mp-pdot { background: #e5323a; }
.mp-probe-b .mp-pdot { background: #24262b; border: 1.5px solid #d9dee6; }
.mp-plab { flex: 0 0 58px; font-size: .76rem; color: var(--text-dim); font-weight: 600; }
.mp-probe select { flex: 1; min-width: 0; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: var(--font); font-size: .78rem; padding: 0 8px; cursor: pointer; }
.mp-probe select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.mp-prow { display: flex; gap: 6px; }
.mp-small { flex: 1 1 0; min-height: 34px; padding: 5px 8px; font-size: .76rem; }
.fuse-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--red); font-weight: 700; padding: 8px 10px; border-radius: 9px; background: rgba(255,85,85,.1); border: 1px solid rgba(255,85,85,.4); }
.fuse-row[hidden] { display: none; }
.mp-flash { animation: mpFlash 1.6s ease-out; }
@keyframes mpFlash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(250,204,21,.6); } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes mpPulse { 50% { background: rgba(250,204,21,.12); } }

.pill-row { display: flex; flex-wrap: wrap; gap: 3px; }
.pill-row .pill { flex: 1 1 auto; min-height: 32px; padding: 5px 9px; font-size: .78rem; }
.pill.active { color: #1b1606; }
.readout-panel { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.readout-value { font-size: .98rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eq-line { font-size: .9rem; line-height: 1.6; }

/* Explore, Practice, Quiz, article */
.concept-card .cc-desc code { font-family: var(--mono); color: var(--gold); }
.explore-tabs .pill { min-height: 34px; }
.practice-topic { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); flex: 1 1 100%; }
.practice-input-group[hidden] { display: none; }
#mm-prac { display: block; width: min(380px, 100%); aspect-ratio: 380 / 620; margin: 6px auto 10px; border-radius: 14px; }
#mm-prac[hidden] { display: none; }
.prac-tabs { align-self: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.quiz-opt:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.seo-article table { border-collapse: collapse; width: 100%; margin: 10px 0 14px; font-size: .86rem; }
.seo-article th, .seo-article td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; color: var(--text-dim); }
.seo-article th { color: var(--text); background: var(--surface2); }
.seo-article ul { margin: 0 0 12px 20px; color: var(--text-dim); font-size: .92rem; line-height: 1.7; }
.seo-article h4 { font-size: .95rem; color: var(--text); margin: 12px 0 4px; }
.ctx-menu[hidden] { display: none; }
@media (min-width: 900px) {
  #practice-panel.is-analog { display: grid; grid-template-columns: 380px minmax(0, 1fr); column-gap: 18px; align-items: start; }
  #practice-panel.is-analog[style*="none"] { display: none !important; }
  #practice-panel.is-analog > .prac-tabs { grid-column: 1 / -1; }
  #practice-panel.is-analog > #mm-prac { grid-column: 1; grid-row: 2 / span 4; margin: 0; }
  #practice-panel.is-analog > .practice-bar, #practice-panel.is-analog > .solution-panel, #practice-panel.is-analog > .feedback { grid-column: 2; }
}

/* narrower screens: the panel goes under the picture as two columns, the circuits wrap to three */
@media (max-width: 1080px) {
  .scene-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  /* one column: the meter panel straight under the picture, the task card after it */
  .mm-work { grid-template-columns: 1fr; gap: 10px; }
  .mm-stagecol { display: contents; }
  .scene-bar { order: 1; } .canvas-card { order: 2; } .meter-panel { order: 3; } .coach { order: 4; }
  .meter-panel { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .meter-panel > .mp-top, .meter-panel > .mp-screen { grid-column: 1; }
  .meter-panel > .fuse-row { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .mm3d-stage { aspect-ratio: 4 / 3; min-height: 300px; }
  .canvas-toggles > summary { width: 44px; height: 44px; }
}
@media (max-width: 560px) {
  .meter-panel { display: flex; }
  .probe-chips { flex: 1 1 100%; order: -1; }
  .pchip { flex: 1 1 0; min-width: 0; }
  .coach-steps { grid-template-columns: 1fr; }
  .fault-grid { grid-template-columns: 1fr 1fr; }
  .readout-panel { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .scen-btn, .dial-btn, .ct-btn { transition: none; } .mp-jack.want, .mp-flash { animation: none; } }

/* ═══ Phone layout (mobile-ui.js) ═══
   Scoped to body.mm-m, which mobile-ui.js sets only while the screen is ≤ 720 px — none of this can
   reach desktop. The dock is sticky inside #sim-panel, never position:fixed on the page. */
.m-dock, .m-setchip { display: none; }
@media (max-width: 720px) {
  body.mm-m header { padding: 0; }
  body.mm-m header h1 { font-size: 1.15rem; line-height: 1.2; }
  body.mm-m .subtitle { font-size: 0.7rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.mm-m .m-banner { padding: 6px; gap: 6px; flex-direction: column; align-items: stretch; }
  body.mm-m .m-banner .ctrl-label { display: none; }
  body.mm-m .m-banner .ctrl-group { display: block; }
  body.mm-m #mode-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
  body.mm-m #mode-tabs .pill { min-height: 36px; padding: 0 4px; font-size: 0.8rem; font-weight: 700; }
  body.mm-m .m-banner .head-actions { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 6px; margin: 0; width: 100%; }
  body.mm-m .m-banner .head-actions > a, body.mm-m .m-banner .head-actions > button { flex: 1 1 0; min-width: 0; height: 38px; padding: 0 !important; justify-content: center; border-radius: 9px; }
  body.mm-m .m-banner .btn-link .lbl, body.mm-m .m-banner .btn-share-ext { display: none; }
  body.mm-m .m-banner .btn-link img { width: 22px; height: 22px; }
  body.mm-m .m-banner .head-actions > button.btn-link, body.mm-m .m-banner .btn-guide { font-size: 0 !important; display: inline-flex; align-items: center; }
  body.mm-m .m-banner .head-actions > button.btn-link::before { content: '\1F517'; font-size: 17px; }
  body.mm-m .m-banner .btn-guide::before { content: '\1F4D6'; font-size: 17px; }
  body.mm-m .m-setchip { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; margin: 0 0 8px; padding: 0 12px;
    background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; color: var(--text); font: 600 .78rem/1.2 var(--font); cursor: pointer; text-align: left; }
  body.mm-m .m-setchip-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* stage: the picture, the probe chips on it, the readouts under it; the panel and coach go into the sheet */
  body.mm-m .mm-work { gap: 0; }
  body.mm-m .meter-panel, body.mm-m .coach { display: none; }
  body.mm-m .scene-bar { display: none; }
  body.mm-m .canvas-dock { padding: 6px 8px; }
  body.mm-m .canvas-dock .dock-sep { display: none; }
  body.mm-m .canvas-dock .vt-pill { height: 38px; }
  body.mm-m .pchip { min-height: 38px; }
  body.mm-m #readouts { order: 2; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 6px 0 0; }
  body.mm-m #readouts .readout-cell { padding: 5px 6px; min-width: 0; }
  body.mm-m #readouts .readout-label { font-size: .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.mm-m #readouts .readout-value { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* dock */
  body.mm-m .m-dock { display: block; position: sticky; bottom: var(--m-anchor, 0px); z-index: 60; margin-top: 8px; padding: 0 0 env(safe-area-inset-bottom); pointer-events: none; }
  body.mm-m .m-dock > * { pointer-events: auto; }
  body.mm-m .m-chips { margin: 0 0 6px; padding: 5px; background: rgba(18,22,32,0.94); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 12px; }
  body.mm-m .m-chips { display: flex; align-items: center; gap: 6px; }
  body.mm-m .m-chips .probe-chips { display: flex; flex: 1 1 auto; min-width: 0; }
  body.mm-m .m-read { flex: 0 0 auto; min-width: 78px; padding: 0 8px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: #b9c4a3; color: #1c2117; font: 700 .9rem/1 var(--mono); }
  body.mm-m .m-chips .pchip { flex: 1 1 0; min-width: 0; min-height: 40px; justify-content: center; }
  body.mm-m .m-bar { display: flex; gap: 6px; align-items: stretch; margin: 0 0 8px; padding: 6px; background: rgba(18,22,32,0.94); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 -6px 24px rgba(0,0,0,.45); }
  body.mm-m .m-run { flex: 1; display: flex; gap: 6px; min-width: 0; }
  body.mm-m .m-run .btn { flex: 1 1 0; min-width: 0; min-height: 46px; margin: 0; padding: 2px 4px; font-size: .74rem; line-height: 1.15; border-radius: 10px; white-space: normal; background: var(--surface2); color: var(--text); border: 1.5px solid var(--border); font-weight: 700; }
  body.mm-m .m-run .btn-explain { color: #fde68a; border-color: rgba(253,230,138,.45); }
  body.mm-m .m-setup { flex: none; width: 58px; min-height: 46px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface2); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-family: inherit; cursor: pointer; }
  body.mm-m .m-setup-ic { font-size: 1.05rem; line-height: 1; }
  body.mm-m .m-setup-lbl { font-size: 0.6rem; font-weight: 700; letter-spacing: .03em; }
  body.mm-m .m-setup[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #0d1117; }
  body.mm-m .m-sheet { display: flex; flex-direction: column; margin: 0 0 6px; overflow: hidden; background: rgba(22,27,38,0.97); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 -8px 30px rgba(0,0,0,.5); }
  body.mm-m .m-sheet[hidden] { display: none; }
  body.mm-m .m-sheet-tabs { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); }
  body.mm-m .m-sheet-tabs button { min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--text-dim); font-family: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; }
  body.mm-m .m-sheet-tabs button[aria-selected="true"] { background: var(--surface2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
  body.mm-m .m-pane { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
  body.mm-m .m-pane[hidden] { display: none; }
  body.mm-m .m-pane .meter-panel, body.mm-m .m-pane .coach { display: flex; position: static; border: 0; padding: 0; background: none; box-shadow: none; }
  body.mm-m .m-pane .scene-bar { display: grid; grid-template-columns: 1fr 1fr; }
  body.mm-m .m-pane .pill-row .pill, body.mm-m .m-pane .dial-btn, body.mm-m .m-pane .mp-btn { min-height: 40px; }
  body.mm-m .m-pane .mp-probe select { height: 40px; }
  body.mm-m .m-pane .status-line { font-size: .8rem; }
}
