/* Composer Assembler walkthrough (Admin::Composer::Assembler components). Dark and read-only; every rule sits under .asm so it
   outranks the manager kit's .cbm element rules. Fonts and base colours come from composer_benchmark_tokens.css. */
.asm {
  --night: #0d1524; --deck: #131d30; --line: #22314b; --scan: #62d4f0; --amber: #f5b95c; --text: #e7edf6; --soft: #b7c3d6; --muted: #93a1b8; --dim: #6f7e96;
  --chrome-h: 316px;
  --stage-h: clamp(480px, calc(100vh - var(--chrome-h)), 1000px);
  background: var(--night); color: var(--text); border: 1px solid #1e2a40; border-radius: 16px; padding: 14px 24px 14px;
  font-family: var(--body); font-variant-numeric: tabular-nums; outline: none;
}
.asm *, .asm *::before, .asm *::after { box-sizing: border-box; }
.asm [hidden] { display: none !important; }
.asm a { color: var(--scan); text-decoration: none; }
.asm a:hover { color: #9be6f7; }
.asm.asm:focus-visible { outline: none; }
.asm button:focus-visible { outline: 2px solid var(--scan); outline-offset: 3px; }

.cb .asm-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.cb .asm-top a { color: var(--accent); text-decoration: none; }
.cb .asm-topleft { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.cb .asm-kicker, .cb .asm-runnote { font-size: 13px; color: var(--muted); }
.asm .asm-empty { margin: 32px 0; color: var(--muted); font-size: 16px; }

/* Progress spine: the track and fill run from the first node's centre to the last's. */
.asm .asm-spine { margin-top: 8px; }
.asm .asm-rail { position: relative; height: 44px; }
.asm .asm-rail-track, .asm .asm-rail-fill { position: absolute; left: calc(50% / var(--asm-steps)); top: 6px; height: 2px; }
.asm .asm-rail-track { right: calc(50% / var(--asm-steps)); background: var(--line); }
.asm .asm-rail-fill { background: var(--scan); box-shadow: 0 0 12px rgba(98, 212, 240, 0.8); width: calc((100% - 100% / var(--asm-steps)) * var(--asm-progress, 0)); transition: width 0.6s ease; }
.asm .asm-nodes { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--asm-steps), minmax(0, 1fr)); }
.asm .asm-nodes li { display: flex; justify-content: center; min-width: 0; }
.asm .asm-nodes button { background: none; border: 0; padding: 0 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #56657e; width: 100%; font: inherit; }
.asm .asm-dot { width: 14px; height: 14px; margin-top: 0; border-radius: 50%; border: 2px solid #2e405f; background: var(--night); transition: all 0.4s; }
.asm .asm-nodelabel { font-size: 12px; line-height: 1.2; text-align: center; max-width: 100px; }
.asm .asm-nodes button[data-state="done"] { color: var(--muted); }
.asm .asm-nodes button[data-state="done"] .asm-dot { border-color: var(--scan); background: var(--scan); }
.asm .asm-nodes button[data-state="current"] { color: var(--text); }
.asm .asm-nodes button[data-state="current"] .asm-dot { border-color: var(--scan); box-shadow: 0 0 0 5px rgba(98, 212, 240, 0.18), 0 0 18px rgba(98, 212, 240, 0.9); }

.asm .asm-main { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(300px, 1fr); gap: 24px; margin-top: 8px; }
@media (max-width: 1100px) { .asm .asm-main { grid-template-columns: minmax(0, 1fr); } }

.asm .asm-stage { position: relative; height: var(--stage-h); border-radius: 14px; background: radial-gradient(circle at 50% 40%, #13213a, #0b1220 70%); border: 1px solid #1e2a40; overflow: hidden; }
.asm .asm-visual { width: 100%; height: 100%; padding: 12px; display: flex; align-items: center; justify-content: center; }
.asm .asm-visual[data-step="build"] { padding: 0; }
.asm .asm-visual img { display: block; }
.asm .asm-missing { display: flex; align-items: center; justify-content: center; border: 1px dashed #2e405f; border-radius: 10px; color: var(--muted); font-size: 14px; min-height: 60px; width: 100%; height: 100%; }

.asm .asm-side { display: flex; flex-direction: column; min-width: 0; }
.asm .asm-panel { display: flex; flex-direction: column; min-height: var(--stage-h); }
.asm .asm-where { font-size: 14px; color: var(--scan); }
.asm .asm-panel h2 { margin: 8px 0 0; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.asm .asm-caption { margin: 10px 0 0; font-size: 17px; line-height: 1.5; color: var(--soft); max-width: 46ch; }
.asm .asm-answers { margin: 22px 0 0; border-top: 1px solid var(--line); }
.asm .asm-answers > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #1a2740; font-size: 16px; }
.asm .asm-answers dt { color: var(--muted); }
.asm .asm-answers dd { margin: 0; text-align: right; font-weight: 500; }
.asm .asm-quote { margin: 18px 0 0; padding: 12px 16px; border-radius: 10px; background: rgba(98, 212, 240, 0.07); border: 1px solid rgba(98, 212, 240, 0.22); font-size: 15px; line-height: 1.5; color: #cfe9f2; }
.asm .asm-meta { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }

.asm .asm-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.asm .asm-controls { display: flex; gap: 10px; }
.asm .asm-btn { height: 48px; padding: 0 22px; border-radius: 10px; border: 1px solid #2e405f; background: transparent; color: var(--text); font: inherit; font-size: 16px; cursor: pointer; }
.asm .asm-btn:hover:not(:disabled) { border-color: var(--scan); }
.asm .asm-btn:disabled { opacity: 0.35; cursor: default; }
.asm .asm-play { border-color: var(--scan); background: rgba(98, 212, 240, 0.1); color: var(--scan); font-weight: 600; min-width: 110px; }
.asm .asm-next { border: 0; background: var(--scan); color: var(--night); font-weight: 600; padding: 0 26px; }
.asm .asm-next:hover:not(:disabled) { background: #8fe3f6; }

/* Pictures: a photo or plan with an SVG on its own pixel frame laid over it. */
.asm .asm-photo, .asm .asm-plan { position: relative; display: inline-block; line-height: 0; border-radius: 8px; overflow: hidden; max-width: 100%; }
.asm .asm-photo img, .asm .asm-plan img { max-width: 100%; max-height: calc(var(--stage-h) - 24px); width: auto; height: auto; border-radius: 8px; }
.asm .asm-plan .asm-missing { height: calc(var(--stage-h) - 24px); aspect-ratio: var(--w) / var(--h); width: auto; }
.asm .asm-photo svg, .asm .asm-plan svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.asm .asm-dim { filter: brightness(0.55) contrast(1.1); }
.asm .asm-dim-light { filter: brightness(0.85); }

.asm .asm-listing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr 1fr 0.7fr; gap: 12px; width: min(1000px, 100%); height: calc(var(--stage-h) - 28px); }
.asm .asm-listing img, .asm .asm-listing .asm-missing { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 10px; }
.asm .asm-lmain { grid-column: 1 / span 2; grid-row: 1 / span 2; position: relative; margin: 0; min-height: 0; }
.asm .asm-lmain figcaption { position: absolute; left: 10px; bottom: 10px; font-size: 13px; background: rgba(13, 21, 36, 0.8); padding: 4px 8px; border-radius: 6px; }
.asm .asm-lplan { grid-column: 3; grid-row: 1; object-position: top; background: #fff; }
.asm .asm-lside-0 { grid-column: 3; grid-row: 2; }
.asm .asm-lside-1 { grid-column: 1; grid-row: 3; }
.asm .asm-lmore { grid-column: 2; grid-row: 3; border: 1px dashed #2e405f; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; }
.asm .asm-lfacts { grid-column: 3; grid-row: 3; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; gap: 6px; font-size: 15px; }

.asm .asm-tags { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: min(1000px, 100%); }
.asm .asm-tile { position: relative; }
.asm .asm-tile img, .asm .asm-tile .asm-missing { width: 100%; height: clamp(120px, 30vh, 260px); object-fit: cover; border-radius: 10px; opacity: 0.9; }
.asm .asm-plantile { object-position: top; background: #fff; }
.asm .asm-chip { position: absolute; left: 8px; top: 8px; font-size: 14px; font-weight: 600; color: var(--night); background: var(--scan); padding: 3px 9px; border-radius: 999px; }
.asm .asm-counts { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.asm .asm-pill { border: 1px solid #2e405f; border-radius: 999px; padding: 8px 14px; font-size: 15px; }
.asm .asm-pill b { color: var(--scan); font-weight: 600; }

.asm .asm-front { display: flex; gap: 22px; align-items: center; max-width: 100%; }
.asm .asm-crop { position: relative; width: min(360px, calc((var(--stage-h) - 40px) * var(--ar))); aspect-ratio: var(--ar); border-radius: 8px; overflow: hidden; border: 1px solid var(--scan); box-shadow: 0 0 24px rgba(98, 212, 240, 0.25); flex: none; }
.asm .asm-crop img { position: absolute; width: var(--iw); height: var(--ih); left: var(--ix); top: var(--iy); max-width: none; object-fit: fill; }
.asm .asm-crop-whole img { position: static; width: 100%; height: 100%; }
.asm .asm-traits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 440px; max-width: 100%; }
.asm .asm-trait { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: rgba(19, 29, 48, 0.7); }
.asm .asm-k { font-size: 13px; color: var(--muted); }
.asm .asm-v { font-size: 17px; margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.asm .asm-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.4); flex: none; }

.asm .asm-sweep { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--scan) 20%, var(--scan) 80%, transparent); box-shadow: 0 0 18px 4px rgba(98, 212, 240, 0.55); animation: asm-sweep 1.4s cubic-bezier(0.5, 0, 0.3, 1) 1 forwards; pointer-events: none; }
@keyframes asm-sweep { 0% { top: 0; opacity: 1; } 92% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.asm .asm-fade { animation: asm-fadein 0.7s ease-out 0.5s 1 both; }
@keyframes asm-fadein { from { opacity: 0; } to { opacity: 1; } }
.asm .asm-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: asm-draw 1.6s ease-out 0.4s 1 forwards; }
@keyframes asm-draw { to { stroke-dashoffset: 0; } }
.asm .asm-stack { animation: asm-stack 1.8s cubic-bezier(0.6, 0, 0.2, 1) 0.6s 1 both; }
@keyframes asm-stack { from { transform: translate(0, 0); } to { transform: translate(var(--dx), var(--dy)); } }
.asm .asm-glow { filter: drop-shadow(0 0 6px rgba(98, 212, 240, 0.8)); }
.asm .asm-aglow { filter: drop-shadow(0 0 6px rgba(245, 185, 92, 0.8)); }
@media (prefers-reduced-motion: reduce) {
  .asm .asm-sweep { display: none; }
  .asm .asm-fade, .asm .asm-draw, .asm .asm-stack { animation: none; }
  .asm .asm-draw { stroke-dashoffset: 0; }
  .asm .asm-stack { transform: translate(var(--dx), var(--dy)); }
  .asm .asm-rail-fill, .asm .asm-dot { transition: none; }
}

/* The 3D build-up. */
.asm .asm-build, .asm .asm-model, .asm .asm-scene { position: relative; width: 100%; height: 100%; }
.asm .asm-scene canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.asm .asm-hud { position: absolute; inset: 0; pointer-events: none; }
.asm .asm-replay { position: absolute; right: 20px; top: 16px; height: 36px; padding: 0 14px; font-size: 14px; pointer-events: auto; background: rgba(13, 21, 36, 0.7); }
.asm .asm-toggles { position: absolute; left: 20px; top: 16px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; pointer-events: auto; }
.asm .asm-toggle { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; font-size: 14px; background: rgba(13, 21, 36, 0.7); }
.asm .asm-extensions { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; }
.asm .asm-extensions .asm-toggle:has(input:disabled) { opacity: 0.4; cursor: not-allowed; }
.asm .asm-legend { flex-basis: 100%; display: grid; gap: 3px; width: max-content; padding: 6px 8px; border-radius: 6px; background: rgba(11, 18, 32, 0.82); font-size: 12px; line-height: 1.3; color: #e7edf6; }
.asm .asm-legend[hidden] { display: none; }
.asm .asm-legend span { display: flex; align-items: center; gap: 6px; }
.asm .asm-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.asm .hpeempty { color: var(--muted); padding: 24px; font-size: 15px; }

.asm .asm-live { margin-top: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.asm .asm-counter b { display: block; font-size: 44px; font-weight: 600; color: var(--scan); line-height: 1; }
.asm .asm-counter span { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.asm .asm-phase { font-size: 15px; color: var(--soft); text-align: right; }
.asm .asm-panel[data-step="build"] .asm-answers > div[data-lit] { color: #56657e; transition: color 0.6s; }
.asm .asm-panel[data-step="build"] .asm-answers > div[data-lit] dt, .asm .asm-panel[data-step="build"] .asm-answers > div[data-lit] dd { color: inherit; }
.asm .asm-panel[data-step="build"] .asm-answers > div[data-lit="true"] { color: var(--scan); }
.asm .asm-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 15px; }
.asm .asm-loading i { display: block; width: 180px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; position: relative; }
.asm .asm-loading i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--scan); box-shadow: 0 0 10px rgba(98, 212, 240, 0.8); animation: asm-load 1.2s ease-in-out infinite; }
@keyframes asm-load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .asm .asm-loading i::after { animation: none; width: 100%; } }

.cb .asm-source { display: flex; align-items: center; gap: 10px; }
.cb .asm-select { background: #131d30; color: #e7edf6; border: 1px solid #2e405f; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 13px; max-width: 280px; }
.cb .asm-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.asm .asm-marks { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; width: 100%; height: 100%; align-items: center; }
.asm .asm-markmap { width: 100%; max-height: calc(var(--stage-h) - 24px); aspect-ratio: var(--ar); }
.asm .asm-markside { max-height: calc(var(--stage-h) - 24px); overflow-y: auto; font-size: 12px; color: #b7c3d6; }
.asm .asm-marknote { margin: 0 0 10px; color: #f5b95c; }
.asm .asm-marklegend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-bottom: 12px; }
.asm .asm-marklegend span { display: flex; align-items: center; gap: 6px; }
.asm .asm-marklegend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid #2e405f; flex: none; }
.asm .asm-marklegend i.asm-dashed { height: 0; border: 0; border-top: 2px dashed #e7edf6; border-radius: 0; }
.asm .asm-marklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.asm .asm-marklist b { color: #e7edf6; margin-right: 4px; }
.asm .asm-marklist em { display: block; font-style: normal; color: #f5b95c; }
.asm .asm-openlegend { position: absolute; left: 8px; top: 8px; display: grid; gap: 3px; padding: 6px 8px; border-radius: 6px; background: rgba(11, 18, 32, 0.82); font-size: 11px; line-height: 1.3; color: #e7edf6; }
.asm .asm-openlegend span { display: flex; align-items: center; gap: 6px; }
.asm .asm-openlegend i { width: 12px; height: 6px; border-radius: 2px; flex: none; }
.asm .asm-openlegend i.asm-dashed { height: 0; border-top: 2px dashed #e7edf6; }
.asm .asm-site { width: 100%; height: 100%; }
.asm .asm-site svg { display: block; width: 100%; height: 100%; overflow: hidden; }
