/* Mizan — engineering calculators (uses the brand tokens from style.css) */
.mz { display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .mz { grid-template-columns: 1fr; } }
.mz-side { position: sticky; top: 88px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; max-height: calc(100vh - 110px); overflow: auto; }
@media (max-width: 900px) { .mz-side { position: static; max-height: 360px; } }
.mz-side input[type=search] { width: 100%; margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font: inherit; font-size: 14.5px; color: var(--text); }
.mz-side input[type=search]:focus { outline: 2px solid var(--purple-100); border-color: var(--purple); background: #fff; }
.mz-cat { margin-bottom: 12px; }
.mz-cat-h { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--purple-900); font-size: 14.5px; margin: 4px 0 6px; }
.mz-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.mz-link { display: block; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--text); font-size: 14.5px; text-decoration: none; line-height: 1.5; }
.mz-link:hover { background: var(--purple-50); color: var(--purple); }
.mz-link.active { background: var(--purple); color: #fff; }
.mz-empty { color: var(--muted); font-size: 14px; }
.mz-main { min-width: 0; }
.mz-intro { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 18px; }
.mz-intro h2 { margin: 0 0 6px; }
.mz-intro p { margin: 0; color: var(--muted); }
.mz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.mz-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--text); border-inline-start: 4px solid var(--purple); transition: transform .15s; }
.mz-card:hover { transform: translateY(-2px); }
.mz-card b { color: var(--purple-900); font-size: 16.5px; }
.mz-card span { color: var(--muted); font-size: 14px; }
.mz-tool-h { margin-bottom: 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.mz-print { flex: none; }
.mz-tool-h h2 { margin: 0 0 4px; font-size: clamp(22px, 3vw, 28px); }
.mz-tool-h p { margin: 0; color: var(--muted); }
.mz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .mz-grid { grid-template-columns: 1fr; } }
.mz-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.mz-box h3 { margin: 0 0 12px; font-size: 17px; color: var(--purple-900); }
.mz-box-res { border-top: 4px solid var(--gold); }
.mz-form { display: grid; gap: 12px; }
.mz-field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.mz-field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.mz-field select, .mz-field input { width: 100%; }
.mz-in { display: flex; gap: 8px; }
.mz-in input { flex: 1; min-width: 0; text-align: left; }
.mz-in .mz-unit { width: auto; flex: none; max-width: 48%; }
.mz-u { align-self: center; color: var(--muted); font-size: 13.5px; white-space: nowrap; padding-inline: 4px; }
.mz-reset { margin-top: 14px; }
.mz-rows { display: grid; gap: 2px; }
.mz-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); }
.mz-row:nth-child(odd) { background: var(--bg); }
.mz-row.main { background: var(--purple-50); outline: 1px solid var(--purple-100); }
.mz-row.main .mz-v { color: var(--purple); font-size: 19px; }
.mz-k { font-size: 14.5px; }
.mz-v { font-weight: 800; display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mz-v .mz-unit { font-weight: 400; font-size: 13px; padding: 2px 6px; min-height: 0; height: auto; width: auto; }
.mz-warn { margin-top: 10px; background: var(--gold-soft); color: #7a5520; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; line-height: 1.7; }
.mz-err { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14.5px; }
.mz-ref { margin-top: 18px; }
.mz-eq { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; font-family: Consolas, 'Courier New', monospace; font-size: 13.5px; line-height: 1.8; text-align: left; margin-bottom: 16px; overflow-wrap: anywhere; }
.mz-ref ol { margin: 0 0 12px; padding-left: 22px; padding-right: 0; text-align: left; font-size: 13.5px; line-height: 1.8; color: var(--text); }
.mz-disc { margin: 0; font-size: 13px; color: var(--muted); }
.mz-badge { display: inline-flex; align-items: center; gap: 6px; }
/* result tables (curves, dip charts, flash compositions) */
.mz-tbl-wrap { margin-top: 12px; overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mz-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mz-tbl th { position: sticky; top: 0; background: var(--purple-50); color: var(--purple-900); font-weight: 800; padding: 8px 10px; text-align: left; white-space: nowrap; }
.mz-tbl td { padding: 6px 10px; border-top: 1px solid var(--line); text-align: left; }
.mz-tbl tbody tr:nth-child(even) td { background: var(--bg); }
/* print / save as PDF: only the calculation */
@media print {
  .site-header, .site-footer, .page-head, .mz-side, .mz-reset, .mz-print, .sr-only { display: none !important; }
  .mz { display: block; } .section { padding: 0 !important; }
  .mz-grid { grid-template-columns: 1fr 1fr; }
  .mz-box, .mz-intro { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .mz-tbl-wrap { max-height: none; overflow: visible; }
  .mz-unit { border: 0; appearance: none; -webkit-appearance: none; background: none; padding: 0; }
  body { background: #fff; }
}

/* ===== illustrated view (calc-viz.js): equipment drawing + values placed on it ===== */
.mz-view { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; flex: none; }
.mz-view button { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.mz-view button.on { background: var(--surface); color: var(--purple); box-shadow: var(--shadow); }
.mz-tool-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mz-viz-box { padding: 14px; margin-bottom: 18px; }
.mzv-stage { position: relative; aspect-ratio: 800 / 450; border-radius: 14px; background: linear-gradient(180deg, #FBFAFE, #F2EFFA); container-type: inline-size; }
.mzv-art, .mzv-art svg { width: 100%; height: 100%; display: block; }
.mzv-tag { position: absolute; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))); z-index: 2; background: rgba(255, 255, 255, .95); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px 5px; box-shadow: 0 4px 14px rgba(30, 24, 56, .1); font-size: clamp(10px, 1.45cqw, 12px); line-height: 1.3; max-width: 23cqw; display: flex; gap: 6px; align-items: flex-start; }
.mzv-tag .n, .mzv-item .n { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--purple); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
.mzv-tag .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mzv-tag small { color: var(--muted); font-size: .95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 20cqw; display: block; }
.mzv-tag .ctl, .mzv-item .ctl { display: flex; gap: 4px; align-items: center; }
.mzv-tag input, .mzv-tag select { font: inherit; font-size: 1.08em; font-weight: 700; padding: 1px 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); width: 6.6em; min-height: 0; height: 2.1em; }
.mzv-tag select { width: auto; max-width: 17cqw; }
.mzv-tag em, .mzv-item em { font-style: normal; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.mzv-tag.out { flex-direction: column; gap: 0; background: #3D2D74; border-color: #3D2D74; color: #fff; }
.mzv-tag.out small { color: rgba(255, 255, 255, .75); }
.mzv-tag.out b { font-size: 1.16em; white-space: nowrap; }
.mzv-tag.out.main { background: var(--gold); border-color: var(--gold); color: #2B1F54; }
.mzv-tag.out.main small { color: rgba(43, 31, 84, .75); }
.mzv-ribbon { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mzv-res { background: var(--purple-50); border-radius: 10px; padding: 6px 12px; display: flex; flex-direction: column; }
.mzv-res small { color: var(--muted); font-size: 12px; } .mzv-res b { color: var(--purple); font-size: 16px; }
.mzv-warn p { margin: 10px 0 0; background: var(--gold-soft); color: #7a5520; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13.5px; line-height: 1.7; }
.mzv-warn p.bad { background: var(--bad-soft); color: var(--bad); }
.mz-viz-box .err .mzv-art { opacity: .35; }
.mzv-more { margin-top: 12px; }
.mzv-more summary { cursor: pointer; font-weight: 700; color: var(--purple-900); font-size: 14px; }
.mzv-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 10px; }
.mzv-item { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.mzv-item small { flex: 1 1 calc(100% - 34px); font-size: 12.5px; color: var(--muted); }
.mzv-item input, .mzv-item select { font: inherit; font-size: 13.5px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 120px; }
.mzv-item select { width: 100%; }
.mzv-item.placed { display: none; }
@media (max-width: 760px) {
  .mzv-tag.in { padding: 0; border-radius: 50%; border: 0; background: none; box-shadow: none; }
  .mzv-tag.in .body { display: none; }
  .mzv-tag.out { padding: 2px 6px; } .mzv-tag.out small { display: none; } .mzv-tag.out b { font-size: 11.5px; }
  .mzv-item.placed { display: flex; }
}
/* motion: speeds and sizes come from CSS variables set by each scene */
.mzv-flow { fill: none; stroke: #fff; stroke-width: 3; stroke-dasharray: 10 14; stroke-linecap: round; opacity: .9; animation: mzv-dash var(--fd, 2s) linear infinite; }
.mzv-flow.rev { animation-direction: reverse; }
.mzv-flow.hot, .mzv-flow.cold { stroke-width: 7; stroke-dasharray: 16 10; opacity: 1; }
.mzv-flow.air { stroke: #9FC9EE; stroke-dasharray: 6 18; opacity: .8; animation-direction: reverse; }
.mzv-flow.heat { stroke: #E0533F; stroke-width: 4; }
.mzv-flow.steamc { stroke: #9AA0B0; stroke-width: 12; stroke-dasharray: 18 10; }
.mzv-flow.n2 { stroke: #2F7FD1; stroke-width: 5; }
.mzv-flow.wire { stroke: #CDA061; stroke-width: 4; }
@keyframes mzv-dash { to { stroke-dashoffset: -48; } }
.mzv-spin { animation: mzv-rot var(--rd, 1.5s) linear infinite; }
.mzv-spin.b { animation-duration: var(--rd2, 1.5s); }
@keyframes mzv-rot { to { transform: rotate(360deg); } }
.mzv-fall { animation: mzv-fall var(--fall, 2s) linear infinite; }
@keyframes mzv-fall { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateY(var(--dy, 100px)); opacity: 0; } }
.mzv-slide { animation: mzv-slide var(--fd2, var(--fd, 2s)) linear infinite; }
@keyframes mzv-slide { from { transform: translateX(-40px); } to { transform: translateX(700px); } }
.mzv-drift { animation: mzv-slide var(--fall, 2s) linear infinite; }
.mzv-wave { animation: mzv-wave 2.4s linear infinite; }
@keyframes mzv-wave { to { transform: translateX(40px); } }
.mzv-pulse { transform-box: fill-box; transform-origin: center; animation: mzv-pulse 1.4s ease-in-out infinite; }
@keyframes mzv-pulse { 50% { transform: scale(1.25); opacity: .7; } }
.mzv-wavefront { opacity: var(--wo, .6); animation: mzv-front var(--wd, 2s) linear infinite; }
@keyframes mzv-front { from { transform: translateX(0); } to { transform: translateX(var(--dx, -500px)); } }
.mzv-push { animation: mzv-push 1.6s ease-in-out infinite; }
@keyframes mzv-push { 50% { opacity: .35; } }
.mzv-ripple { transform-box: fill-box; transform-origin: center; animation: mzv-ripple 3s linear infinite; }
@keyframes mzv-ripple { from { transform: scale(1); } to { transform: scale(1.7); opacity: 0; } }
.mzv-steam { animation: mzv-steam 2.2s ease-in-out infinite; }
@keyframes mzv-steam { 0% { transform: translateY(8px); opacity: 0; } 40% { opacity: .9; } 100% { transform: translateY(-14px); opacity: 0; } }
.mzv-flame { animation: mzv-flick .45s ease-in-out infinite alternate; }
@keyframes mzv-flick { from { transform: scaleY(.9) scaleX(1.03); } to { transform: scaleY(1.08) scaleX(.96); } }
.mzv-disc { animation: mzv-disc var(--rd, 1s) linear infinite; }
@keyframes mzv-disc { 50% { transform: scaleX(.1); } }
.mzv-breathe { animation: mzv-push var(--bd, 2s) ease-in-out infinite; }
.mzv-sun { transform-box: fill-box; transform-origin: center; animation: mzv-rot 24s linear infinite; }
.mzv-jit { animation: mzv-jit var(--jd, 1.2s) ease-in-out infinite alternate; }
@keyframes mzv-jit { to { transform: translate(4px, -5px); } }
.mzv-decay { animation: mzv-decay var(--dd, 4s) ease-out infinite; }
@keyframes mzv-decay { from { transform: rotate(110deg); } to { transform: rotate(-110deg); } }
.mzv-shake { animation: mzv-shake .16s linear infinite alternate; }
@keyframes mzv-shake { from { transform: translateX(calc(var(--sk, 1px) * -1)); } to { transform: translateX(var(--sk, 1px)); } }
.mzv-vortex { animation: mzv-vortex var(--vd, .6s) linear infinite; }
@keyframes mzv-vortex { from { transform: translateX(0); opacity: .9; } to { transform: translateX(70px); opacity: .1; } }
.mzv-blink { animation: mzv-push 1.5s steps(2) infinite; }
.mzv-plume { transform-box: fill-box; transform-origin: left center; animation: mzv-plume .7s ease-in-out infinite alternate; }
@keyframes mzv-plume { to { transform: scale(1.15); opacity: .55; } }
.mzv-draw { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: mzv-drawk 2.4s ease-out forwards; }
@keyframes mzv-drawk { to { stroke-dashoffset: 0; } }
.mzv-frost { animation: mzv-push 2s ease-in-out infinite; }
.mzv-needle, .mzv-grow { transition: transform .6s ease; }
.mzv-lvl { transition: y .5s ease, height .5s ease; }
@media (prefers-reduced-motion: reduce) { .mzv-svg * { animation: none !important; transition: none !important; } }
@media print { .mz-view { display: none; } .mzv-tag input, .mzv-tag select { border: 0; } }
