/* SmartTutorials Courses: the simulation player (sim.js) and its engines (sim/*.js).
   Uses the colours from front.css. Layout is decided by the block's own width (container queries). */

.stc-sim { --stc-sim-dur: 450ms; margin: 1.75rem 0; padding: 1rem; border: 1px solid var(--stc-line); border-radius: var(--stc-radius); background: var(--stc-base); container: stc-sim / inline-size; scroll-margin-top: 1.5rem; }
.stc-sim.is-wide { box-sizing: border-box; max-width: none; position: relative; z-index: 1; box-shadow: 0 6px 24px rgba(17, 24, 39, .06); }
.stc-sim__fallback { margin: .5rem 0 0; padding-left: 1.25rem; color: var(--stc-soft); }
.stc-sim__fallback strong { display: block; color: var(--stc-ink); }
.stc-sim__fallback dl { display: grid; grid-template-columns: auto 1fr; gap: 0 .75rem; margin: .3rem 0 .8rem; font-size: .88rem; }
.stc-sim__fallback dt { font-weight: 700; }
.stc-sim__fallback dd { margin: 0; font-family: var(--stc-mono); }

/* header */
.stc-sim__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.stc-sim__head .stc-card__kicker { margin: 0; flex: 1 1 14rem; }
.stc-sim__tried { padding: .15rem .5rem; border-radius: 6px; background: #eff6ff; color: #1d4ed8; font-size: .75rem; font-weight: 700; }
.stc-sim__count { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stc-soft); font-variant-numeric: tabular-nums; }
.stc-sim__count b { color: var(--stc-ink); }

/* body: stage beside the side panel */
.stc-sim__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem); gap: 1rem; align-items: start; }
.stc-sim__stage { position: relative; min-height: 16rem; padding: 1rem; border-radius: 9px; background: var(--stc-paper); border: 1px solid var(--stc-line); overflow: hidden; }
.stc-sim__stage:focus-visible { outline: 3px solid var(--stc-accent); outline-offset: 2px; }
.stc-sim__side { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.stc-sim__tabs { align-self: flex-start; }
.stc-sim__now[hidden], .stc-sim__list[hidden], .stc-sim__all[hidden], .stc-sim__fields[hidden], .stc-sim__ask[hidden], .stc-sim__verdict[hidden], .stc-sim__score[hidden], .stc-sim__try[hidden], .stc-sim__tried[hidden], .stc-sim__text[hidden] { display: none; }
.stc-sim__title { margin: 0 0 .3rem; font-size: 1.05rem; line-height: 1.3; }
.stc-sim__text { margin: 0; font-size: .95rem; line-height: 1.55; }
.stc-sim__score { margin: .6rem 0 0; padding: .45rem .65rem; border-radius: 8px; background: var(--stc-ok-bg); color: var(--stc-ok); font-weight: 700; font-size: .9rem; }

.stc-sim__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--stc-line); }
.stc-sim__list.is-long { max-height: 22rem; overflow-y: auto; }
.stc-sim__item { display: grid; grid-template-columns: 2rem minmax(0, 1fr) 1rem; align-items: baseline; gap: .4rem; width: 100%; padding: .35rem .4rem; border: 0; border-bottom: 1px solid var(--stc-line); background: transparent; font: inherit; font-size: .88rem; text-align: left; color: var(--stc-soft); cursor: pointer; }
.stc-sim__item:hover { background: var(--stc-paper); color: var(--stc-ink); }
.stc-sim__item:focus-visible { outline: 3px solid var(--stc-accent); outline-offset: -3px; }
.stc-sim__num { font-family: var(--stc-mono); font-size: .78rem; font-weight: 700; }
.stc-sim__tick { visibility: hidden; color: var(--stc-ok); font-weight: 700; }
.stc-sim__item.is-past { color: var(--stc-ink); }
.stc-sim__item.is-past .stc-sim__tick { visibility: visible; }
.stc-sim__item.is-on { background: var(--stc-sand); color: var(--stc-ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--stc-accent); }
.stc-sim__item.is-on .stc-sim__num { color: var(--stc-brand); }

