/* Molecule Mixer: the mixing bar (left: a lit counter under a back-bar shelf) and the order ticket + questions (right),
 * inside the practice shell's stage. The bar is a picture: it keeps its dark wall and warm counter in both themes;
 * the white model cards and the side panel use --tlg-* tokens so dark mode works. */
.mm { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; padding: 10px 12px; color: var(--tlg-text); --mm-accent: #7a2e5c; }
.mm-bench { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 16px; padding: 10px 14px 14px;
  background: linear-gradient(180deg, rgba(255, 210, 140, .10), rgba(255, 210, 140, 0) 40%), radial-gradient(120% 60% at 50% 0%, #3b2d55 0%, #241c36 60%, #1b1528 100%);
  box-shadow: inset 0 0 0 2px #120d1c, 0 2px 6px rgba(0, 0, 0, .3); }
.mm-bench::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: linear-gradient(180deg, #e9dccb, #b79a7a); box-shadow: 0 -2px 0 #fff4e0; pointer-events: none; }
.mm-side { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }

/* ticket */
.mm-ticket { flex: none; padding: 6px 14px 8px; border-radius: 12px; background: #fff8ec; color: #2b2015; border: 2px solid #c79a5a;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .12); background-image: radial-gradient(circle at 8px 50%, transparent 5px, transparent 6px); }
.mm-ticket p { margin: 0; }
.mm-ticket-k { font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8a3f1f; }
.mm-ticket-f { font-size: 30px; font-weight: 800; line-height: 1.15; }
.mm-ticket-n { font-size: 18px; font-weight: 700; }
.mm-ticket-s { font-size: 16px; line-height: 1.3; margin-top: 2px !important; }
.mm-en { display: inline-block; margin-right: 10px; white-space: nowrap; }

/* questions */
.mm-q { flex: none; }
.mm-q-h { margin: 0 0 4px; font-size: 16px; font-weight: 800; line-height: 1.25; }
.mm-chips { display: grid; gap: 6px; }
.mm-chips--1 { grid-template-columns: 1fr; }
.mm-chips--2 { grid-template-columns: 1fr 1fr; }
.mm-chips--3 { grid-template-columns: 1fr 1fr 1fr; }
.mm-chip { position: relative; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 3px 10px; border-radius: 10px; border: 2px solid var(--tlg-border-strong);
  background: var(--tlg-surface); color: var(--tlg-text); font: inherit; font-size: 16px; font-weight: 600; text-align: left; line-height: 1.2; cursor: pointer; }
.mm-chips--3 .mm-chip { justify-content: center; text-align: center; padding: 3px 4px; }
.mm-chip:hover:not(:disabled) { border-color: var(--mm-accent); }
.mm-chip[aria-checked="true"] { background: var(--mm-accent); border-color: var(--mm-accent); color: #fff; }
.mm-chip[role="checkbox"]::before { content: ''; flex: none; width: 18px; height: 18px; border-radius: 4px; border: 2px solid currentColor; box-sizing: border-box; }
.mm-chip[role="checkbox"][aria-checked="true"]::before { content: '✓'; font-size: 14px; line-height: 14px; text-align: center; font-weight: 900; }
.mm-chip:focus-visible { outline: var(--tlg-focus-width, 3px) solid var(--tlg-focus); outline-offset: 2px; }
.mm-chip:disabled { cursor: default; }
.mm-chip kbd { font: inherit; font-size: 16px; padding: 0 4px; border-radius: 5px; border: 1px solid currentColor; opacity: .75; }
.mm-ficon { flex: none; background: #fff; border-radius: 6px; }
.mm-chip.is-ok { box-shadow: 0 0 0 3px #1f9d55; }
.mm-chip.is-bad { box-shadow: 0 0 0 3px #d03a2f; }
.mm-chip-mark { position: absolute; right: -7px; top: -9px; font-style: normal; font-weight: 900; font-size: 16px; line-height: 22px; width: 22px; height: 22px; border-radius: 50%; text-align: center; }
.mm-chip-mark:empty { display: none; }
.mm-chip.is-ok .mm-chip-mark { color: #fff; background: #1f9d55; }
.mm-chip.is-bad .mm-chip-mark { color: #fff; background: #d03a2f; }
.mm-q--den.is-ok .mm-num { box-shadow: 0 0 0 3px #1f9d55; border-radius: 10px; }
.mm-q--den.is-bad .mm-num { box-shadow: 0 0 0 3px #d03a2f; border-radius: 10px; }
.mm-how { margin: auto 0 0; font-size: 16px; line-height: 1.35; color: var(--tlg-text-muted); }
.mm kbd { font: inherit; font-size: 16px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--tlg-border-strong); background: var(--tlg-surface-2); }
.mm-chip kbd { background: transparent; }
.mm-mini { flex: none; border-radius: 10px; background: #fff; color: #1d2430; --plw-bond: #1d2430; border: 1px solid var(--tlg-border); overflow: hidden; }
.mm-solute-note { margin: 0; font-size: 16px; }

/* cards on the bar */
.mm-paper { position: relative; min-width: 0; min-height: 0; border-radius: 12px; padding: 6px; background: #fbfaf7; color: #1d2430; box-shadow: 0 3px 0 rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .1);
  --plw-bond: #1d2430; --plw-guide: #6b7280; }
.mm-two { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 10px; height: 100%; }
.mm-col { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.mm-lbox, .mm-bondbox { position: relative; }
.mm-lbox .plw { position: absolute; inset: 0; }
.mm-cap { margin: 0; font-size: 16px; font-weight: 800; color: #f6ead6; }
.mm-cap2 { margin: 2px 0 0; font-size: 16px; font-weight: 700; color: #f6ead6; text-align: center; }
.mm-3dbox { position: relative; flex: none; height: 268px; display: flex; flex-direction: column; }
.mm-3dhost { position: relative; flex: 1; min-height: 0; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #ffffff, #e3e9f0); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); overflow: hidden; }
.mm3d, .mm3d-canvas { position: absolute; inset: 0; display: block; }
.mm3d-canvas { cursor: grab; touch-action: none; outline: none; }
.mm3d-canvas:focus-visible { outline: 3px solid var(--tlg-focus); outline-offset: -3px; }
.mm-toggle { position: absolute; right: 6px; top: 26px; z-index: 2; font: inherit; font-size: 16px; font-weight: 700; padding: 4px 10px; min-height: 36px; border-radius: 999px; border: 2px solid var(--mm-accent); background: #fff; color: #1d2430; cursor: pointer; }
.mm-toggle[aria-pressed="true"] { background: var(--mm-accent); color: #fff; }
.mm-toggle:focus-visible { outline: 3px solid var(--tlg-focus); outline-offset: 2px; }
.mm-fieldbox { flex: 1; min-height: 150px; display: flex; flex-direction: column; }
.mmf { position: relative; flex: 1; min-height: 0; border-radius: 12px; background: #f4f6f9; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); overflow: hidden; }
.mmf canvas { position: absolute; inset: 0; display: block; }

/* the dipole layer over a drawing */
.mm-dip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; outline: none; border-radius: 10px; }
.mm-dip:focus-visible { box-shadow: inset 0 0 0 3px var(--tlg-focus); }
.mm-dip svg { position: absolute; left: 0; top: 0; overflow: visible; }
.mm-dip-hit { pointer-events: none; }
.mm-dip-hit .pv-root { pointer-events: auto; }
.mm-dip-hit .pv-a-halo, .mm-dip-hit .pv-a-shaft, .mm-dip-hit .pv-a-head, .mm-dip-hit .pv-a-label, .mm-dip-hit .pv-handle, .mm-dip-hit .pv-net { opacity: 0; }
.mm-dip-hit .pv-anchor-ring { fill: #fff; stroke: var(--mm-accent); stroke-width: 2.5; }
.mm-dip-hit .pv-anchor-dot { fill: var(--mm-accent); }
.mm-dip-hit .pv-anchor { cursor: crosshair; }
.mm-dip-hit .pv-arrow { cursor: grab; }
.mm-dip-draw { pointer-events: none; }
.mm-arrow-halo { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; }
.mm-arrow-shaft { fill: none; stroke: var(--mm-accent); stroke-width: 4; stroke-linecap: round; }
.mm-arrow-head { fill: var(--mm-accent); stroke: #fff; stroke-width: 1.5; }
.mm-arrow.is-ok .mm-arrow-shaft { stroke: #187a43; } .mm-arrow.is-ok .mm-arrow-head { fill: #187a43; }
.mm-arrow.is-bad .mm-arrow-shaft { stroke: #c0392b; } .mm-arrow.is-bad .mm-arrow-head { fill: #c0392b; }
.mm-arrow.is-answer .mm-arrow-shaft { stroke: #187a43; stroke-dasharray: 7 6; opacity: .9; } .mm-arrow.is-answer .mm-arrow-head { fill: #187a43; opacity: .9; }
.mm-dip-sel { fill: none; stroke: var(--tlg-focus, #0e6e68); stroke-width: 3; stroke-dasharray: 5 4; }
.mm-dip-mark circle { stroke: #fff; stroke-width: 2; }
.mm-dip-mark.is-ok circle { fill: #187a43; } .mm-dip-mark.is-bad circle { fill: #c0392b; }
.mm-dip-mark text { fill: #fff; font-size: 16px; font-weight: 900; text-anchor: middle; }

/* bond card */
.mm-bondcard { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.mm-bond-svg { display: block; }
.mm-bondline { stroke: #1d2430; stroke-width: 6; stroke-linecap: round; }
.mm-bondline.is-q { stroke: #6b7280; stroke-dasharray: 3 9; }
.mm-batom-t { font-size: 28px; font-weight: 800; text-anchor: middle; }
.mm-batom-en { font-size: 20px; font-weight: 800; text-anchor: middle; fill: #1d2430; }
.mm-delta { font-size: 24px; font-weight: 900; text-anchor: middle; }
.mm-delta.is-neg { fill: #b3261e; } .mm-delta.is-pos { fill: #1d4fc4; }
.mm-ecloud { fill: rgba(217, 245, 66, .0); stroke: rgba(110, 150, 10, 0); stroke-width: 2; transition: transform 1.4s ease, fill .6s, stroke .6s; transform-box: fill-box; transform-origin: center; }
.mm-bond-svg.is-revealed .mm-ecloud { fill: rgba(217, 245, 66, .38); stroke: rgba(110, 150, 10, .6); }
.mm-bond-svg.is-pull-right .mm-ecloud { transform: translateX(14%) scaleX(.82); }
.mm-bond-svg.is-pull-left .mm-ecloud { transform: translateX(-14%) scaleX(.82); }
.mm-bond-svg.is-ionic.is-pull-right .mm-ecloud { transform: translateX(26%) scaleX(.5); }
.mm-bond-svg.is-ionic.is-pull-left .mm-ecloud { transform: translateX(-26%) scaleX(.5); }
.mm-en-svg { display: block; }
.mm-en-h { font-size: 16px; font-weight: 800; fill: #1d2430; }
.mm-en-axis { stroke: #1d2430; stroke-width: 2; }
.mm-en-tick { font-size: 16px; text-anchor: middle; fill: #3f4754; }
.mm-en-el { font-size: 18px; font-weight: 800; text-anchor: middle; fill: #1d2430; }
.mm-gl { stroke: #fff; stroke-width: 2; }
.mm-gl.is-np { fill: #dfe6ee; } .mm-gl.is-p { fill: #f3d7e6; } .mm-gl.is-i { fill: #f6dfb8; }
.mm-gl-t { font-size: 16px; font-weight: 700; text-anchor: middle; fill: #1d2430; }
.mm-gl-cut { font-size: 16px; text-anchor: middle; fill: #3f4754; }
.mm-gl-mark { opacity: 0; transition: opacity .5s; }
.mm-gl-mark.is-on { opacity: 1; }
.mm-gl-mark path { fill: var(--mm-accent); }
.mm-gl-mark text { font-size: 16px; font-weight: 800; text-anchor: middle; fill: var(--mm-accent); paint-order: stroke; stroke: #fbfaf7; stroke-width: 4px; }

/* forces */
.mm-ions { display: flex; align-items: center; gap: 10px; padding: 8px 10px 4px; font-size: 16px; }
.mm-ion { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 18px; border: 2px solid rgba(0, 0, 0, .45); }
.mm-ion--na { background: #9a7bdc; } .mm-ion--cl { background: #3fae55; }
.mm-lensbox { flex: 1; display: flex; flex-direction: column; align-items: center; min-height: 0; }
.mm-lens { position: relative; width: 232px; height: 232px; flex: none; border-radius: 50%; overflow: hidden; background: #fff;
  box-shadow: 0 0 0 9px #2b2b33, 0 0 0 13px #c9a46a, 0 6px 14px 13px rgba(0, 0, 0, .35); margin-top: 14px; }
.mm-lens::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 40%); pointer-events: none; }
.mmz, .mmz canvas { position: absolute; inset: 0; }
.mm-lensbox .mm-cap2 { margin-top: 16px; }
.mm-hbkey { display: inline-block; width: 28px; vertical-align: middle; border-top: 3px dashed #7fe0a8; margin-right: 4px; }
.mm-lens--wait { display: grid; place-items: center; background: radial-gradient(circle, #f7f9fb, #d9e3ec); }
.mm-lens-wait { margin: 0; padding: 30px; font-size: 16px; font-weight: 700; text-align: center; color: #3f4754; }

/* scenes: shelf, beakers, bottles, mats, flasks */
.mm-shelf { position: relative; height: 64px; margin: -4px -14px 0; overflow: hidden; }
.mm-shelf svg { display: block; }
.mm-scene { position: relative; z-index: 1; height: calc(100% - 64px); display: grid; grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 12px; }
.mm-tray { grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; }
.mm-home { min-height: 130px; display: flex; justify-content: center; align-items: flex-start; }
.mm-token { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: grab; touch-action: none; user-select: none; border-radius: 12px; outline: none; }
.mm-token:focus-visible { box-shadow: 0 0 0 3px var(--tlg-focus); }
.mm-token.is-picked { box-shadow: 0 0 0 3px #ffd27a; }
.mm-bottle { padding: 6px 8px; background: rgba(255, 255, 255, .08); }
.mm-token-t { font-size: 16px; font-weight: 800; color: #fff; text-align: center; max-width: 140px; line-height: 1.15; }
.mm-bottle.is-pour { animation: mm-pour 1.1s ease forwards; }
@keyframes mm-pour { 0% { transform: none; } 40% { transform: translateY(-34px) rotate(-40deg); } 100% { transform: translateY(-30px) rotate(-75deg); opacity: .25; } }
.mm-beakers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: center; padding: 70px 0 30px; grid-row: 1 / span 2; }
.mm-zone { position: relative; display: flex; flex-direction: column; align-items: center; border-radius: 14px; padding: 6px; border: 3px dashed transparent; transition: border-color .15s, background .15s; }
html.pdz-armed .mm-zone { border-color: rgba(255, 210, 122, .7); }
.mm-zone.is-over { border-color: #ffd27a; background: rgba(255, 210, 122, .12); }
.mm-zone.is-ok { border-color: #34c27a; border-style: solid; }
.mm-zone.is-bad { border-color: #ff6b5e; border-style: solid; }
.mm-zone-t { margin: 4px 0 0; font-size: 18px; font-weight: 800; color: #fff; text-align: center; line-height: 1.2; }
.mm-zone-t span { font-weight: 600; opacity: .85; }
.mm-slot { min-height: 0; display: flex; justify-content: center; }
.mm-bzone .mm-slot { position: absolute; top: -8px; left: 0; right: 0; z-index: 2; }
.mm-bzone .mm-token.is-placed .mm-token-t { display: none; }
.mm-bk { position: relative; }
.mm-bk svg { display: block; }
.mm-bk-cry { transition: opacity 2.6s ease 0.4s; }
.mm-bk.is-dissolved .mm-bk-cry { opacity: 0; }
.mm-water { display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.mm-mats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; padding-top: 10px; }
.mm-mat { background: linear-gradient(180deg, #4a3a2a, #362a1f); border: 3px dashed rgba(255, 255, 255, .25); min-height: 150px; justify-content: flex-start; }
.mm-mat .mm-slot { min-height: 0; }
.mm-mat .mm-token.is-placed { transform: scale(.82); }
.mm-mat .mm-token.is-placed .mm-token-t { display: none; }
.mm-mat-ic svg { display: block; }
.mm-lensbox--pop { position: absolute; left: 22px; top: 230px; z-index: 6; flex: none; animation: mm-pop .5s ease; }
.mm-lensbox--pop .mm-cap2 { max-width: 240px; background: rgba(20, 14, 30, .8); border-radius: 8px; padding: 2px 8px; }
.mm--k-dissolve .mm-lensbox--pop { left: 10px; top: 70px; }
.mm--k-dissolve .mm-lens { width: 196px; height: 196px; }
.mm--k-dissolve .mm-scene { grid-template-columns: 200px minmax(0, 1fr); }
.mm--k-dissolve.is-revealed .mm-tray { visibility: hidden; }
@keyframes mm-pop { from { opacity: 0; } to { opacity: 1; } }

/* rank */
.mm--k-rank .mm-scene { grid-template-columns: minmax(0, 1fr) 96px; grid-template-rows: auto 1fr; }
.mm-cards { display: flex; gap: 10px; justify-content: center; padding: 8px 0 4px; min-height: 96px; }
.mm-cards .mm-home { min-height: 82px; min-width: 124px; }
.mm-card { width: 124px; padding: 6px 4px; background: #fff8ec; color: #2b2015; border: 2px solid #c79a5a; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.mm-card-f { font-size: 22px; font-weight: 800; line-height: 1.1; }
.mm-card-n { font-size: 16px; font-weight: 600; text-align: center; line-height: 1.15; }
.mm-plate { grid-column: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 18px; }
.mm-flasks { display: flex; gap: 8px; justify-content: center; align-items: flex-end; }
.mm-fcol { width: 122px; padding: 4px 2px; }
.mm-fcol .mm-slot { min-height: 86px; align-items: flex-end; }
.mm-fcol .mm-card { width: 112px; }
.mm-fl { position: relative; }
.mm-fl svg { display: block; }
.mm-bp { margin: 2px 0 0; min-height: 44px; font-size: 16px; line-height: 1.2; color: #fff; text-align: center; }
.mm-spot-mark { font-weight: 900; }
.mm-fcol.is-ok .mm-spot-mark { color: #34c27a; } .mm-fcol.is-bad .mm-spot-mark { color: #ff6b5e; }
.mm-fcol .mm-zone-t { font-size: 16px; }
.mm-hp { margin-top: -6px; }
.mm-hp svg { display: block; }
.mm-hp .mm-hp-glow { opacity: 0; transition: opacity 1s; }
.mm-hp.is-on .mm-hp-glow { opacity: 1; }
.mm-hp.is-on .mm-hp-led { fill: #ff5a2c; }
.mm-thermo { grid-column: 2; grid-row: 1 / span 2; align-self: end; padding-bottom: 20px; position: relative; }
.mm-thermo svg { display: block; }
.mm-th-t { font-size: 16px; fill: #f6ead6; font-weight: 700; }
.mm-th-liq { transition: none; }
.mm-th-read { position: absolute; left: 0; right: 0; bottom: -2px; margin: 0; font-size: 18px; font-weight: 800; color: #ffd27a; text-align: center; }
.mm-fcol.is-boiling .mm-fl-liq { transition: y 3s ease, height 3s ease; }
.mm-bubbles { position: absolute; left: 12%; right: 12%; bottom: 14px; height: 60%; pointer-events: none; overflow: hidden; }
.mm-bubbles i { position: absolute; bottom: 0; width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .25); opacity: 0; }
.mm-bubbles.is-on i { animation: mm-bub 1.6s ease-in infinite; }
@keyframes mm-bub { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-110px) scale(1.2); opacity: 0; } }
.mm-vapor { position: absolute; left: 30%; right: 30%; top: -18px; height: 34px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 70%); animation: mm-vap 2s ease-out infinite; pointer-events: none; }
@keyframes mm-vap { from { transform: translateY(6px) scale(.6); opacity: .9; } to { transform: translateY(-26px) scale(1.4); opacity: 0; } }

/* boil */
.mm--k-boil .mm-scene { grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1.1fr); grid-template-rows: 1fr; align-items: end; }
.mm-boilrig { display: flex; flex-direction: column; align-items: center; padding-bottom: 16px; }
.mm-bk--boil .mm-bubbles { bottom: 18px; height: 52%; }
.mm-thermo--boil { grid-column: 2; grid-row: 1; padding-bottom: 36px; }
.mm-lensbox--boil { grid-column: 3; align-self: center; flex: none; }

/* Briefing example */
.mm-ex { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.mm-ex-cell { margin: 0; padding: 8px; border-radius: 10px; background: #fbfaf7; color: #1d2430; border: 1px solid var(--tlg-border); display: flex; flex-direction: column; align-items: center; max-width: 300px; }
.mm-ex-cap { font-size: 16px; text-align: center; line-height: 1.35; }

/* the shell's assignment card sits bottom-right of the stage, over the side panel's last line: move it to the foot of
   the customer column (as Free-Body Garage and the Lewis Structure Workshop do) */
@media (min-width: 901px) {
  html.ps-locked:has(.mm) .lga-card { right: auto; left: 12px; }
  html.ps-locked:has(.mm):has(.lga-card) .ps-side { padding-bottom: 84px; }
}
@media (max-width: 900px) {
  .mm { position: static; grid-template-columns: 1fr; }
  .mm-bench { min-height: 600px; }
}
@media (prefers-reduced-motion: reduce) {
  .mm-bubbles i, .mm-vapor, .mm-bottle.is-pour, .mm-lensbox--pop { animation: none !important; }
}

/* AP bond orders: the ΔEN keypad, compact */
.mm-num .pn-key { min-height: 40px; }
.mm-num .pn-input { font-size: 24px; padding: 2px 0; }
.mm-num .pn-label { display: none; }
.mm--k-bond.mm--ap .mm-how { display: none; }
