/* Enzyme Locksmith: the key bench, the energy diagram and the lab inside the practice shell's stage. */
.el { position: absolute; inset: 0; padding: 10px 12px; --el-curve: #1f6f5c; }
html[data-theme="dark"] .el { --el-curve: #6fd3b5; }
.el-h { margin: 0; font-size: 16px; font-weight: 800; }
.el-note { margin: 0 0 6px; font-size: 16px; line-height: 1.35; }
.el-tray-tip { margin: 0; font-size: 16px; color: var(--tlg-text-muted); line-height: 1.3; }

/* ── the key bench ── */
.el--bench { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; }
.el-locks { display: grid; gap: 12px; align-items: stretch; min-height: 0; }
.el-lock { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; min-width: 0;
  padding: 6px 6px 8px; border-radius: var(--tlg-radius-lg); border: var(--tlg-border-width) solid var(--tlg-border); background: var(--tlg-surface); }
.el-lock-art { position: relative; width: 100%; max-width: 250px; aspect-ratio: 156 / 214; min-height: 0; flex: 0 1 auto; }
.el-lock-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.el-g-sq, .el-sparks { display: none; }
.el-slot { position: absolute; left: 50%; top: 2%; transform: translateX(-50%); width: min(150px, 86%); height: 36%; display: flex; justify-content: center; align-items: flex-start;
  border-radius: 14px; border: 2px dashed var(--tlg-border-strong); background: color-mix(in srgb, var(--tlg-surface-2) 70%, transparent); }
.el-lock.has-token .el-slot { border-color: transparent; background: transparent; }
html.pdz-armed .el-lock .el-slot { border-color: var(--ps-accent); }
.el-lock.is-over { outline: 3px solid var(--ps-accent); outline-offset: 2px; }
.el-plate { margin: 4px 0 0; text-align: center; font-size: 16px; line-height: 1.25; display: flex; flex-direction: column; }
.el-plate span { color: var(--tlg-text-muted); font-size: 16px; }
.el-traywrap { display: flex; flex-direction: column; gap: 4px; }
.el-tray { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; min-height: 96px; padding: 8px;
  border-radius: var(--tlg-radius-lg); border: 2px dashed var(--tlg-border-strong); background: var(--tlg-surface-2); }
.el-key { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 124px; min-height: 76px; padding: 6px 10px;
  border-radius: 14px; border: 3px solid var(--ps-accent); background: #fffdf6; color: #111827; font: 700 16px/1.2 var(--tlg-font); cursor: grab;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.el-key:focus-visible, .el-label:focus-visible { outline: var(--tlg-focus-width) solid var(--tlg-focus); outline-offset: 3px; }
.el-key.is-picked, .el-label.is-picked { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0, 0, 0, .25); }
.el-key.is-disabled, .el-label.is-disabled { cursor: default; }
.el-mol { width: 80px; height: 50px; display: block; pointer-events: none; }
.el-key-name { pointer-events: none; }
.el-slot .el-key { min-width: 112px; min-height: 70px; padding: 4px 8px; transition: transform .35s ease; }
.el-lock.is-fit .el-g-open { display: none; }
.el-lock.is-fit .el-g-sq, .el-lock.is-fit .el-sparks { display: inline; }
.el-lock.is-fit .el-slot .el-key { transform: translateY(26px) scale(.86); }
.el-lock.is-wrong .el-slot .el-key { animation: el-shake .5s ease 1; border-color: #b42318; }
.el-badge { position: absolute; top: 6px; right: 8px; padding: 2px 8px; border-radius: 999px; font-weight: 800; font-size: 16px; color: #fff; }
.el-badge.is-ok { background: #15803d; }
.el-badge.is-bad { background: #b42318; }
.el-fits { position: absolute; top: 6px; left: 8px; white-space: nowrap; padding: 2px 8px; border-radius: 8px;
  background: var(--tlg-surface); border: 1px solid var(--tlg-border-strong); font-size: 16px; font-weight: 700; }
@keyframes el-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
@media (prefers-reduced-motion: reduce) { .el-lock.is-wrong .el-slot .el-key { animation: none; } .el-slot .el-key { transition: none; } }

/* ── the energy diagram ── */
.el--energy { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; }
.el--energy .el-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.el-rows { display: flex; flex-direction: column; gap: 8px; }
.el-row { position: relative; display: flex; align-items: center; gap: 8px; min-height: 66px; padding: 6px 8px; border-radius: 12px;
  border: 2px dashed var(--tlg-border-strong); background: var(--tlg-surface); }
.el-row.is-over { border-color: var(--ps-accent); border-style: solid; }
.el-row.is-ok { border-style: solid; border-color: #15803d; }
.el-row.is-bad { border-style: solid; border-color: #b42318; }
.el-row .el-badge { top: -8px; right: -6px; }
.el-row-k { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ps-accent); color: #fff; font-weight: 800; }
.el-rowslot { flex: 1; min-height: 48px; display: flex; align-items: center; }
.el-tray--col { flex-direction: column; align-items: stretch; min-height: 80px; }
.el-label { min-height: 48px; padding: 6px 12px; border-radius: 12px; border: 3px solid var(--ps-accent); background: #fffdf6; color: #111827;
  font: 700 16px/1.25 var(--tlg-font); text-align: left; cursor: grab; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.el-rowslot .el-label { width: 100%; }
.el-diagram { min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: var(--tlg-radius-lg);
  border: var(--tlg-border-width) solid var(--tlg-border); background: var(--tlg-surface); color: var(--tlg-text); }
.el-diagram-svg { width: 100%; height: 100%; max-height: 560px; }

/* ── the lab ── */
.el--lab { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 12px; }
.el--lab .el-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; padding: 2px; }
.el--lab .pss { gap: 6px; }
.el--lab .pss-row { padding: 4px 10px; }
.el--lab .pss-row.is-locked .pss-ticks { display: none; }
.el--lab .pss-note { font-size: 16px; line-height: 1.25; }
.el-opts { display: flex; flex-direction: column; gap: 6px; }
.el-opt { display: flex; gap: 8px; align-items: flex-start; min-height: 48px; padding: 8px 10px; border-radius: 12px; text-align: left;
  border: 2px solid var(--tlg-border-strong); background: var(--tlg-surface); color: var(--tlg-text); font: 600 16px/1.3 var(--tlg-font); cursor: pointer; }
.el-opt-k { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--tlg-surface-2); font-weight: 800; font-size: 16px; }
.el-opt[aria-checked="true"], .el-thumb[aria-checked="true"] { border-color: var(--ps-accent); box-shadow: inset 5px 0 0 var(--ps-accent); background: var(--tlg-surface-2); }
.el-opt[aria-checked="true"] .el-opt-k { background: var(--ps-accent); color: #fff; }
.el-opt:focus-visible, .el-thumb:focus-visible { outline: var(--tlg-focus-width) solid var(--tlg-focus); outline-offset: 2px; }
.el-opt:disabled, .el-thumb:disabled { cursor: default; opacity: 1; }
.el-opt.is-right, .el-thumb.is-right { border-color: #15803d; box-shadow: inset 5px 0 0 #15803d; }
.el-opt.is-right::after, .el-thumb.is-right::after { content: "✓"; margin-left: auto; color: #15803d; font-weight: 800; }
.el-opt.is-wrong, .el-thumb.is-wrong { border-color: #b42318; box-shadow: inset 5px 0 0 #b42318; }
.el-opt.is-wrong::after, .el-thumb.is-wrong::after { content: "✗"; margin-left: auto; color: #b42318; font-weight: 800; }
.el-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.el-thumb { position: relative; padding: 4px; min-height: 44px; border-radius: 12px; border: 2px solid var(--tlg-border-strong); background: var(--tlg-surface); color: var(--tlg-text); cursor: pointer; }
.el-thumb::after { position: absolute; top: 2px; right: 8px; }
.el-thumb-svg { width: 100%; height: auto; display: block; }
.el-axes { margin: 0; font-size: 16px; line-height: 1.3; color: var(--tlg-text-muted); }
.el-runrow { display: flex; gap: 8px; }
.el-runbtn { flex: 1; min-height: 48px; font-size: var(--tlg-text-lg); }
.el-skip { min-height: 48px; font-size: 16px; }
.el-status { margin: 0; font-size: 16px; line-height: 1.3; color: var(--tlg-text-muted); }
.el-main { display: grid; grid-template-rows: 214px minmax(0, 1fr); gap: 10px; min-width: 0; min-height: 0; }
.el-top { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; min-height: 0; }
.el-graph { min-width: 0; min-height: 0; overflow: hidden; padding: 4px 6px; border-radius: var(--tlg-radius-lg); border: var(--tlg-border-width) solid var(--tlg-border); background: var(--tlg-surface); }
.el-info { min-height: 0; overflow-y: auto; padding: 8px 10px; border-radius: var(--tlg-radius-lg); border: var(--tlg-border-width) solid var(--tlg-border); background: var(--tlg-surface); }
.el-runs { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 3px; font-size: 16px; line-height: 1.3; }
.el-scene { position: relative; min-height: 0; overflow: hidden; border-radius: var(--tlg-radius-lg); border: var(--tlg-border-width) solid var(--tlg-border); }

/* ── the Briefing's worked example ── */
.el-example { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ps-brief--page .is-wide .el-example { grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.el-ex-graph { min-width: 0; }
.el-start-art { width: 100%; height: 100%; }

@media (max-width: 1100px) { .el--lab { grid-template-columns: 290px minmax(0, 1fr); } .el-top { grid-template-columns: minmax(0, 1fr) 220px; } }
@media (max-width: 900px) {
  .el, .el--lab, .el--energy, .el--bench { position: static; grid-template-columns: 1fr; }
  .el-main { grid-template-rows: auto 380px; }
  .el-top { grid-template-columns: 1fr; }
  .el-graph { height: 230px; }
  .el-locks { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .el-lock-art { min-height: 220px; }
  .el-diagram { min-height: 320px; }
  .ps-brief--page .is-wide .el-example { grid-template-columns: 1fr; }
}
