.tm-demo{--tm-border:#8394a8;--tm-on:#b7f1d0;--tm-ink:#173c2b;border:1px solid var(--tm-border);border-radius:12px;padding:clamp(10px,3vw,22px);margin:1.5rem 0;min-width:0;color:inherit;font:inherit}.tm-demo *{box-sizing:border-box}.tm-demo h3,.tm-demo h4{margin:.7rem 0}.tm-controls{display:flex;gap:1rem;flex-wrap:wrap}.tm-controls label{display:flex;flex-direction:column;flex:1 1 130px;gap:.4rem}.tm-controls input{max-width:100%;font:inherit;accent-color:#20835b}.tm-controls input[type=number]{width:100%;padding:.4rem;color:inherit;background:transparent;border:1px solid var(--tm-border);border-radius:5px}.tm-demo button{font:inherit;color:inherit;background:transparent;border:1px solid var(--tm-border);padding:.45rem .7rem;border-radius:6px;margin:.3rem .3rem 0 0;cursor:pointer}.tm-demo :focus-visible{outline:3px solid #3688cf;outline-offset:3px}.tm-scroll{overflow-x:auto}.tm-demo table{border-collapse:collapse;width:100%;font-size:.85em;margin:.6rem 0}.tm-demo td,.tm-demo th{padding:.35rem;border:1px solid var(--tm-border);text-align:center;white-space:nowrap}.tm-demo code{font-family:ui-monospace,monospace;font-size:.95em}.tm-demo .tm-on{background:var(--tm-on);color:var(--tm-ink);font-weight:700}.tm-bits{display:grid;grid-template-columns:repeat(16,minmax(0,1fr));gap:2px;font-family:monospace}.tm-bit{border:1px solid var(--tm-border);text-align:center;padding:.4em 0;border-radius:3px;font-size:clamp(10px,3vw,17px)}.tm-gate{display:flex;align-items:center;justify-content:space-around;gap:.5rem;margin:1rem 0}.tm-gate-box{border:2px solid var(--tm-border);border-radius:5px 25px 25px 5px;padding:1rem .7rem;text-align:center}.tm-result{font-size:1.3rem;font-weight:700;text-align:center}.tm-matrix td{min-width:25px}
html.dark .tm-demo{--tm-border:#94a3b8;--tm-on:#166534;--tm-ink:#ecfdf5}
.tm-demo button,.tm-controls input[type=number]{min-height:44px}
.tm-demo{max-width:100%}
.tm-bits{min-width:0}