.stc-sim__fields { width: 100%; border-collapse: collapse; font-size: .85rem; }
.stc-sim__fields th, .stc-sim__fields td { padding: .3rem .45rem; border-bottom: 1px solid var(--stc-line); text-align: left; vertical-align: top; }
.stc-sim__fields th { width: 42%; font-weight: 700; color: var(--stc-soft); }
.stc-sim__fields td { font-family: var(--stc-mono); font-size: .8rem; color: var(--stc-ink); overflow-wrap: anywhere; }
.stc-sim__fields tr.is-flash td { animation: stc-sim-flash 1.2s ease-out; }
@keyframes stc-sim-flash { 0% { background: #fed7aa; } 100% { background: transparent; } }

.stc-sim__all { margin: 0; padding-left: 1.4rem; max-height: 30rem; overflow-y: auto; font-size: .9rem; }
.stc-sim__all li { margin-bottom: .6rem; }
.stc-sim__all p { margin: .1rem 0 0; color: var(--stc-soft); }

/* predict */
.stc-sim__ask { margin-top: .5rem; padding: .75rem .85rem; border: 2px solid #93c5fd; border-radius: 10px; background: #eff6ff; }
.stc-sim__askhead { margin: 0 0 .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #1d4ed8; }
.stc-sim__askq { margin: 0 0 .55rem; font-weight: 600; }
.stc-sim__opts { display: grid; gap: .4rem; }
.stc-sim__opt { padding: .5rem .7rem; border: 1px solid var(--stc-line); border-radius: 8px; background: var(--stc-base); font: inherit; font-size: .9rem; text-align: left; color: var(--stc-ink); cursor: pointer; }
.stc-sim__opt:hover { border-color: #2563eb; }
.stc-sim__opt:focus-visible, .stc-sim__skip:focus-visible { outline: 3px solid var(--stc-accent); outline-offset: 1px; }
.stc-sim__skip { margin-top: .5rem; padding: 0; border: 0; background: none; font: inherit; font-size: .82rem; color: var(--stc-soft); text-decoration: underline; cursor: pointer; }
.stc-sim__verdict { margin: .2rem 0 .5rem; padding: .5rem .65rem; border-radius: 8px; font-size: .88rem; }
.stc-sim__verdict p { margin: 0; }
.stc-sim__verdict p + p { margin-top: .25rem; }
.stc-sim__verdict.is-ok { background: var(--stc-ok-bg); color: #14532d; }
.stc-sim__verdict.is-no { background: var(--stc-err-bg); color: #7f1d1d; }
.stc-sim__vhead { font-weight: 700; }

/* transport */
.stc-sim__transport { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--stc-line); background: var(--stc-base); }
.stc-sim__play, .stc-sim__icon { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 1px solid var(--stc-line); border-radius: 50%; background: var(--stc-base); font: inherit; font-size: 1rem; font-weight: 700; color: var(--stc-ink); cursor: pointer; }
.stc-sim__play { width: 2.75rem; height: 2.75rem; border-color: var(--stc-brand); background: var(--stc-brand); color: #fff; font-size: .95rem; }
.stc-sim__play:hover { background: var(--stc-brand-dark); }
.stc-sim__icon:hover { border-color: var(--stc-accent); }
.stc-sim__play:focus-visible, .stc-sim__icon:focus-visible, .stc-sim__toggle:focus-visible, .stc-sim__seg:focus-visible, .stc-sim__speed:focus-visible { outline: 3px solid var(--stc-accent); outline-offset: 2px; }
.stc-sim__icon[disabled] { opacity: .35; cursor: default; }
.stc-sim__track { display: flex; flex: 1 1 8rem; gap: 3px; min-width: 6rem; }
.stc-sim__seg { flex: 1; min-width: 4px; height: 10px; padding: 0; border: 0; border-radius: 3px; background: var(--stc-line); cursor: pointer; }
.stc-sim__seg.is-past { background: #fdba74; }
.stc-sim__seg.is-on { background: var(--stc-accent); }
.stc-sim__speed { padding: .4rem .35rem; border: 1px solid var(--stc-line); border-radius: 8px; background: var(--stc-base); font: inherit; font-size: .85rem; }
.stc-sim__toggle { padding: .4rem .7rem; border: 1px solid var(--stc-line); border-radius: 9px; background: var(--stc-paper); font: inherit; font-size: .85rem; font-weight: 700; color: var(--stc-soft); cursor: pointer; }
.stc-sim__toggle[aria-pressed="true"] { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.stc-sim__trybtn { border-color: var(--stc-accent); background: var(--stc-sand); color: var(--stc-brand-dark); }
.stc-sim__trybtn[aria-expanded="true"] { background: var(--stc-accent); color: var(--stc-ink); }

/* Try it */
.stc-sim__try { margin-top: .75rem; padding: .85rem 1rem; border: 2px dashed var(--stc-accent); border-radius: 10px; }
.stc-sim__form { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-start; }
.stc-sim__frow { display: flex; flex-direction: column; gap: .25rem; min-width: 12rem; flex: 1 1 14rem; }
.stc-sim__frow label { font-size: .85rem; font-weight: 700; }
.stc-sim__frow :is(select, input, textarea) { padding: .45rem .5rem; border: 1px solid var(--stc-line); border-radius: 8px; background: var(--stc-base); font: inherit; font-size: .9rem; color: var(--stc-ink); }
.stc-sim__frow textarea { font-family: var(--stc-mono); font-size: .85rem; }
.stc-sim__frow [aria-invalid="true"] { border-color: var(--stc-err); box-shadow: 0 0 0 2px var(--stc-err-bg); }
.stc-sim__fhelp { margin: 0; font-size: .78rem; color: var(--stc-soft); }
.stc-sim__ferr { margin: 0; font-size: .82rem; font-weight: 700; color: var(--stc-err); }
.stc-sim__ferr[hidden] { display: none; }
.stc-sim__factions { align-self: flex-end; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.stc-sim__reset { border-color: var(--stc-line); }

.stc-sim__frow.is-wide { flex-basis: 100%; }

/* compare: two runs of the same input, one pane each */
.stc-sim.is-compare .stc-sim__stage { display: grid; gap: .75rem; }
.stc-sim__pane { min-width: 0; }
.stc-sim__pane + .stc-sim__pane { padding-top: .7rem; border-top: 1px dashed var(--stc-line); }
.stc-sim__plabel { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; margin: 0 0 .45rem; font-size: .8rem; }
.stc-sim__pname { padding: .1rem .5rem; border-radius: 6px; background: var(--stc-ink); color: #fff; font-weight: 700; }
.stc-sim__pane + .stc-sim__pane .stc-sim__pname { background: #1e40af; }
.stc-sim__pat { color: var(--stc-soft); }
.stc-sim__sum { margin-top: .75rem; padding: .6rem .8rem; border-radius: 9px; background: var(--stc-sand); border: 1px solid #fcd34d; }
.stc-sim__sumhead { margin: 0 0 .15rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stc-brand-dark); }
.stc-sim__sumline { margin: 0; font-size: .88rem; font-variant-numeric: tabular-nums; }
.stc-sim__sumline.is-main { font-size: 1rem; font-weight: 700; }

/* goal: a challenge for Try it */
.stc-sim__goal { margin: 0 0 .75rem; padding: .6rem .8rem; border: 2px solid #93c5fd; border-radius: 10px; background: #eff6ff; transition: background-color var(--stc-sim-dur), border-color var(--stc-sim-dur); }
.stc-sim__goalhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; margin: 0; }
.stc-sim__goalkick { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #1d4ed8; }
.stc-sim__goalexpr { font-family: var(--stc-mono); font-size: .85rem; overflow-wrap: anywhere; }
.stc-sim__goalstate { margin: .25rem 0 0; font-weight: 700; font-size: .92rem; }
.stc-sim__goalvals { margin: .15rem 0 0; font-family: var(--stc-mono); font-size: .78rem; color: var(--stc-soft); overflow-wrap: anywhere; }
.stc-sim__goal.is-reached { border-color: var(--stc-ok); background: var(--stc-ok-bg); }
.stc-sim__goal.is-reached .stc-sim__goalstate { color: var(--stc-ok); }
.stc-sim__goal.is-error .stc-sim__goalstate { color: var(--stc-err); }

/* the Gantt chart helper (STCSim.ui.gantt) */
.stc-gantt { display: flex; flex-direction: column; gap: .3rem; }
.stc-gantt__lane { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); align-items: stretch; gap: .4rem; }
.stc-gantt__lname { align-self: center; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--stc-soft); text-align: right; }
.stc-gantt__track { position: relative; height: calc(2.3rem * var(--rows, 1)); border-radius: 6px; background: var(--stc-base); border: 1px solid var(--stc-line); }
.stc-gantt__lane--io .stc-gantt__track { height: calc(1.35rem * var(--rows, 1)); }
.stc-gantt__blk { position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden; box-sizing: border-box; border-right: 1px solid rgba(17, 24, 39, .35); background: #e5e7eb; color: #111827; font-size: .78rem; font-weight: 700; white-space: nowrap; transition: width var(--stc-sim-dur) linear; }
.stc-gantt__blk[hidden], .stc-gantt__blk.is-tiny .stc-gantt__txt { display: none; }
.stc-gantt__blk.is-idle { background: repeating-linear-gradient(135deg, #f3f4f6 0 5px, #e5e7eb 5px 10px); }
.stc-gantt__blk.is-switch { background: #6b7280; }
.stc-gantt__blk.is-io { opacity: .7; font-size: .68rem; border: 1px dashed rgba(17, 24, 39, .45); }
.stc-gantt__blk.is-now { box-shadow: inset 0 -3px 0 rgba(17, 24, 39, .55); }
.stc-gantt__cursor { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px solid var(--stc-brand); transition: left var(--stc-sim-dur) linear; pointer-events: none; }
.stc-gantt__cursor::before { content: ''; position: absolute; top: -3px; left: -6px; border: 5px solid transparent; border-top-color: var(--stc-brand); }
.stc-gantt__axis .stc-gantt__lname { font-weight: 400; text-transform: none; }
.stc-gantt__ticks { position: relative; height: 1.1rem; border-top: 1px solid var(--stc-line); }
.stc-gantt__tick { position: absolute; top: 0; transform: translateX(-50%); padding-top: .1rem; font-family: var(--stc-mono); font-size: .68rem; color: var(--stc-soft); }
.stc-gantt__tick::before { content: ''; position: absolute; top: -1px; left: 50%; height: 4px; border-left: 1px solid var(--stc-soft); }
.stc-gantt.is-instant .stc-gantt__blk, .stc-gantt.is-instant .stc-gantt__cursor { transition: none; }

/* one column when the block is narrow; the transport stays reachable at the bottom of the screen */
@container stc-sim (max-width: 760px) {
	.stc-sim__body { grid-template-columns: minmax(0, 1fr); }
	.stc-sim__transport { position: sticky; bottom: 0; z-index: 3; margin: .9rem -1rem -1rem; padding: .6rem 1rem; border-radius: 0 0 var(--stc-radius) var(--stc-radius); box-shadow: 0 -6px 14px rgba(17, 24, 39, .06); }
	.stc-sim__list, .stc-sim__list.is-long { max-height: 10.5rem; overflow-y: auto; }
}
@container stc-sim (max-width: 460px) {
	.stc-sim__stage { padding: .65rem; }
	.stc-sim__speed { order: 9; }
	.stc-sim__track { flex-basis: 100%; order: -1; }
}

@media (prefers-reduced-motion: reduce) {
	.stc-sim *, .stc-sim *::before, .stc-sim *::after { transition: none !important; animation: none !important; }
}

/* shared engine bits */
.stc-sim .is-flash { animation: stc-sim-ring 1s ease-out; }
@keyframes stc-sim-ring { 0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, .75); } 100% { box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); } }

/* ---------- engine: layers ---------- */
.stc-ly { position: relative; display: flex; flex-direction: column; gap: .5rem; padding-right: 7.5rem; }
.stc-ly__zone { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: 1.4rem .5rem .5rem; border-radius: 10px; border: 1px dashed var(--stc-line); }
.stc-ly__zone--user { background: var(--stc-base); }
.stc-ly__zone--kernel { background: #fff7ed; border-color: #fdba74; }
.stc-ly__zone--hardware { background: #f1efe9; }
.stc-ly__zonelabel { position: absolute; top: .3rem; left: .65rem; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stc-soft); }
.stc-ly__zone--kernel .stc-ly__zonelabel { color: var(--stc-brand); }
.stc-ly__band { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2.3rem; padding: .35rem .75rem; border: 2px solid var(--stc-line); border-radius: 8px; background: var(--stc-base); font-weight: 600; transition: border-color var(--stc-sim-dur), background-color var(--stc-sim-dur), color var(--stc-sim-dur); }
.stc-ly__tick { visibility: hidden; color: var(--stc-ok); font-weight: 700; }
.stc-ly__band.is-past { border-color: #fdba74; }
.stc-ly__band.is-past .stc-ly__tick { visibility: visible; }
.stc-ly__band.is-on { border-color: var(--stc-accent); background: var(--stc-sand); box-shadow: 0 0 0 3px rgba(249, 115, 22, .2); }
.stc-ly__token { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; gap: .3rem; max-width: 7rem; padding: .25rem .5rem; border-radius: 999px; background: var(--stc-ink); color: #fff; font-size: .8rem; font-weight: 700; transition: transform var(--stc-sim-dur) cubic-bezier(.2, .8, .2, 1); }
.stc-ly__token[hidden] { display: none; }
.stc-ly__token.no-move { transition: none; }
.stc-ly__token code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--stc-mono); font-size: .78rem; color: #fde68a; }
@container stc-sim (max-width: 460px) { .stc-ly { padding-right: 5.5rem; } .stc-ly__token { max-width: 5.25rem; } }

/* sequence diagram (layers and modes) */
.stc-sq { --n: 3; font-size: .82rem; }
.stc-sq__head { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: .3rem; margin-bottom: .4rem; }
.stc-sq__lane { padding: .3rem .25rem; border-radius: 7px; background: var(--stc-base); border: 1px solid var(--stc-line); font-weight: 700; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.stc-sq__lane--kernel { background: #fff7ed; border-color: #fdba74; color: var(--stc-brand-dark); }
.stc-sq__lane--hardware { background: #f1efe9; }
.stc-sq__body { position: relative; min-height: 6rem; padding: .25rem 0 .5rem; }
.stc-sq__life { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--stc-line); }
.stc-sq__row { position: relative; height: 2.35rem; }
.stc-sq__row.is-new { animation: stc-sq-in var(--stc-sim-dur) ease-out; }
@keyframes stc-sq-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.stc-sq__msg { position: absolute; top: 1.55rem; height: 0; border-top: 2px solid var(--stc-soft); }
.stc-sq__msg.is-down::after, .stc-sq__msg.is-up::after { content: ""; position: absolute; top: -6px; border: 5px solid transparent; z-index: 1; }
.stc-sq__msg.is-down::after { right: 8px; border-left: 8px solid var(--stc-soft); border-right: 0; }
.stc-sq__msg.is-up::after { left: 8px; border-right: 8px solid var(--stc-soft); border-left: 0; }
.stc-sq__label { position: absolute; bottom: .25rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: 16rem; padding: 0 .3rem; background: var(--stc-paper); color: var(--stc-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stc-sq__msg.is-self .stc-sq__label { left: .6rem; transform: none; }
.stc-sq__msg.is-self.is-left .stc-sq__label { left: auto; right: .6rem; }
.stc-sq__dot { position: absolute; top: 1.55rem; width: .7rem; height: .7rem; margin: -.35rem 0 0 -.35rem; border-radius: 50%; background: var(--stc-soft); }
.stc-sq__dot.is-kernel { background: var(--stc-brand); }
.stc-sq__row.is-on .stc-sq__msg { border-top-color: var(--stc-accent); }
.stc-sq__row.is-on .stc-sq__msg::after { border-left-color: var(--stc-accent); border-right-color: var(--stc-accent); }
.stc-sq__row.is-on .stc-sq__msg.is-down::after { border-right-color: transparent; }
.stc-sq__row.is-on .stc-sq__msg.is-up::after { border-left-color: transparent; }
.stc-sq__row.is-on .stc-sq__label { color: var(--stc-ink); font-weight: 700; }
.stc-sq__row.is-on .stc-sq__dot { background: var(--stc-accent); box-shadow: 0 0 0 4px rgba(249, 115, 22, .25); }

/* ---------- engine: cpu ---------- */
.stc-cpu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.stc-cpu__head { margin: 0 0 .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stc-soft); }
.stc-cpu__chip { padding: .75rem; border-radius: 12px; background: var(--stc-ink); color: #fff; }
.stc-cpu__chip .stc-cpu__head { color: #9ca3af; }
.stc-cpu__regs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.stc-cpu__reg { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; padding: .35rem .55rem; border-radius: 7px; background: #1f2937; font-family: var(--stc-mono); }
.stc-cpu__reg--wide { grid-column: 1 / -1; }
.stc-cpu__rn { font-size: .72rem; font-weight: 700; color: #9ca3af; }
.stc-cpu__rv { font-weight: 700; color: #fde68a; }
.stc-cpu__phases { display: flex; gap: .3rem; margin-top: .6rem; }
.stc-cpu__phase { flex: 1; padding: .25rem 0; border-radius: 6px; background: #1f2937; color: #6b7280; font-size: .72rem; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .04em; transition: background-color var(--stc-sim-dur), color var(--stc-sim-dur); }
.stc-cpu__phase.is-on { background: var(--stc-accent); color: var(--stc-ink); }
.stc-cpu__irq { display: flex; align-items: center; gap: .45rem; margin-top: .6rem; font-size: .8rem; color: #d1d5db; }
.stc-cpu__irqdot { width: .75rem; height: .75rem; border-radius: 50%; background: #374151; transition: background-color var(--stc-sim-dur); }
.stc-cpu__irq.is-high .stc-cpu__irqdot { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .3); }
.stc-cpu__irq.is-high { color: #fecaca; font-weight: 700; }
.stc-cpu__saved { margin: .4rem 0 0; font-family: var(--stc-mono); font-size: .8rem; color: #fdba74; }
.stc-cpu__saved:empty { display: none; }
.stc-cpu__side { display: flex; flex-direction: column; gap: .75rem; }
.stc-cpu__mem { display: grid; gap: .25rem; }
.stc-cpu__cell { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); align-items: center; gap: .4rem; padding: .25rem .5rem; border: 2px solid var(--stc-line); border-radius: 7px; background: var(--stc-base); font-family: var(--stc-mono); font-size: .85rem; transition: border-color var(--stc-sim-dur), background-color var(--stc-sim-dur); }
.stc-cpu__addr { font-size: .72rem; font-weight: 700; color: var(--stc-soft); }
.stc-cpu__cell.is-pc { border-color: var(--stc-accent); }
.stc-cpu__cell.is-pc .stc-cpu__addr::after { content: " \25C0"; color: var(--stc-accent); }
.stc-cpu__cell.is-read { background: #eff6ff; }
.stc-cpu__cell.is-write { background: var(--stc-sand); }
.stc-cpu__hand { padding: .65rem .75rem; border: 2px solid #fdba74; border-radius: 10px; background: #fff7ed; }
.stc-cpu__hand[hidden] { display: none; }
.stc-cpu__hand .stc-cpu__head { color: var(--stc-brand); }
.stc-cpu__hlist { margin: 0; padding-left: 1.2rem; font-size: .85rem; color: var(--stc-soft); }
.stc-cpu__hlist .is-past { color: var(--stc-ink); }
.stc-cpu__hlist .is-on { color: var(--stc-ink); font-weight: 700; }
@container stc-sim (max-width: 520px) { .stc-cpu { grid-template-columns: minmax(0, 1fr); } }

/* ---------- engine: modes ---------- */
.stc-md { display: grid; gap: .6rem; }
.stc-md__zone { padding: .6rem .75rem; border: 2px solid var(--stc-line); border-radius: 10px; background: var(--stc-base); transition: border-color var(--stc-sim-dur), box-shadow var(--stc-sim-dur); }
.stc-md__zone--kernel { background: #fff7ed; border-color: #fed7aa; }
.stc-md__zone.is-on, .stc-md__cpu.is-on { border-color: var(--stc-accent); box-shadow: 0 0 0 3px rgba(249, 115, 22, .2); }
.stc-md__zlabel { margin: 0 0 .4rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stc-soft); }
.stc-md__zone--kernel .stc-md__zlabel { color: var(--stc-brand); }
.stc-md__code { padding: .4rem 0; border-radius: 7px; background: var(--stc-code-bg); font-family: var(--stc-mono); font-size: .8rem; overflow-x: auto; }
.stc-md__ln { padding: 0 .7rem; white-space: pre; color: #9ca3af; }
.stc-md__ln.is-on { color: #fff; background: rgba(249, 115, 22, .22); box-shadow: inset 3px 0 0 var(--stc-accent); }
.stc-md__out { margin: .4rem 0 0; padding: .3rem .6rem; border-radius: 6px; background: #1f2937; color: #86efac; font-family: var(--stc-mono); font-size: .8rem; }
.stc-md__out[hidden] { display: none; }
.stc-md__cpu { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem .75rem; border: 2px solid var(--stc-ink); border-radius: 10px; background: var(--stc-ink); color: #fff; transition: border-color var(--stc-sim-dur), box-shadow var(--stc-sim-dur); }
.stc-md__mode { display: flex; flex-direction: column; align-items: center; min-width: 5.5rem; padding: .3rem .6rem; border-radius: 8px; background: #374151; transition: background-color var(--stc-sim-dur); }
.stc-md__mode strong { font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; }
.stc-md__mode.is-kernel { background: var(--stc-brand); }
.stc-md__modelabel { font-size: .66rem; font-weight: 700; color: #d1d5db; text-transform: uppercase; letter-spacing: .05em; }
.stc-md__regs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; flex: 1 1 14rem; }
.stc-md__reg { display: flex; justify-content: space-between; gap: .4rem; padding: .25rem .5rem; border-radius: 6px; background: #1f2937; font-family: var(--stc-mono); font-size: .8rem; }
.stc-md__rn { color: #9ca3af; font-weight: 700; }
.stc-md__rv { color: #fde68a; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stc-md__table { border-collapse: collapse; font-family: var(--stc-mono); font-size: .8rem; }
.stc-md__table caption { text-align: left; font-family: inherit; font-size: .72rem; font-weight: 700; color: var(--stc-soft); padding-bottom: .2rem; }
.stc-md__table td { padding: .15rem .55rem; border: 1px solid #fed7aa; background: var(--stc-base); transition: background-color var(--stc-sim-dur); }
.stc-md__num { text-align: right; color: var(--stc-soft); }
.stc-md__table tr.is-on td { background: var(--stc-accent); color: var(--stc-ink); font-weight: 700; }
.stc-md__kfn { margin: .45rem 0 0; font-family: var(--stc-mono); font-size: .82rem; font-weight: 700; color: var(--stc-brand-dark); }
.stc-md__kfn[hidden] { display: none; }
.stc-md.is-killed .stc-md__zone--user { opacity: .5; border-style: dashed; }

/* ---------- engine: boot ---------- */
.stc-boot { --pos: 0; --n: 7; position: relative; padding-top: .25rem; }
.stc-boot__track { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; z-index: 1; }
.stc-boot__stage { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; }
.stc-boot__dot { display: grid; place-items: center; width: 2rem; height: 2rem; border: 2px solid var(--stc-line); border-radius: 50%; background: var(--stc-base); font-size: .8rem; font-weight: 700; color: var(--stc-soft); transition: background-color var(--stc-sim-dur), border-color var(--stc-sim-dur), color var(--stc-sim-dur); }
.stc-boot__label { font-size: .78rem; font-weight: 600; line-height: 1.2; color: var(--stc-soft); overflow-wrap: anywhere; }
.stc-boot__stage.is-past .stc-boot__dot { border-color: #fdba74; background: #fff7ed; color: var(--stc-brand); }
.stc-boot__stage.is-on .stc-boot__dot { border-color: var(--stc-accent); background: var(--stc-accent); color: var(--stc-ink); box-shadow: 0 0 0 4px rgba(249, 115, 22, .25); }
.stc-boot__stage.is-on .stc-boot__label { color: var(--stc-ink); font-weight: 700; }
.stc-boot__fill { position: absolute; top: calc(.25rem + 1rem - 2px); left: calc(100% / var(--n) / 2); height: 4px; width: calc((100% - 100% / var(--n)) * var(--pos) / (var(--n) - 1)); border-radius: 2px; background: var(--stc-accent); transition: width var(--stc-sim-dur) cubic-bezier(.2, .8, .2, 1); z-index: 0; }
.stc-boot__fill.no-move { transition: none; }
.stc-boot__card { margin-top: 1.25rem; padding: .85rem 1rem; border-radius: 10px; background: var(--stc-ink); color: #fff; }
.stc-boot__card.is-new { animation: stc-sq-in var(--stc-sim-dur) ease-out; }
.stc-boot__kicker { margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fdba74; }
.stc-boot__who { margin: .15rem 0 0; font-size: 1.3rem; font-weight: 700; }
.stc-boot__facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem 1rem; margin: .75rem 0 0; padding-top: .7rem; border-top: 1px solid #374151; font-size: .88rem; }
.stc-boot__facts dt { color: #9ca3af; font-weight: 700; }
.stc-boot__facts dd { margin: 0; font-family: var(--stc-mono); font-size: .82rem; color: #fde68a; }
@container stc-sim (max-width: 520px) { .stc-boot__label { font-size: .68rem; } .stc-boot__dot { width: 1.6rem; height: 1.6rem; } .stc-boot__fill { top: calc(.25rem + .8rem - 2px); } }

/* ---------- engine: memlayout ---------- */
.stc-ml { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: .9rem; align-items: start; }
.stc-ml__label { margin: 0 0 .4rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stc-soft); }
.stc-ml__src { padding: .4rem 0; border-radius: 7px; background: var(--stc-code-bg); font-family: var(--stc-mono); font-size: .78rem; overflow-x: auto; }
.stc-ml__ln { padding: 0 .7rem; white-space: pre; color: #9ca3af; }
.stc-ml__ln.is-on { color: #fff; background: rgba(249, 115, 22, .22); box-shadow: inset 3px 0 0 var(--stc-accent); }
.stc-ml__map { display: flex; flex-direction: column; gap: .3rem; min-height: 30rem; }
.stc-ml__map > .stc-ml__label { margin-bottom: .1rem; }
.stc-ml__region { padding: .35rem .55rem .45rem; border: 2px solid var(--stc-line); border-radius: 9px; background: var(--stc-base); }
.stc-ml__region--stack { background: #eff6ff; border-color: #bfdbfe; }
.stc-ml__region--heap { background: #f0fdf4; border-color: #bbf7d0; }
.stc-ml__region--data { background: #fffbeb; border-color: #fde68a; }
.stc-ml__region--text { background: #f3f4f6; border-color: #d1d5db; }
.stc-ml__region--gap { flex: 1 1 auto; min-height: 2.2rem; border-style: dashed; background: transparent; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--stc-soft); font-size: .78rem; }
.stc-ml__region--gap .stc-ml__rhead { display: none; }
.stc-ml__rhead { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .25rem; }
.stc-ml__rname { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stc-ml__rnote { font-size: .72rem; color: var(--stc-soft); }
.stc-ml__rnote::before { content: ''; }
.stc-ml__region--stack .stc-ml__rnote::after { content: ' ↓'; font-weight: 700; }
.stc-ml__region--heap .stc-ml__rnote::after { content: ' ↑'; font-weight: 700; }
.stc-ml__items { display: flex; flex-direction: column; gap: .25rem; }
.stc-ml__item { display: flex; justify-content: space-between; gap: .5rem; padding: .2rem .5rem; border-radius: 6px; background: var(--stc-base); border: 1px solid rgba(17, 24, 39, .12); font-family: var(--stc-mono); font-size: .76rem; transition: background-color var(--stc-sim-dur), border-color var(--stc-sim-dur); }
.stc-ml__iaddr { color: var(--stc-soft); }
.stc-ml__item.is-latest { background: var(--stc-accent); border-color: var(--stc-accent); color: var(--stc-ink); font-weight: 700; }
.stc-ml__item.is-latest .stc-ml__iaddr { color: var(--stc-ink); }
.stc-ml__item.is-new { animation: stc-sq-in var(--stc-sim-dur) ease-out; }
@container stc-sim (max-width: 560px) { .stc-ml { grid-template-columns: minmax(0, 1fr); } .stc-ml__map { min-height: 26rem; } }

/* ---------- engine: process ---------- */
.stc-pr { display: flex; flex-direction: column; gap: .5rem; }
.stc-pr__svg { width: 100%; height: auto; max-height: 20rem; }
.stc-pr__box rect { fill: var(--stc-base); stroke: var(--stc-line); stroke-width: 2; transition: fill var(--stc-sim-dur), stroke var(--stc-sim-dur); }
.stc-pr__box.is-on rect { fill: #fff7ed; stroke: var(--stc-accent); }
.stc-pr__box--running.is-on rect { fill: #ffedd5; }
.stc-pr__bname { font-size: 21px; font-weight: 700; fill: var(--stc-ink); }
.stc-pr__edge path { fill: none; stroke: #9ca3af; stroke-width: 2; transition: stroke var(--stc-sim-dur); }
.stc-pr__edge text { font-size: 19px; fill: var(--stc-soft); }
.stc-pr__edge.is-on path { stroke: var(--stc-accent); stroke-width: 3.5; }
.stc-pr__edge.is-on text { fill: var(--stc-brand-dark); font-weight: 700; }
.stc-pr__head { fill: #9ca3af; }
.stc-pr__tok { transition: transform var(--stc-sim-dur) cubic-bezier(.2, .8, .2, 1); }
.stc-pr__tok.no-move { transition: none; }
.stc-pr__tok circle { fill: var(--stc-ink); stroke: var(--stc-base); stroke-width: 2; }
.stc-pr__tok text { fill: #fff; font-size: 14px; font-weight: 700; font-family: var(--stc-mono); }
.stc-pr__tok.is-running circle { fill: var(--stc-brand); }
.stc-pr__legend { margin: 0; font-size: .82rem; color: var(--stc-soft); }
.stc-pr__label { margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stc-soft); }
.stc-pr__tree { overflow-x: auto; padding-bottom: .25rem; }
.stc-pr__kids { margin: 0; padding: 0 0 0 1.4rem; list-style: none; }
.stc-pr__kids--root { padding-left: 0; }
.stc-pr__node { position: relative; margin: .3rem 0; }
.stc-pr__kids:not(.stc-pr__kids--root) > .stc-pr__node::before { content: ''; position: absolute; left: -.95rem; top: 0; bottom: -.3rem; border-left: 2px solid var(--stc-line); }
.stc-pr__kids:not(.stc-pr__kids--root) > .stc-pr__node:last-child::before { bottom: auto; height: 1.15rem; }
.stc-pr__kids:not(.stc-pr__kids--root) > .stc-pr__node::after { content: ''; position: absolute; left: -.95rem; top: 1.15rem; width: .8rem; border-top: 2px solid var(--stc-line); }
.stc-pr__chip { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .55rem; padding: .3rem .65rem; border: 2px solid var(--stc-line); border-radius: 9px; background: var(--stc-base); font-size: .85rem; transition: background-color var(--stc-sim-dur), border-color var(--stc-sim-dur); }
.stc-pr__pid { font-family: var(--stc-mono); font-size: .76rem; color: var(--stc-soft); }
.stc-pr__pname { font-weight: 700; }
.stc-pr__badge { padding: 0 .4rem; border-radius: 5px; background: #e5e7eb; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stc-pr__note { font-size: .74rem; color: var(--stc-soft); font-style: italic; }
.stc-pr__st--running { border-color: var(--stc-accent); background: #fff7ed; }
.stc-pr__st--running .stc-pr__badge { background: var(--stc-accent); color: var(--stc-ink); }
.stc-pr__st--ready .stc-pr__badge { background: #dbeafe; color: #1e40af; }
.stc-pr__st--waiting .stc-pr__badge { background: #fef3c7; color: #92400e; }
.stc-pr__st--terminated { border-style: dashed; border-color: var(--stc-err); background: var(--stc-err-bg); }
.stc-pr__st--terminated .stc-pr__badge { background: var(--stc-err); color: #fff; }
.stc-pr__chip.is-cur { box-shadow: 0 0 0 3px rgba(249, 115, 22, .3); }
.stc-pr__chip.is-new { animation: stc-sq-in var(--stc-sim-dur) ease-out; }
.stc-pr__term { margin: 0; padding: .45rem .7rem; min-height: 2.4rem; border-radius: 7px; background: #1f2937; color: #86efac; font-family: var(--stc-mono); font-size: .8rem; white-space: pre-wrap; }
.stc-pr__term.is-empty { color: #6b7280; }

/* ---------- engine: threads ---------- */
.stc-thr { display: flex; flex-direction: column; gap: .8rem; }
.stc-thr__label { margin: 0 0 .4rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stc-soft); }
.stc-thr__shared { padding: .6rem .7rem; border: 2px solid #fdba74; border-radius: 10px; background: #fff7ed; }
.stc-thr__sgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .4rem; }
.stc-thr__region { display: flex; flex-direction: column; gap: .1rem; padding: .4rem .55rem; border: 2px solid #fed7aa; border-radius: 8px; background: var(--stc-base); font-size: .8rem; transition: border-color var(--stc-sim-dur), box-shadow var(--stc-sim-dur); }
.stc-thr__region span { color: var(--stc-soft); font-size: .74rem; }
.stc-thr__region .stc-thr__val { font-family: var(--stc-mono); font-weight: 700; color: var(--stc-ink); font-size: .82rem; }
.stc-thr__region .stc-thr__val[hidden] { display: none; }
.stc-thr__region.is-on { border-color: var(--stc-accent); box-shadow: 0 0 0 3px rgba(249, 115, 22, .25); }
.stc-thr__own { padding: .6rem .7rem; border: 2px solid var(--stc-line); border-radius: 10px; background: var(--stc-base); }
.stc-thr__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; }
.stc-thr__card { display: flex; flex-direction: column; gap: .35rem; padding: .5rem .6rem; border: 2px solid #bfdbfe; border-radius: 9px; background: #eff6ff; font-size: .82rem; transition: border-color var(--stc-sim-dur), opacity var(--stc-sim-dur), background-color var(--stc-sim-dur); }
.stc-thr__card.is-new { animation: stc-sq-in var(--stc-sim-dur) ease-out; }
.stc-thr__stack { display: flex; justify-content: space-between; gap: .4rem; padding: .25rem .45rem; border-radius: 6px; background: var(--stc-base); font-family: var(--stc-mono); font-size: .76rem; }
.stc-thr__slabel { color: var(--stc-soft); font-weight: 700; }
.stc-thr__regs { display: flex; flex-direction: column; font-family: var(--stc-mono); font-size: .72rem; color: var(--stc-soft); }
.stc-thr__sees { font-size: .74rem; font-weight: 700; color: var(--stc-brand-dark); }
.stc-thr__sees[hidden] { display: none; }
.stc-thr__card.is-writer { border-color: var(--stc-accent); background: #ffedd5; }
.stc-thr__card.is-reader { border-color: #fdba74; }
.stc-thr__card.is-on { border-color: #60a5fa; }
.stc-thr__card.is-dead { opacity: .45; border-style: dashed; }
.stc-thr__card.is-crash { border-color: var(--stc-err); background: var(--stc-err-bg); opacity: 1; }
.stc-thr.is-dead .stc-thr__shared { opacity: .5; border-style: dashed; }

/* ---------- engine: ctxswitch ---------- */
.stc-cs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: .6rem; align-items: start; }
.stc-cs__pcb, .stc-cs__cpu { display: flex; flex-direction: column; gap: .3rem; padding: .55rem .65rem; border: 2px solid var(--stc-line); border-radius: 10px; background: var(--stc-base); transition: border-color var(--stc-sim-dur), box-shadow var(--stc-sim-dur); }
.stc-cs__pcb.is-running { border-color: var(--stc-accent); box-shadow: 0 0 0 3px rgba(249, 115, 22, .2); }
.stc-cs__cpu { border-color: var(--stc-ink); background: var(--stc-ink); color: #fff; }
.stc-cs__cpu.is-kernel { border-color: var(--stc-accent); background: #3b2412; }
.stc-cs__phead, .stc-cs__chead { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; }
.stc-cs__state { padding: 0 .4rem; border-radius: 5px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stc-cs__state--running { background: var(--stc-accent); color: var(--stc-ink); }
.stc-cs__state--ready { background: #dbeafe; color: #1e40af; }
.stc-cs__mode { padding: 0 .4rem; border-radius: 5px; background: #374151; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stc-cs__mode.is-kernel { background: var(--stc-brand); }
.stc-cs__who { margin: 0; font-size: .8rem; color: #fde68a; font-weight: 700; }
.stc-cs__reg { display: flex; justify-content: space-between; gap: .4rem; padding: .2rem .45rem; border-radius: 6px; background: var(--stc-paper); font-family: var(--stc-mono); font-size: .76rem; }
.stc-cs__cpu .stc-cs__reg { background: #1f2937; }
.stc-cs__rn { color: var(--stc-soft); font-weight: 700; }
.stc-cs__cpu .stc-cs__rn { color: #9ca3af; }
.stc-cs__rv { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stc-cs__cpu .stc-cs__rv { color: #fde68a; }
.stc-cs__rv.is-empty { color: #9ca3af; font-weight: 400; }
.stc-cs__pt { margin: .2rem 0 0; padding: .2rem .45rem; border-radius: 6px; background: #374151; font-size: .76rem; }
.stc-cs__kern { grid-column: 1 / -1; margin: 0; font-size: .82rem; font-weight: 700; color: var(--stc-brand-dark); }
.stc-cs__kern[hidden] { display: none; }
@container stc-sim (max-width: 520px) { .stc-cs__reg { font-size: .68rem; padding: .2rem .3rem; } .stc-cs__rv { overflow: visible; text-overflow: clip; } .stc-cs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .stc-cs__cpu { grid-column: 1 / -1; order: -1; } }

/* ---------- engine: scheduler ---------- */
.stc-sch, .stc-schq { display: flex; flex-direction: column; gap: .7rem; }
.stc-sch__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .8rem; }
.stc-sch__clock { font-family: var(--stc-mono); font-size: .95rem; color: var(--stc-soft); }
.stc-sch__clock b { font-size: 1.25rem; color: var(--stc-ink); }
.stc-sch__algo { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stc-brand-dark); }
.stc-sch__procs { display: grid; gap: .3rem; }
.stc-sch__proc { display: grid; grid-template-columns: 3.4rem minmax(3rem, 7rem) minmax(0, 1fr); align-items: center; gap: .5rem; font-size: .8rem; transition: opacity var(--stc-sim-dur); }
.stc-sch__pname { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; }
.stc-sch__pname::before { content: ''; width: .75rem; height: .75rem; border-radius: 3px; background: var(--c); border: 1px solid rgba(17, 24, 39, .35); }
.stc-sch__pbar { position: relative; height: .55rem; border-radius: 4px; background: var(--stc-line); overflow: hidden; }
.stc-sch__pfill { position: absolute; inset: 0 auto 0 0; width: 0; transition: width var(--stc-sim-dur); }
.stc-sch__pst { color: var(--stc-soft); font-variant-numeric: tabular-nums; }
.stc-sch__proc.is-running .stc-sch__pst, .stc-sch__proc.is-switching .stc-sch__pst { color: var(--stc-ink); font-weight: 700; }
.stc-sch__proc.is-new { opacity: .5; }
.stc-sch__proc.is-done .stc-sch__pst { color: var(--stc-ok); }
.stc-sch.is-instant .stc-sch__pfill { transition: none; }
.stc-schq__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem; }
.stc-schq__lane { display: flex; flex-direction: column; gap: .3rem; padding: .45rem .55rem; border: 1px dashed var(--stc-line); border-radius: 9px; background: var(--stc-base); min-width: 0; }
.stc-schq__lane[hidden] { display: none; }
.stc-schq__lname { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stc-soft); }
.stc-schq__slot { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 2.6rem; align-items: center; }
.stc-schq__cpu { border: 2px solid var(--stc-ink); background: var(--stc-paper); }
.stc-schq__cpu.is-switch { border-color: #6b7280; background: #f3f4f6; }
.stc-schq__ready { border-style: solid; }
.stc-schq__ready .stc-schq__card:first-child { box-shadow: 0 0 0 3px rgba(249, 115, 22, .3); }
.stc-schq__empty { font-size: .8rem; color: var(--stc-soft); font-style: italic; }
.stc-schq__empty[hidden] { display: none; }
.stc-schq__card { display: inline-flex; flex-direction: column; gap: .05rem; min-width: 3.6rem; padding: .25rem .5rem; border: 1px solid rgba(17, 24, 39, .3); border-left: 6px solid var(--c); border-radius: 7px; background: var(--stc-base); font-size: .8rem; line-height: 1.25; }
.stc-schq__info { font-size: .7rem; color: var(--stc-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stc-schq__card.is-running { background: var(--c); }
.stc-schq__card.is-running .stc-schq__info { color: var(--stc-ink); }
.stc-schq__card.is-switching { border-style: dashed; }
.stc-schq__card.is-new, .stc-schq__card.is-done { opacity: .6; }

/* ---------- engine: multicore ---------- */
.stc-mc__queues { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem; }
.stc-mc__q { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; padding: .35rem .5rem; border: 1px dashed var(--stc-line); border-radius: 8px; background: var(--stc-base); }
.stc-mc__qname { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stc-soft); }
.stc-mc__slot { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.stc-mc__chip { padding: .1rem .45rem; border: 1px solid rgba(17, 24, 39, .3); border-left: 5px solid var(--c); border-radius: 6px; background: var(--stc-base); font-size: .78rem; font-weight: 700; }
.stc-sim.is-compare .stc-sch__algo { display: none; }
@container stc-sim (max-width: 460px) {
	.stc-sch__proc { grid-template-columns: 2.9rem 2.2rem minmax(0, 1fr); gap: .4rem; font-size: .76rem; }
	.stc-gantt__lane { grid-template-columns: 2.1rem minmax(0, 1fr); gap: .3rem; }
	.stc-gantt__lname { font-size: .62rem; }
}
.stc-mc .stc-gantt__lane { grid-template-columns: 3.1rem minmax(0, 1fr); }
.stc-mc .stc-gantt__lname { white-space: nowrap; }

/* ---------- Module 4: thread cards (STCSim.ui.progs), used by race, atomic, sync and bank ---------- */
.stc-pg { display: flex; flex-direction: column; gap: .7rem; }
.stc-pg__cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .5rem; }
.stc-pg__cell { display: flex; flex-direction: column; gap: .1rem; padding: .45rem .65rem; border: 2px solid #fed7aa; border-radius: 9px; background: #fff7ed; transition: border-color var(--stc-sim-dur), background-color var(--stc-sim-dur); }
.stc-pg__cell.is-held { border-color: var(--stc-accent); background: #ffedd5; }
.stc-pg__cell.is-bad { border-color: var(--stc-err); background: var(--stc-err-bg); }
.stc-pg__cell.is-flash { animation: stc-sim-flash 1.2s ease-out; }
.stc-pg__clabel { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stc-soft); }
.stc-pg__cval { font-family: var(--stc-mono); font-size: 1.25rem; line-height: 1.2; }
.stc-pg__csub { font-size: .74rem; color: var(--stc-soft); }
.stc-pg__csub[hidden] { display: none; }
.stc-pg__slots { display: flex; flex-direction: column; gap: .3rem; }
.stc-pg__slotbox { display: flex; flex-wrap: wrap; gap: .35rem; }
.stc-pg__slot { width: 2.6rem; height: 2.2rem; border: 2px dashed var(--stc-line); border-radius: 7px; background: var(--stc-base); transition: background-color var(--stc-sim-dur); }
.stc-pg__slot.is-full { border: 2px solid #b45309; background: #fbbf24; }
.stc-pg__threads { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem; }
.stc-pg__card { display: flex; flex-direction: column; gap: .35rem; padding: .5rem .6rem; border: 2px solid #bfdbfe; border-radius: 10px; background: #eff6ff; min-width: 0; transition: border-color var(--stc-sim-dur), background-color var(--stc-sim-dur), opacity var(--stc-sim-dur); }
.stc-pg__card.is-run { border-color: #2563eb; background: #dbeafe; }
.stc-pg__card.is-blocked { border-color: #9ca3af; background: #f3f4f6; }
.stc-pg__card.is-spin { border-color: #d97706; background: #fef3c7; }
.stc-pg__card.is-done { opacity: .6; border-style: dashed; }
.stc-pg__card.is-inside { box-shadow: 0 0 0 3px rgba(249, 115, 22, .35); }
.stc-pg__card.is-bad { border-color: var(--stc-err); }
.stc-pg__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .1rem .4rem; }
.stc-pg__name { font-size: .88rem; }
.stc-pg__badge { padding: 0 .4rem; border-radius: 5px; background: var(--stc-base); font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--stc-soft); }
.stc-pg__badge[hidden], .stc-pg__regs[hidden], .stc-pg__note[hidden], .stc-pg__banner[hidden] { display: none; }
.stc-pg__code { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .15rem; }
.stc-pg__code li { padding: .15rem .4rem; border-radius: 5px; border-left: 4px solid transparent; font-size: .78rem; color: var(--stc-soft); }
.stc-pg__code code { font-family: var(--stc-mono); font-size: .78rem; background: none; padding: 0; white-space: pre-wrap; }
.stc-pg__code li.is-past { opacity: .55; }
.stc-pg__code li.is-pc { background: #fde68a; border-left-color: var(--stc-accent); color: var(--stc-ink); font-weight: 700; }
.stc-pg__regs { display: flex; flex-wrap: wrap; gap: .3rem; font-family: var(--stc-mono); font-size: .76rem; }
.stc-pg__reg { padding: .1rem .4rem; border-radius: 5px; background: var(--stc-base); }
.stc-pg__note { margin: 0; font-size: .75rem; color: var(--stc-soft); }
.stc-pg__banner { margin: 0; padding: .45rem .7rem; border-radius: 8px; background: var(--stc-sand); font-size: .88rem; font-weight: 700; }
.stc-pg__banner.is-bad { background: var(--stc-err-bg); color: #7f1d1d; }
.stc-pg__banner.is-good { background: var(--stc-ok-bg); color: #14532d; }

/* race: memory view */
.stc-rc { display: flex; flex-direction: column; gap: .8rem; }
.stc-rc__cell { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .7rem .9rem; border: 2px solid var(--stc-accent); border-radius: 10px; background: #fff7ed; }
.stc-rc__cell.is-flash { animation: stc-sim-flash 1.2s ease-out; }
.stc-rc__val { font-family: var(--stc-mono); font-size: 2.2rem; line-height: 1.1; }
.stc-rc__list { margin: .3rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .2rem; }
.stc-rc__list li { padding: .2rem .5rem; border-radius: 6px; border-left: 4px solid #93c5fd; background: var(--stc-base); font-size: .85rem; }
.stc-rc__list li.is-write { border-left-color: var(--stc-accent); }
.stc-rc__list li.is-stale { border-left-color: var(--stc-err); background: var(--stc-err-bg); }
.stc-rc__list li.is-last { font-weight: 700; box-shadow: 0 0 0 2px rgba(249, 115, 22, .35); }
.stc-rc__none { margin: 0; font-size: .85rem; color: var(--stc-soft); font-style: italic; }
.stc-rc__none[hidden] { display: none; }

/* sync: dining philosophers */
.stc-ph { position: relative; width: min(100%, 22rem); aspect-ratio: 1; margin: 0 auto .6rem; }
.stc-ph__table { position: absolute; inset: 22%; border-radius: 50%; background: var(--stc-sand); border: 3px solid #fcd34d; }
.stc-ph__p { position: absolute; width: 4.4rem; height: 4.4rem; margin: -2.2rem 0 0 -2.2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 3px solid #93c5fd; border-radius: 50%; background: #eff6ff; font-weight: 700; font-size: .9rem; line-height: 1.1; text-align: center; transition: background-color var(--stc-sim-dur), border-color var(--stc-sim-dur); }
.stc-ph__pst { font-size: .62rem; font-weight: 600; color: var(--stc-soft); max-width: 3.8rem; }
.stc-ph__p.is-holding { border-color: #d97706; background: #fef3c7; }
.stc-ph__p.is-waiting { border-color: #d97706; background: #ffedd5; }
.stc-ph__p.is-eating { border-color: var(--stc-ok); background: var(--stc-ok-bg); }
.stc-ph__p.is-done { opacity: .55; border-style: dashed; }
.stc-ph__p.is-dead { border-color: var(--stc-err); background: var(--stc-err-bg); }
.stc-ph__p.is-now { box-shadow: 0 0 0 4px rgba(249, 115, 22, .35); }
.stc-ph__fork { position: absolute; width: 1.7rem; height: 1.7rem; margin: -.85rem 0 0 -.85rem; display: grid; place-items: center; border-radius: 6px; background: #e5e7eb; border: 2px solid #9ca3af; font-family: var(--stc-mono); font-size: .7rem; font-weight: 700; transition: left var(--stc-sim-dur), top var(--stc-sim-dur), background-color var(--stc-sim-dur); }
.stc-ph__fork.is-taken { background: var(--stc-accent); border-color: var(--stc-brand); }

/* ipc: pipe and signals */
.stc-ip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: .6rem; align-items: center; }
.stc-ip--signal { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.stc-ip__proc { display: flex; flex-direction: column; gap: .3rem; padding: .55rem .65rem; border: 2px solid #bfdbfe; border-radius: 10px; background: #eff6ff; min-width: 0; transition: border-color var(--stc-sim-dur), background-color var(--stc-sim-dur), opacity var(--stc-sim-dur); }
.stc-ip__proc.is-now { border-color: #2563eb; background: #dbeafe; }
.stc-ip__proc.is-target { box-shadow: 0 0 0 3px rgba(249, 115, 22, .4); }
.stc-ip__proc.is-blocked { border-color: #9ca3af; background: #f3f4f6; }
.stc-ip__proc.is-dead { border-color: var(--stc-err); background: var(--stc-err-bg); opacity: .8; }
.stc-ip__badge { align-self: flex-start; padding: 0 .4rem; border-radius: 5px; background: var(--stc-base); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--stc-soft); }
.stc-ip__info { display: flex; flex-direction: column; gap: .2rem; }
.stc-ip__line { margin: 0; font-size: .76rem; color: var(--stc-soft); }
.stc-ip__line.is-bad { color: var(--stc-err); font-weight: 700; }
.stc-ip__line.is-good { color: var(--stc-ok); font-weight: 700; }
.stc-ip__sig { margin-left: .25rem; padding: 0 .35rem; border-radius: 5px; background: var(--stc-accent); color: var(--stc-ink); font-family: var(--stc-mono); font-size: .7rem; font-weight: 700; }
.stc-ip__pipe { display: flex; flex-direction: column; gap: .3rem; padding: .55rem .65rem; border: 2px solid var(--stc-ink); border-radius: 999px; background: var(--stc-paper); text-align: center; min-width: 0; }
.stc-ip__pipe.is-full { border-color: var(--stc-err); }
.stc-ip__cells { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.stc-ip__byte { display: grid; place-items: center; width: 1.45rem; height: 1.7rem; border: 1px dashed var(--stc-line); border-radius: 4px; background: var(--stc-base); font-family: var(--stc-mono); font-size: .85rem; font-weight: 700; }
.stc-ip__byte.is-full { border: 1px solid #b45309; background: #fde68a; }
.stc-ip__count { margin: 0; font-size: .74rem; color: var(--stc-soft); }
.stc-ip__msg { margin: .6rem 0 0; font-size: .85rem; font-weight: 700; color: var(--stc-brand-dark); }
.stc-ip__msg[hidden] { display: none; }
@container stc-sim (max-width: 520px) {
	.stc-ip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.stc-ip__pipe { grid-column: 1 / -1; order: -1; border-radius: 16px; }
	.stc-ph__p { width: 3.8rem; height: 3.8rem; margin: -1.9rem 0 0 -1.9rem; }
}
/* ---------- engine: deadlock ---------- */
.stc-dl { display: block; }
.stc-dl__graph[hidden], .stc-dl__table[hidden] { display: none; }
.stc-dl__table { overflow-x: auto; }
.stc-dl__svg { display: block; width: 100%; height: auto; max-height: 21rem; }
.stc-dl__node { transition: transform var(--stc-sim-dur) ease, opacity var(--stc-sim-dur); }
.stc-dl.is-instant .stc-dl__node { transition: none; }
.stc-dl__node.is-hidden { opacity: 0; pointer-events: none; }
.stc-dl__shape { fill: var(--stc-base); stroke: var(--stc-ink); stroke-width: 2; transition: fill var(--stc-sim-dur), stroke var(--stc-sim-dur); }
.stc-dl__name { font: 700 15px var(--stc-mono); fill: var(--stc-ink); }
.stc-dl__proc.is-blocked .stc-dl__shape { fill: #ffedd5; stroke: var(--stc-accent); }
.stc-dl__proc.is-stuck .stc-dl__shape, .stc-dl__node.is-cyc .stc-dl__shape { fill: var(--stc-err-bg); stroke: var(--stc-err); stroke-width: 3; }
.stc-dl__proc.is-cur .stc-dl__shape { fill: #dbeafe; stroke: #2563eb; stroke-width: 3; }
.stc-dl__proc.is-done .stc-dl__shape, .stc-dl__proc.is-killed .stc-dl__shape { fill: var(--stc-paper); stroke: var(--stc-soft); stroke-dasharray: 4 3; }
.stc-dl__proc.is-done, .stc-dl__proc.is-killed { opacity: .55; }
.stc-dl__proc.is-killed .stc-dl__name { text-decoration: line-through; }
.stc-dl__resn .stc-dl__shape { fill: var(--stc-paper); }
.stc-dl__dot { fill: var(--stc-base); stroke: var(--stc-ink); stroke-width: 1.5; }
.stc-dl__dot.is-held { fill: var(--stc-ink); }
.stc-dl__edge { stroke: var(--stc-ink); stroke-width: 2.25; fill: none; }
.stc-dl__head { fill: var(--stc-ink); }
.stc-dl__edge.is-request { stroke-dasharray: 7 5; stroke: #c2410c; }
.stc-dl__head.is-request { fill: #c2410c; }
.stc-dl__edge.is-claim { stroke-dasharray: 2 5; stroke-linecap: round; stroke: var(--stc-soft); stroke-width: 2; }
.stc-dl__head.is-claim { fill: var(--stc-soft); }
.stc-dl__edge.is-cyc { stroke: var(--stc-err); stroke-width: 3.25; }
.stc-dl__head.is-cyc { fill: var(--stc-err); }
.stc-dl__count { font: 700 12px var(--stc-mono); fill: var(--stc-ink); paint-order: stroke; stroke: var(--stc-paper); stroke-width: 4px; }
.stc-dl__legend { margin: .35rem 0 0; font-size: .78rem; color: var(--stc-soft); }
.stc-dl__tbl { width: 100%; border-collapse: collapse; font-family: var(--stc-mono); font-size: .86rem; text-align: center; font-variant-numeric: tabular-nums; }
.stc-dl__tbl th, .stc-dl__tbl td { padding: .3rem .5rem; border: 1px solid var(--stc-line); }
.stc-dl__tbl thead th { background: var(--stc-base); font-size: .76rem; color: var(--stc-soft); }
.stc-dl__tbl .stc-dl__grp { color: var(--stc-ink); letter-spacing: .04em; text-transform: uppercase; }
.stc-dl__tbl .is-first { border-left: 2px solid var(--stc-ink); }
.stc-dl__rowname { text-align: left; background: var(--stc-base); font-weight: 700; }
.stc-dl__tbl td { background: var(--stc-base); transition: background-color var(--stc-sim-dur); }
.stc-dl__tbl tr.is-cur td, .stc-dl__tbl tr.is-cur th { background: #dbeafe; }
.stc-dl__tbl tr.is-done td, .stc-dl__tbl tr.is-done th { color: var(--stc-soft); background: var(--stc-paper); }
.stc-dl__tbl tr.is-killed td, .stc-dl__tbl tr.is-killed th { color: var(--stc-soft); text-decoration: line-through; }
.stc-dl__tbl tr.is-asking th { box-shadow: inset 4px 0 0 var(--stc-accent); }
.stc-dl__ord { font-weight: 700; width: 3.2rem; }
.stc-dl__vecs { display: flex; flex-wrap: wrap; gap: .4rem .6rem; margin: .7rem 0 0; font-family: var(--stc-mono); font-size: .86rem; }
.stc-dl__vec { padding: .2rem .55rem; border: 1px solid var(--stc-line); border-radius: 7px; background: var(--stc-base); font-variant-numeric: tabular-nums; }
.stc-dl__vec b { font-family: var(--stc-sans, inherit); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--stc-soft); }
.stc-dl__vec.is-on { border-color: #2563eb; background: #dbeafe; }
.stc-dl__vec.is-ask { border-color: var(--stc-accent); background: #ffedd5; }
@container stc-sim (max-width: 460px) {
	.stc-dl__tbl { font-size: .74rem; }
	.stc-dl__tbl th, .stc-dl__tbl td { padding: .25rem .25rem; }
	.stc-dl__ord { width: 1.6rem; }
	.stc-dl__tbl thead th { font-size: .66rem; }
}
/* ---------- Phase 6 engines: basebounds, segments, vmem, replace, thrash ---------- */
.stc-mm__title, .stc-vm__cap, .stc-tz__lab, .stc-bb__clab { margin: 0 0 .25rem; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stc-soft); }
.stc-mm { position: relative; height: 3.2rem; border: 2px solid var(--stc-ink); border-radius: 6px; background: repeating-linear-gradient(45deg, var(--stc-base), var(--stc-base) 6px, var(--stc-line) 6px, var(--stc-line) 7px); overflow: hidden; }
.stc-mm__blk, .stc-mm__hole { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; font-size: .78rem; font-weight: 700; overflow: hidden; transition: left var(--stc-sim-dur), width var(--stc-sim-dur); }
.stc-mm__blk { border-right: 1px solid rgba(17, 24, 39, .45); border-left: 1px solid rgba(17, 24, 39, .45); }
.stc-mm__blk[hidden], .stc-mm__hole[hidden], .stc-mm__pin[hidden] { display: none; }
.stc-mm__blk.is-cur { box-shadow: inset 0 0 0 3px var(--stc-ink); }
.stc-mm__hole { color: var(--stc-soft); font-weight: 400; background: var(--stc-paper); }
.stc-mm__hole.is-big { background: var(--stc-err-bg); color: var(--stc-err); }
.stc-mm__pin { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: var(--stc-accent); z-index: 2; transition: left var(--stc-sim-dur); }
.stc-mm__pin.is-bad { background: var(--stc-err); }
.stc-mm__axis { display: flex; justify-content: space-between; margin-top: .15rem; font-size: .72rem; color: var(--stc-soft); font-family: var(--stc-mono); }
.stc-bb, .stc-sg, .stc-vm, .stc-rp, .stc-tz { display: flex; flex-direction: column; gap: .7rem; }
.stc-bb__regs { display: flex; gap: .5rem; }
.stc-bb__regs[hidden], .stc-bb__box[hidden], .stc-bb__verdict[hidden] { display: none; }
.stc-bb__reg { padding: .2rem .6rem; border-radius: 6px; background: #1f2937; color: #fde68a; font-family: var(--stc-mono); font-size: .82rem; font-weight: 700; }
.stc-bb__pipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .5rem; }
.stc-bb__box { display: flex; flex-direction: column; gap: .1rem; padding: .35rem .55rem; border: 1px solid var(--stc-line); border-radius: 8px; background: var(--stc-base); }
.stc-bb__box.is-ok { border-color: var(--stc-ok); background: var(--stc-ok-bg); }
.stc-bb__box.is-bad { border-color: var(--stc-err); background: var(--stc-err-bg); }
.stc-bb__lab { font-size: .7rem; color: var(--stc-soft); }
.stc-bb__val { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stc-bb__verdict { margin: 0; font-weight: 700; font-size: .9rem; color: var(--stc-ok); }
.stc-bb__verdict.is-bad { color: var(--stc-err); }
.stc-bb__cells { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.stc-bb__clab { margin: 0 .3rem 0 0; }
.stc-bb__chip, .stc-vm__chip, .stc-rp__chip { padding: .1rem .45rem; border: 1px solid rgba(17, 24, 39, .3); border-left: 5px solid var(--stc-line); border-radius: 6px; background: var(--stc-base); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stc-sg__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .2rem .8rem; }
.stc-sg__stats { font-family: var(--stc-mono); font-size: .85rem; color: var(--stc-soft); }
.stc-sg__note { margin: 0; font-weight: 700; font-size: .88rem; color: var(--stc-err); }
.stc-sg__note[hidden] { display: none; }
.stc-sg__table { border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.stc-sg__table th, .stc-sg__table td { padding: .15rem .8rem .15rem 0; text-align: left; }
.stc-sg__table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--stc-soft); }
.stc-sg__table tr.is-cur td { font-weight: 700; }
.stc-vm__bits[hidden], .stc-vm__walkbox[hidden] { display: none; }
.stc-vm__addr { display: flex; gap: 3px; }
.stc-vm__field { display: flex; flex-direction: column; align-items: center; min-width: 3.4rem; flex-basis: 0; padding: .3rem .25rem; border: 1px solid rgba(17, 24, 39, .35); border-radius: 6px; text-align: center; overflow: hidden; }
.stc-vm__flab { font-size: .64rem; font-weight: 700; line-height: 1.2; text-transform: uppercase; letter-spacing: .03em; color: #1f2937; }
.stc-vm__fbits { font-family: var(--stc-mono); font-size: .8rem; background: none; color: #1f2937; padding: 0; }
.stc-vm__fval { font-size: 1rem; color: #111827; font-variant-numeric: tabular-nums; }
.stc-vm__mid { margin: .5rem 0; }
.stc-vm__status { display: inline-block; padding: .2rem .6rem; border-radius: 6px; background: var(--stc-line); font-weight: 700; font-size: .85rem; }
.stc-vm__status.is-ok { background: var(--stc-ok-bg); color: var(--stc-ok); }
.stc-vm__status.is-bad { background: var(--stc-err-bg); color: var(--stc-err); }
.stc-vm__walk { display: flex; flex-wrap: wrap; gap: .5rem; }
.stc-vm__card { display: flex; flex-direction: column; gap: .15rem; min-width: 7rem; padding: .4rem .6rem; border: 1px solid var(--stc-line); border-radius: 8px; background: var(--stc-base); font-size: .82rem; }
.stc-vm__card.is-on { border-color: var(--stc-accent); box-shadow: 0 0 0 3px rgba(249, 115, 22, .25); }
.stc-vm__card.is-bad { border-color: var(--stc-err); background: var(--stc-err-bg); }
.stc-vm__ctitle { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.stc-vm__muted { color: var(--stc-soft); font-size: .78rem; }
.stc-vm__res { font-weight: 700; }
.stc-vm__chip.is-hit { border-left-color: var(--stc-ok); background: var(--stc-ok-bg); }
.stc-vm__frames { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.stc-vm__frames .stc-vm__cap { margin: 0 .3rem 0 0; }
.stc-vm__frame { display: inline-flex; gap: .3rem; padding: .1rem .4rem; border: 1px solid var(--stc-ink); border-radius: 5px; font-size: .75rem; background: var(--stc-sand, #fde68a); }
.stc-vm__frame b { color: var(--stc-soft); font-weight: 700; }
.stc-vm__frame.is-free { border-style: dashed; border-color: var(--stc-line); background: var(--stc-base); color: var(--stc-soft); }
.stc-vm__frame.is-on { outline: 3px solid var(--stc-accent); }
.stc-rp__scroll { overflow-x: auto; padding-bottom: .3rem; }
.stc-rp__grid { border-collapse: separate; border-spacing: 2px; font-variant-numeric: tabular-nums; font-size: .85rem; }
.stc-rp__grid th, .stc-rp__grid td { min-width: 2rem; height: 1.9rem; padding: 0 .2rem; text-align: center; border-radius: 5px; }
.stc-rp__rowh { text-align: left !important; white-space: nowrap; font-size: .72rem; color: var(--stc-soft); padding-right: .6rem !important; }
.stc-rp__rowh.is-hand { color: var(--stc-accent); font-weight: 700; }
.stc-rp__ref { background: var(--stc-ink); color: var(--stc-paper); font-weight: 700; }
.stc-rp__ref.is-todo { background: var(--stc-line); color: var(--stc-soft); }
.stc-rp__ref.is-cur { background: var(--stc-accent); color: #fff; }
.stc-rp__cell { background: var(--stc-base); border: 1px dashed var(--stc-line); }
.stc-rp__cell.is-full { border: 1px solid rgba(17, 24, 39, .35); font-weight: 700; background: #e0f2fe; }
.stc-rp__cell.is-new { background: #fed7aa; }
.stc-rp__cell.is-cur { box-shadow: 0 0 0 2px var(--stc-accent); }
.stc-rp__res { font-size: .68rem; font-weight: 700; }
.stc-rp__res.is-fault { color: var(--stc-err); background: var(--stc-err-bg); }
.stc-rp__res.is-hit { color: var(--stc-ok); background: var(--stc-ok-bg); }
.stc-rp__tally { margin: 0; display: flex; gap: .5rem; }
.stc-rp__t { padding: .15rem .55rem; border-radius: 6px; font-weight: 700; font-size: .85rem; }
.stc-rp__t.is-fault { background: var(--stc-err-bg); color: var(--stc-err); }
.stc-rp__t.is-hit { background: var(--stc-ok-bg); color: var(--stc-ok); }
.stc-rp__info { display: flex; flex-wrap: wrap; gap: .3rem; }
.stc-rp__chip.is-victim, .stc-rp__chip.is-evict { border-left-color: var(--stc-err); background: var(--stc-err-bg); }
.stc-rp__chip.is-new { border-left-color: var(--stc-accent); }
.stc-tz__ram { position: relative; height: 2.4rem; border: 2px solid var(--stc-ink); border-radius: 6px; background: var(--stc-base); overflow: visible; }
.stc-tz__fill { display: flex; height: 100%; border-radius: 4px; overflow: hidden; }
.stc-tz__seg { display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 0; border-right: 1px solid rgba(17, 24, 39, .45); font-size: .75rem; font-weight: 700; overflow: hidden; transition: width var(--stc-sim-dur); }
.stc-tz__line { position: absolute; top: -.4rem; bottom: -.4rem; width: 0; border-left: 3px dashed var(--stc-err); }
.stc-tz__line span { position: absolute; top: 100%; left: 0; transform: translateX(-100%); padding-right: .3rem; font-size: .66rem; font-weight: 700; color: var(--stc-err); white-space: nowrap; }
.stc-tz__ram { margin-bottom: 1rem; }
.stc-tz__verdict { margin: 0; font-weight: 700; font-size: .88rem; }
.stc-tz__verdict.is-ok { color: var(--stc-ok); }
.stc-tz__verdict.is-bad { color: var(--stc-err); }
.stc-tz__chart { width: 100%; max-height: 14rem; }
.stc-tz__grid { stroke: var(--stc-line); stroke-width: 1; }
.stc-tz__ax { font-size: 10px; fill: var(--stc-soft); }
.stc-tz__path { stroke: var(--stc-brand-dark, #c2410c); stroke-width: 2.5; }
.stc-tz__dot { fill: var(--stc-brand-dark, #c2410c); }
.stc-tz__dot.is-cur { fill: var(--stc-accent); stroke: var(--stc-ink); stroke-width: 1.5; }
.stc-tz__dot.is-kill { fill: var(--stc-err); }
@container stc-sim (max-width: 460px) {
	.stc-vm__field { min-width: 2.4rem; }
	.stc-vm__flab { font-size: .56rem; }
	.stc-rp__grid th, .stc-rp__grid td { min-width: 1.7rem; }
}
/* ---------- Phase 7 engines: io, disk, fs ---------- */
/* io */
.stc-io { display: flex; flex-direction: column; gap: .7rem; }
.stc-io__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .8rem; }
.stc-io__clock { font-family: var(--stc-mono); font-size: .95rem; color: var(--stc-soft); }
.stc-io__clock b { font-size: 1.25rem; color: var(--stc-ink); }
.stc-io__algo { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stc-brand-dark); }
.stc-sim.is-compare .stc-io__algo { display: none; }
.stc-io .stc-gantt__lane { grid-template-columns: 3.4rem minmax(0, 1fr); }
.stc-io .stc-gantt__lname { white-space: nowrap; }
.stc-io .stc-gantt__lane--dev .stc-gantt__track { height: 1.7rem; }
.stc-io .stc-gantt__blk.is-cmd { background: #fdba74; }
.stc-io .stc-gantt__blk.is-poll { background: repeating-linear-gradient(135deg, #fecaca 0 5px, #fca5a5 5px 10px); }
.stc-io .stc-gantt__blk.is-copy { background: #93c5fd; }
.stc-io .stc-gantt__blk.is-irq { background: #d8b4fe; }
.stc-io .stc-gantt__blk.is-work { background: #86efac; }
.stc-io .stc-gantt__blk.is-prep { background: #e5e7eb; font-weight: 400; }
.stc-io .stc-gantt__blk.is-chunk { background: #fde047; }
.stc-io__legend { display: flex; flex-wrap: wrap; gap: .25rem .7rem; margin: 0; font-size: .72rem; color: var(--stc-soft); }
.stc-io__key::before { content: ''; display: inline-block; width: .75rem; height: .75rem; margin-right: .3rem; vertical-align: -1px; border-radius: 3px; border: 1px solid rgba(17, 24, 39, .35); background: #e5e7eb; }
.stc-io__key.is-cmd::before { background: #fdba74; }
.stc-io__key.is-poll::before { background: #fca5a5; }
.stc-io__key.is-copy::before { background: #93c5fd; }
.stc-io__key.is-irq::before { background: #d8b4fe; }
.stc-io__key.is-work::before { background: #86efac; }
.stc-io__ram { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.stc-io__rname { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stc-soft); }
.stc-io__cells { display: flex; flex-wrap: wrap; gap: 3px; }
.stc-io__cell { width: 1.1rem; height: 1.1rem; border: 1px solid var(--stc-line); border-radius: 3px; background: var(--stc-base); transition: background var(--stc-sim-dur); }
.stc-io__cell.is-in { background: #fde047; border-color: rgba(17, 24, 39, .4); }
.stc-io__cpu { margin: 0; padding: .4rem .6rem; border-radius: 8px; border: 1px solid var(--stc-line); background: var(--stc-base); font-size: .88rem; font-weight: 700; }
.stc-io__cpu.is-polling { background: #fee2e2; border-color: #fca5a5; }
.stc-io__cpu.is-other-work { background: #dcfce7; border-color: #86efac; }
.stc-io__cpu.is-copying { background: #dbeafe; border-color: #93c5fd; }
.stc-io__cpu.is-interrupt { background: #f3e8ff; border-color: #d8b4fe; }
.stc-io__cpu.is-command, .stc-io__cpu.is-setup { background: #ffedd5; border-color: #fdba74; }
.stc-io.is-instant .stc-io__cell { transition: none; }

/* disk */
.stc-dk { display: flex; flex-direction: column; gap: .5rem; }
.stc-dk__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .8rem; }
.stc-dk__info { font-family: var(--stc-mono); font-size: .9rem; color: var(--stc-soft); }
.stc-dk__info b { font-size: 1.2rem; color: var(--stc-ink); }
.stc-dk__algo { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stc-brand-dark); }
.stc-sim.is-compare .stc-dk__algo { display: none; }
.stc-dk__host { min-width: 0; }
.stc-dk__svg { display: block; max-width: 100%; font-family: var(--stc-mono); }
.stc-dk__axis { stroke: var(--stc-soft); stroke-width: 2; }
.stc-dk__end { fill: var(--stc-soft); font-size: 11px; }
.stc-dk__req { fill: var(--stc-base); stroke: var(--stc-ink); stroke-width: 1.5; }
.stc-dk__req.is-done { fill: #fdba74; }
.stc-dk__rlab { fill: var(--stc-ink); font-size: 11px; font-weight: 700; }
.stc-dk__rlab.is-done { fill: var(--stc-soft); }
.stc-dk__guide { stroke: var(--stc-line); stroke-width: 1; stroke-dasharray: 2 4; }
.stc-dk__seg { stroke: var(--stc-brand); stroke-width: 2.5; stroke-linecap: round; }
.stc-dk__seg.is-jump { stroke: #6b7280; stroke-dasharray: 6 5; }
.stc-dk__seg.is-new { stroke-dasharray: 1; stroke-dashoffset: 1; animation: stc-dk-draw var(--stc-sim-dur) ease-out forwards; }
@keyframes stc-dk-draw { to { stroke-dashoffset: 0; } }
.stc-dk__pt { fill: var(--stc-base); stroke: var(--stc-brand); stroke-width: 2; }
.stc-dk__pt.is-serve { fill: #fdba74; }
.stc-dk__pt.is-cur { fill: var(--stc-brand); stroke: var(--stc-ink); }
.stc-dk__plab { fill: var(--stc-soft); font-size: 11px; paint-order: stroke; stroke: var(--stc-paper); stroke-width: 3px; }
.stc-dk__plab.is-cur { fill: var(--stc-ink); font-weight: 700; }
.stc-dk__table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.stc-dk__table th, .stc-dk__table td { padding: .25rem .4rem; border-bottom: 1px solid var(--stc-line); text-align: left; font-variant-numeric: tabular-nums; }
.stc-dk__table th { color: var(--stc-soft); font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; }
.stc-dk__table tr.is-on td { background: var(--stc-sand); font-weight: 700; }
.stc-dk__none { color: var(--stc-soft); font-style: italic; }
@media (prefers-reduced-motion: reduce) { .stc-dk__seg.is-new { animation: none; stroke-dashoffset: 0; } }

/* fs */
.stc-fs { display: flex; flex-direction: column; gap: .7rem; }
.stc-fs [hidden] { display: none; }
.stc-fs__list { margin: 0; padding: 0; list-style: none; font-size: .86rem; }
.stc-fs__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; padding: .22rem .4rem; border-radius: 6px; border: 1px solid transparent; }
.stc-fs__row.is-on { background: var(--stc-sand); border-color: var(--stc-accent); }
.stc-fs__row.is-bad { background: #fee2e2; border-color: #fca5a5; }
.stc-fs__glyph { width: .9rem; color: var(--stc-soft); font-weight: 700; }
.stc-fs__name { font-family: var(--stc-mono); font-weight: 700; }
.stc-fs__row.is-dir .stc-fs__name { color: var(--stc-brand-dark); }
.stc-fs__target { font-family: var(--stc-mono); font-size: .8rem; color: var(--stc-soft); }
.stc-fs__meta { margin-left: auto; font-size: .74rem; color: var(--stc-soft); font-variant-numeric: tabular-nums; }
.stc-fs__ftabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem; }
.stc-fs__ft { padding: .4rem .55rem; border: 1px dashed var(--stc-line); border-radius: 8px; background: var(--stc-base); min-width: 0; }
.stc-fs__ft--open { border-style: solid; grid-column: 1 / -1; }
.stc-fs__fh { margin: 0 0 .2rem; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stc-soft); }
.stc-fs__fr { display: flex; flex-wrap: wrap; gap: .1rem .5rem; margin: 0; font-size: .8rem; }
.stc-fs__fr b { font-family: var(--stc-mono); }
.stc-fs__fr span { color: var(--stc-soft); overflow-wrap: anywhere; }
.stc-fs__grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.stc-fs__cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 2.5rem; padding: .1rem; border: 1px solid rgba(17, 24, 39, .25); border-radius: 5px; background: var(--stc-base); color: #111827; text-align: center; overflow: hidden; }
.stc-fs__bn { font-family: var(--stc-mono); font-size: .62rem; color: rgba(17, 24, 39, .55); }
.stc-fs__bl { max-width: 100%; font-size: .66rem; font-weight: 700; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stc-fs__cell.is-free { background: var(--stc-base); border-style: dashed; color: var(--stc-soft); }
.stc-fs__cell.is-super { background: #e5e7eb; }
.stc-fs__cell.is-bitmap { background: #fde68a; }
.stc-fs__cell.is-itab { background: #bae6fd; }
.stc-fs__cell.is-jrn { background: #f3f4f6; border-style: dashed; color: var(--stc-soft); }
.stc-fs__cell.is-jrn.is-jfull { background: #e9d5ff; border-style: solid; color: #111827; }
.stc-fs__cell.o0 { background: #fdba74; }
.stc-fs__cell.o1 { background: #93c5fd; }
.stc-fs__cell.o2 { background: #86efac; }
.stc-fs__cell.o3 { background: #d8b4fe; }
.stc-fs__cell.o4 { background: #fde047; }
.stc-fs__cell.o5 { background: #f9a8d4; }
.stc-fs__cell.is-bad { box-shadow: inset 0 0 0 3px #dc2626; }
.stc-fs__cell.is-leak { background: repeating-linear-gradient(135deg, #fed7aa 0 5px, #fdba74 5px 10px); }
.stc-fs__cell.is-stray { background: repeating-linear-gradient(135deg, #f3f4f6 0 5px, #d1d5db 5px 10px); }
.stc-fs__cell.is-read { outline: 3px solid #2563eb; outline-offset: -3px; animation: stc-fs-pulse 1.1s ease-out; }
.stc-fs__cell.is-write { outline: 3px solid #ea580c; outline-offset: -3px; animation: stc-fs-pulse 1.1s ease-out; }
@keyframes stc-fs-pulse { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }
.stc-fs__legend { display: flex; flex-wrap: wrap; gap: .2rem .7rem; margin: .4rem 0 0; font-size: .7rem; color: var(--stc-soft); }
.stc-fs__key::before { content: ''; display: inline-block; width: .7rem; height: .7rem; margin-right: .3rem; vertical-align: -1px; border-radius: 3px; border: 1px solid rgba(17, 24, 39, .35); background: #fff; }
.stc-fs__key.is-super::before { background: #e5e7eb; }
.stc-fs__key.is-bitmap::before { background: #fde68a; }
.stc-fs__key.is-itab::before { background: #bae6fd; }
.stc-fs__key.is-jrn::before { background: #e9d5ff; }
.stc-fs__key.o0::before { background: #fdba74; }
.stc-fs__key.is-bad::before { box-shadow: inset 0 0 0 2px #dc2626; }
.stc-fs__key.is-leak::before { background: repeating-linear-gradient(135deg, #fed7aa 0 3px, #fdba74 3px 6px); }
.stc-fs__key.is-stray::before { background: #d1d5db; }
.stc-fs__card { margin-top: .5rem; padding: .5rem .6rem; border: 1px solid var(--stc-line); border-radius: 8px; background: var(--stc-base); }
.stc-fs__card.is-pending { border-style: dashed; }
.stc-fs__ch { margin: 0 0 .35rem; font-size: .8rem; font-weight: 700; }
.stc-fs__ptrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: 3px; }
.stc-fs__ptr { padding: .15rem .2rem; border: 1px solid var(--stc-line); border-radius: 4px; text-align: center; font-family: var(--stc-mono); font-size: .72rem; color: var(--stc-soft); }
.stc-fs__ptr.is-set { background: #fff7ed; border-color: #fdba74; color: #111827; font-weight: 700; }
.stc-fs__ptr.is-ind { grid-column: span 2; }
.stc-fs__ptr.is-ind.is-set { background: #f3e8ff; border-color: #d8b4fe; }
.stc-fs__cind { margin: .35rem 0 0; font-size: .76rem; font-family: var(--stc-mono); color: var(--stc-soft); }
.stc-fs__prob { padding: .5rem .65rem; border: 2px solid #fca5a5; border-radius: 8px; background: #fef2f2; color: #7f1d1d; font-size: .82rem; }
.stc-fs__ph { margin: 0 0 .2rem; font-weight: 700; }
.stc-fs__pl { margin: 0; padding-left: 1.1rem; }
@container stc-sim (max-width: 460px) {
	.stc-fs__bl { font-size: .58rem; }
	.stc-fs__meta { margin-left: 0; width: 100%; }
	.stc-io .stc-gantt__lane { grid-template-columns: 2.9rem minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .stc-fs__cell.is-read, .stc-fs__cell.is-write { animation: none; } }

/* ---------- engine: isolate ---------- */
.stc-iso { display: grid; gap: .6rem; }
.stc-iso__head { margin: 0; padding: .3rem .6rem; border-radius: 6px; background: #e5e7eb; color: #1f2937; font-family: var(--stc-mono); font-size: .8rem; font-weight: 700; }
.stc-iso__head.is-ctr { background: #dbeafe; color: #1e3a8a; }
.stc-iso__list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--stc-line); border-radius: 8px; background: var(--stc-base); overflow: hidden; }
.stc-iso__row { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto auto; align-items: baseline; gap: .5rem; padding: .3rem .55rem; border-bottom: 1px solid var(--stc-line); font-size: .86rem; color: #111827; transition: background-color var(--stc-sim-dur, 450ms), opacity var(--stc-sim-dur, 450ms); }
.stc-iso__row:last-child { border-bottom: 0; }
.stc-iso__row[hidden] { display: none; }
.stc-iso__row.is-ctr { background: #eff6ff; }
.stc-iso__row.is-focus { background: #fef3c7; box-shadow: inset 3px 0 0 #ea580c; }
.stc-iso__row.is-dying { background: #fee2e2; color: #7f1d1d; text-decoration: line-through; }
.stc-iso__row.is-dying .stc-iso__tag { text-decoration: none; display: inline-block; }
.stc-iso__pid { font-family: var(--stc-mono); font-weight: 700; text-align: right; }
.stc-iso__name { font-family: var(--stc-mono); overflow-wrap: anywhere; }
.stc-iso__tag { font-size: .72rem; font-weight: 700; color: #1e40af; }
.stc-iso__row.is-dying .stc-iso__tag { color: #991b1b; }
.stc-iso__mem { min-width: 3.4rem; text-align: right; font-family: var(--stc-mono); font-size: .76rem; color: var(--stc-soft); }
.stc-iso__meter[hidden] { display: none; }
.stc-iso__mlabel { margin: 0 0 .25rem; font-size: .76rem; font-weight: 700; color: var(--stc-soft); }
.stc-iso__bar { height: .9rem; border-radius: 99px; border: 1px solid var(--stc-line); background: #fff; overflow: hidden; }
.stc-iso__fill { display: block; height: 100%; background: #60a5fa; transition: width var(--stc-sim-dur, 450ms), background-color var(--stc-sim-dur, 450ms); }
.stc-iso__bar.is-over .stc-iso__fill { background: #dc2626; }
.stc-iso__mval { margin: .25rem 0 0; font-size: .78rem; font-family: var(--stc-mono); color: var(--stc-soft); }
.stc-iso__note { margin: 0; font-size: .76rem; color: var(--stc-soft); }
@container stc-sim (max-width: 460px) {
	.stc-iso__row { grid-template-columns: 2.6rem minmax(0, 1fr) auto; font-size: .8rem; }
	.stc-iso__mem { grid-column: 2 / 4; text-align: left; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .stc-iso__row, .stc-iso__fill { transition: none; } }
/* ---------- engine: casefile ---------- */
/* choices in the side panel (sim.js: a step's choices; used by casefile) */
.stc-sim__choose { margin-top: .6rem; padding: .7rem .8rem; border: 2px solid var(--stc-accent); border-radius: 10px; background: var(--stc-sand); }
.stc-sim__choose[hidden] { display: none; }
.stc-sim__choosehead { margin: 0 0 .5rem; font-size: .85rem; font-weight: 700; color: var(--stc-brand-dark); }
.stc-sim__copts { display: grid; gap: .4rem; }
.stc-sim__copt { padding: .5rem .7rem; border: 1px solid var(--stc-line); border-radius: 8px; background: var(--stc-base); font: inherit; font-size: .9rem; line-height: 1.35; text-align: left; color: var(--stc-ink); cursor: pointer; }
.stc-sim__copt:hover { border-color: var(--stc-brand); }
.stc-sim__copt:focus-visible { outline: 3px solid var(--stc-accent); outline-offset: 1px; }
.stc-sim__copt.is-code code { font-family: var(--stc-mono); font-size: .85rem; font-weight: 700; }
.stc-sim__copt.is-code code::before { content: '$ '; color: var(--stc-soft); font-weight: 400; }
.stc-sim__copt.is-picked { border-color: var(--stc-brand); background: #fff7ed; box-shadow: inset 3px 0 0 var(--stc-brand); font-weight: 700; }
.stc-sim__chint { margin: .45rem 0 0; font-size: .78rem; color: var(--stc-soft); }
.stc-sim__allpick { font-size: .82rem; font-style: italic; }
.stc-sim__fq { margin: .2rem 0 .1rem; font-weight: 700; color: var(--stc-ink); }
.stc-sim__fchoices { margin: 0 0 .8rem; padding-left: 1.2rem; list-style: disc; }

/* the case: a status bar, the commands run so far, and a terminal */
.stc-cf { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.stc-cf__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .82rem; }
.stc-cf__host { padding: .15rem .55rem; border-radius: 6px; background: var(--stc-ink); color: #fff; font-family: var(--stc-mono); font-size: .78rem; font-weight: 700; }
.stc-cf__clock { font-family: var(--stc-mono); color: var(--stc-soft); font-variant-numeric: tabular-nums; }
.stc-cf__p99 { margin-left: auto; padding: .15rem .55rem; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; transition: background-color var(--stc-sim-dur), color var(--stc-sim-dur); }
.stc-cf__p99.is-bad { background: var(--stc-err-bg); color: #7f1d1d; }
.stc-cf__p99.is-ok { background: var(--stc-ok-bg); color: #14532d; }
.stc-cf__trail { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.stc-cf__trail[hidden] { display: none; }
.stc-cf__cmd { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; color: var(--stc-soft); }
.stc-cf__cmd + .stc-cf__cmd::before { content: '→'; }
.stc-cf__cmd code { padding: .1rem .4rem; border: 1px solid var(--stc-line); border-radius: 5px; background: var(--stc-base); font-family: var(--stc-mono); color: var(--stc-ink); white-space: nowrap; }
.stc-cf__cmd.is-now code { border-color: var(--stc-accent); background: var(--stc-sand); font-weight: 700; }
.stc-cf__end { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; padding: .55rem .75rem; border-radius: 9px; border: 2px solid; font-size: .95rem; }
.stc-cf__end[hidden] { display: none; }
.stc-cf__end.is-good { border-color: var(--stc-ok); background: var(--stc-ok-bg); color: #14532d; }
.stc-cf__end.is-bad { border-color: var(--stc-err); background: var(--stc-err-bg); color: #7f1d1d; }
.stc-cf__endkick { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.stc-cf__alert { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; padding: .55rem .75rem; border-left: 4px solid var(--stc-err); border-radius: 0 8px 8px 0; background: var(--stc-err-bg); color: #7f1d1d; font-size: .88rem; font-weight: 600; }
.stc-cf__alert[hidden] { display: none; }
.stc-cf__alertkick { padding: .05rem .4rem; border-radius: 4px; background: var(--stc-err); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.stc-cf__term { min-width: 0; border-radius: 9px; overflow: hidden; background: var(--stc-code-bg); color: var(--stc-code-fg); box-shadow: 0 4px 14px rgba(17, 24, 39, .12); transition: opacity var(--stc-sim-dur); }
.stc-cf__term.is-old { opacity: .62; }
.stc-cf__chrome { display: flex; align-items: center; gap: .6rem; padding: .4rem .7rem; background: #1f2937; font-size: .72rem; color: #9ca3af; }
.stc-cf__dots { width: .55rem; height: .55rem; border-radius: 50%; background: #f87171; box-shadow: .85rem 0 0 #fbbf24, 1.7rem 0 0 #34d399; margin-right: 1.7rem; }
.stc-cf__ttl { font-family: var(--stc-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stc-cf__term.is-old .stc-cf__ttl::after { content: ' · earlier output'; }
.stc-cf__screen { margin: 0; padding: .7rem .8rem .8rem; max-height: 26rem; overflow: auto; font-family: var(--stc-mono); font-size: .74rem; line-height: 1.45; white-space: pre; tab-size: 8; color: var(--stc-code-fg); }
.stc-cf__screen:focus-visible { outline: 3px solid var(--stc-accent); outline-offset: -3px; }
.stc-cf__prompt { color: #86efac; }
.stc-cf__typed { color: #fff; font-weight: 700; }
.stc-cf__mark { padding: 0 .1em; border-radius: 3px; background: #fde68a; color: #111827; font-weight: 700; }
.stc-cf__caret { display: inline-block; width: .55em; background: #e5e7eb; animation: stc-cf-blink 1.1s steps(1) infinite; }
@keyframes stc-cf-blink { 50% { opacity: 0; } }
.stc-cf__screen.is-new .stc-cf__out { animation: stc-cf-in var(--stc-sim-dur) ease-out; }
@keyframes stc-cf-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@container stc-sim (max-width: 460px) {
	.stc-cf__screen { padding: .55rem .6rem .65rem; font-size: .66rem; }
	.stc-cf__p99 { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.stc-cf__caret, .stc-cf__screen.is-new .stc-cf__out { animation: none; }
}
