/* ===== codeart — workspace ===== */
html, body { height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.bar {
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 14px 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    position: relative;
    z-index: 20;
}
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-btn { border: 0; background: transparent; height: 26px; padding: 0 12px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 13px; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.crumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    height: 32px;
    padding: 0 8px 0 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 13px;
}
.crumb:hover { border-color: var(--line-2); background: var(--surface-2); }
.crumb-track { color: var(--muted); white-space: nowrap; }
.crumb-sep { color: var(--line-2); }
.crumb-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.crumb kbd { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.py { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.py i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1.4s ease-in-out infinite; }
.py.ready i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: none; }
.py.error i { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); animation: none; }
@keyframes pulse { 50% { opacity: 0.35; } }
.ring { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--mono); color: var(--text-2); }
.ring svg { width: 22px; height: 22px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset 0.6s ease; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--cool); color: #0b0c10; font-weight: 700; font-size: 12px; border: 0; }

/* ---------- workspace ---------- */
.ws { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(380px, 36%) 1fr; }
.left { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.panel { flex: 0 1 46%; min-height: 150px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.tab { position: relative; border: 0; background: transparent; padding: 7px 10px 10px; color: var(--muted); font-weight: 500; font-size: 13px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab-count { font: 500 11px var(--mono); color: var(--muted); margin-left: 2px; }
.tab-body { flex: 1; overflow: auto; padding: 18px 20px 22px; scrollbar-width: thin; }

/* problem */
.p-eyebrow { display: flex; align-items: center; gap: 8px; font: 500 11.5px var(--mono); color: var(--muted); letter-spacing: 0.02em; margin-bottom: 8px; }
.p-title { margin: 0 0 10px; font-size: 22px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.p-title .solved { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ok); color: #0b0c10; font-size: 12px; }
.p-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.prose { color: var(--text-2); font-size: 14px; }
.prose p { margin: 0 0 10px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code { font-size: 12.5px; color: var(--text); background: var(--surface-3); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.watch { margin: 14px 0; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.watch-label { display: flex; align-items: center; gap: 6px; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 4px; }
.watch .prose p { margin: 0; }
.examples { margin-top: 16px; }
.examples h4 { margin: 0 0 8px; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.example { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 9px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 6px; font: 12.5px/1.5 var(--mono); }
.example span { color: var(--muted); }
.example code { color: var(--text); word-break: break-word; }
.level-nav { display: flex; justify-content: space-between; margin-top: 18px; }

/* solutions */
.gate { text-align: center; padding: 26px 12px; color: var(--text-2); }
.gate h4 { margin: 0 0 6px; color: var(--text); font-size: 15px; }
.gate p { margin: 0 auto 14px; max-width: 320px; font-size: 13px; }
.sol { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.sol-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 0; }
.sol-rank { font: 600 12px var(--mono); color: var(--muted); width: 18px; }
.sol-name { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; }
.sol-cx { display: flex; gap: 6px; padding: 10px 14px 0 42px; flex-wrap: wrap; }
.cx { font: 500 11.5px var(--mono); padding: 3px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); }
.cx b { color: var(--text); font-weight: 600; }
.sol-idea { padding: 8px 14px 0 42px; margin: 0; color: var(--text-2); font-size: 13px; }
.sol-idea code { font-size: 12px; color: var(--text); background: var(--surface-3); padding: 0 4px; border-radius: 4px; }
.sol-foot { display: flex; align-items: center; gap: 6px; padding: 12px 14px 12px 42px; }
.sol-steps { font: 500 11.5px var(--mono); color: var(--muted); margin-right: auto; }
.sol-steps b { color: var(--text); }
.sol-bar { height: 3px; border-radius: 3px; background: var(--surface-3); margin: 0 14px 0 42px; overflow: hidden; }
.sol-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); width: 0; transition: width 0.6s ease; }
.sol.brute .sol-bar i { background: var(--bad); }
.sol pre { margin: 0; padding: 12px 14px 14px 42px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; line-height: 1.6; overflow: auto; }
.sol details > summary { list-style: none; cursor: pointer; padding: 0 14px 12px 42px; font-size: 12.5px; color: var(--muted); }
.sol details > summary::-webkit-details-marker { display: none; }
.sol details > summary:hover { color: var(--text); }
.sol details[open] > summary { padding-bottom: 10px; }

.sol-note { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }

/* history */
.hist { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.hist-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.hist.ok .hist-dot { background: var(--ok); }
.hist-main { flex: 1; min-width: 0; }
.hist-main b { font-size: 13px; }
.hist-main span { display: block; font: 12px var(--mono); color: var(--muted); }
.empty-note { color: var(--muted); font-size: 13px; text-align: center; padding: 22px 8px; }

/* ---------- editor ---------- */
.editor-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.editor-head { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
.file { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font: 500 12.5px var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file i { flex: none; }
.file i { width: 8px; height: 8px; border-radius: 2px; background: var(--t-int); }
.spacer { flex: 1; }
.code-editor { --lh: 21px; flex: 1; min-height: 120px; display: flex; font: 13px/var(--lh) var(--mono); overflow: hidden; position: relative; background: var(--bg); }
.ce-gutter { flex: 0 0 46px; padding: 12px 0; text-align: right; color: var(--muted); opacity: 0.55; user-select: none; }
.ce-gutter div { padding-right: 14px; height: var(--lh); }
.ce-gutter div.active { color: var(--accent); opacity: 1; font-weight: 600; }
.ce-body { position: relative; flex: 1; overflow: hidden; }
.ce-hl, .ce-input { margin: 0; padding: 12px 14px 12px 4px; font: inherit; line-height: var(--lh); white-space: pre; tab-size: 4; }
.ce-hl { position: absolute; inset: 0; pointer-events: none; color: var(--text); min-width: 100%; }
.ce-input { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; border: 0; outline: none; background: transparent; color: transparent; caret-color: var(--accent); overflow: auto; }
.ce-input::selection { background: var(--cool-soft); color: transparent; }
.ce-line { position: absolute; left: 0; right: 0; pointer-events: none; transition: top 0.2s cubic-bezier(0.3, 0.8, 0.3, 1); }
.ce-line-run { background: linear-gradient(90deg, var(--accent-soft), transparent 80%); box-shadow: inset 2px 0 0 var(--accent); }
.ce-line-err { background: linear-gradient(90deg, var(--bad-soft), transparent 80%); box-shadow: inset 2px 0 0 var(--bad); }

.console { flex: 0 0 132px; display: flex; flex-direction: column; border-top: 1px solid var(--line); min-height: 0; background: var(--surface); }
.console-head { display: flex; gap: 2px; padding: 6px 10px 0; }
.ctab { border: 0; background: transparent; padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.ctab.active { color: var(--text); background: var(--surface-3); }
#testBadge { font: 600 10.5px var(--mono); margin-left: 3px; }
#testBadge.ok { color: var(--ok); }
#testBadge.bad { color: var(--bad); }
.console-pane { flex: 1; margin: 0; padding: 8px 16px 12px; overflow: auto; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; color: var(--text-2); }
#testPane { white-space: normal; }
.err { color: var(--bad); }
.t-summary { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; font: 600 13px var(--font); }
.t-summary.ok { color: var(--ok); }
.t-summary.bad { color: var(--bad); }
.t-list { list-style: none; margin: 0; padding: 0; }
.t-list li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.t-list li:last-child { border-bottom: 0; }
.t-list .m { display: inline-block; width: 16px; font-weight: 700; }
.t-list li.ok .m { color: var(--ok); }
.t-list li.bad .m { color: var(--bad); }
.t-list .detail { margin-left: 16px; color: var(--muted); }

/* ---------- stage ---------- */
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg); }
.viewport { position: absolute; inset: 0; }
.viewport canvas { display: block; width: 100% !important; height: 100% !important; outline: none; }
.glass { background: var(--glass); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }

.empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; pointer-events: none; }
.empty h3 { margin: 18px 0 6px; font-size: 18px; letter-spacing: -0.02em; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 380px; color: var(--text-2); }
.empty b { color: var(--text); font-weight: 600; }
.empty-blocks { display: flex; justify-content: center; gap: 10px; perspective: 500px; }
.empty-blocks i { width: 38px; height: 38px; border-radius: 9px; background: var(--t-int); transform: rotateX(48deg) rotateZ(-8deg); box-shadow: 0 14px 18px -8px rgba(0, 0, 0, 0.5), inset 0 -4px 0 rgba(0, 0, 0, 0.18); animation: bob 2.6s ease-in-out infinite; }
.empty-blocks i:nth-child(2) { background: var(--t-str); animation-delay: 0.2s; }
.empty-blocks i:nth-child(3) { background: var(--accent); animation-delay: 0.4s; }
@keyframes bob { 50% { transform: rotateX(48deg) rotateZ(-8deg) translateY(-10px); } }

.pipeline { position: absolute; top: 14px; left: 14px; right: 64px; max-width: 920px; display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1.45fr) 18px minmax(0, 0.75fr); align-items: stretch; padding: 6px; border-radius: 14px; }
.stage-step { padding: 7px 10px 8px; border-radius: 9px; min-width: 0; transition: background 0.25s; }
.stage-step.on { background: var(--surface-3); }
.stage-label { display: flex; align-items: center; gap: 6px; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 3px; }
.stage-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: background 0.2s, box-shadow 0.2s; }
#pFetch.on .stage-label i { background: var(--cool); box-shadow: 0 0 0 3px var(--cool-soft); }
#pDecode.on .stage-label i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#pExec.on .stage-label i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.stage-body { display: block; font-size: 12.5px; color: var(--text); overflow: hidden; }
#fetchText { white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; }
#fetchText .ln { color: var(--accent); margin-right: 7px; }
#decodeText > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.6; }
#execText { color: var(--text-2); }
.stage-link { position: relative; align-self: center; height: 2px; background: var(--line-2); border-radius: 2px; overflow: visible; }
.stage-link span { position: absolute; top: -2px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0; }
.pipeline.tick .stage-link span { animation: travel 0.35s ease-out both; }
.pipeline.tick .stage-link + .stage-step + .stage-link span { animation-delay: 0.18s; }
@keyframes travel { 0% { left: 0; opacity: 1; } 100% { left: calc(100% - 6px); opacity: 0; } }
.op { display: inline-block; min-width: 52px; margin-right: 6px; padding: 1px 5px; border-radius: 4px; font: 600 10px/1.6 var(--mono); text-align: center; letter-spacing: 0.04em; background: var(--surface-3); color: var(--text-2); }
.op-STORE, .op-DEFINE { background: var(--cool-soft); color: var(--cool); }
.op-UPDATE, .op-WRITE, .op-LINK { background: var(--accent-soft); color: var(--accent); }
.op-APPEND, .op-INSERT, .op-NEXT { background: var(--ok-soft); color: var(--ok); }
.op-POP, .op-DELETE, .op-EXIT, .op-ERROR { background: var(--bad-soft); color: var(--bad); }
.op-SWAP, .op-TEST, .op-LOOP { background: rgba(180, 140, 255, 0.15); color: var(--t-fn); }
.op-CALL, .op-RETURN { background: var(--surface-3); color: var(--text); }
.op-PRINT { background: rgba(63, 193, 173, 0.14); color: var(--teal); }

.stage-tools { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; }
.stage-tools .icon-btn { border-radius: 8px; width: 32px; height: 32px; }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); }
.cam-sep { width: 18px; height: 1px; margin: 3px 0; background: var(--line-2); }
.viewport:focus-visible { outline: 2px solid var(--cool); outline-offset: -2px; }
.cam-help { position: absolute; right: calc(100% + 10px); top: 0; width: 270px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 12.5px; }
.cam-help-title { margin: 0 0 8px; font-weight: 600; }
.cam-help dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0 0 8px; }
.cam-help dt { font: 600 11px var(--mono); white-space: nowrap; color: var(--text); }
.cam-help dd { margin: 0; color: var(--text-2); }
.cam-help kbd { padding: 0 4px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 10.5px; }
.cam-help-tip { margin: 0; color: var(--muted); }
.legend { position: absolute; left: 14px; bottom: 76px; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 7px 12px; border-radius: 10px; font-size: 11.5px; color: var(--text-2); box-shadow: none; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: -1px; }
.legend i.ref { background: var(--t-ref); box-shadow: inset 0 0 0 2px var(--cool); }

.transport { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(640px, calc(100% - 28px)); display: flex; align-items: center; gap: 4px; padding: 6px 10px 6px 6px; border-radius: 14px; }
.play { width: 40px; height: 40px; border-radius: 11px; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; margin: 0 2px; }
.play svg { width: 16px; height: 16px; }
.play:hover { filter: brightness(1.08); }
.scrub { flex: 1; padding: 0 10px; min-width: 60px; }
.scrub input { width: 100%; height: 22px; background: transparent; -webkit-appearance: none; appearance: none; margin: 0; --p: 0%; }
.scrub input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p), var(--surface-3) var(--p)); }
.scrub input::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p), var(--surface-3) var(--p)); }
.scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--text); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-2); }
.scrub input::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--text); border: 3px solid var(--bg); }
.count { font: 500 12px var(--mono); color: var(--text-2); min-width: 64px; text-align: right; }
.speed { border: 1px solid var(--line-2); background: transparent; border-radius: 7px; height: 28px; min-width: 42px; font: 600 12px var(--mono); color: var(--text-2); margin-left: 6px; }
.speed:hover { color: var(--text); border-color: var(--muted); }
.stats { position: absolute; right: 18px; bottom: 82px; display: flex; gap: 14px; font: 12px var(--mono); color: var(--muted); }
.stats b { color: var(--text); font-weight: 600; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 6, 9, 0.5); z-index: 40; animation: fade 0.2s ease; }
:root[data-theme="light"] .scrim { background: rgba(40, 30, 20, 0.18); }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 60px; left: 12px; bottom: 12px; width: min(440px, calc(100vw - 24px)); z-index: 41; display: flex; flex-direction: column; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); animation: slideIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px) scale(0.99); } }
.drawer-head { padding: 12px; border-bottom: 1px solid var(--line); }
.search-wrap { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.search-wrap:focus-within { border-color: var(--cool); }
.search-wrap svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search-wrap input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.search-wrap kbd { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; }
.drawer-body { flex: 1; overflow: auto; padding: 8px 8px 16px; scrollbar-width: thin; }
.drawer-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font: 11px var(--mono); color: var(--muted); }
.drawer-tools .btn { height: 26px; padding: 0 8px; font-size: 12px; }
.track { margin: 2px 0; border-radius: 10px; }
.track.open { background: var(--surface-2); }
.track-toggle { width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; }
.track-toggle:hover { background: var(--surface-3); }
.track-chev { width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); transition: transform 0.2s; }
.track-chev svg { width: 12px; height: 12px; }
.track.open .track-chev { transform: rotate(90deg); color: var(--text); }
.track-name { min-width: 0; }
.track-name b { display: block; font-size: 13px; font-weight: 600; }
.track-name span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track.open .track-name span { white-space: normal; }
.track-count { display: flex; align-items: center; gap: 8px; font: 500 11px var(--mono); color: var(--muted); }
.track-count .bar-mini { width: 44px; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.track-count .bar-mini i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.track-levels { padding: 0 4px 6px; }
.lv { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.lv:hover, .lv.kb { background: var(--surface-3); }
.lv.active { background: var(--accent-soft); }
.lv-num { font: 500 11px var(--mono); color: var(--muted); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-2); }
.lv.done .lv-num { background: var(--ok); border-color: var(--ok); color: #0b0c10; font-size: 0; }
.lv.done .lv-num::after { content: '✓'; font-size: 11px; font-weight: 700; }
.lv-title { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- auth dialog ---------- */
.dialog { border: 1px solid var(--line-2); border-radius: 18px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(400px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(5, 6, 9, 0.55); backdrop-filter: blur(3px); }
.auth { padding: 26px 24px 20px; }
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-head .logo-glyph { display: inline-block; margin-bottom: 12px; }
.auth-head h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.02em; font-weight: 600; }
.auth-head p { margin: 0; font-size: 13px; color: var(--text-2); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; gap: 3px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; }
.auth-tab { border: 0; background: transparent; height: 30px; border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.auth-tab.active { background: var(--surface-3); color: var(--text); }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; }
.field input { width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.field input:focus { border-color: var(--cool); box-shadow: 0 0 0 3px var(--cool-soft); }
.auth-error { min-height: 18px; margin: 2px 0 10px; font-size: 12.5px; color: var(--bad); }
.auth-actions { display: flex; justify-content: flex-end; gap: 8px; }
.auth-actions .btn { height: 38px; }
.menu { position: fixed; z-index: 50; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head b { display: block; font-size: 13px; }
.menu-head span { font-size: 12px; color: var(--muted); }
.menu button { width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 7px; font-size: 13px; }
.menu button:hover { background: var(--surface-3); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
    .pipeline { grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1.5fr); }
    .pipeline > :nth-child(4), .pipeline > :nth-child(5) { display: none; }
    .legend { display: none; }
    .stats { bottom: 80px; }
}
@media (max-width: 920px) {
    html, body { overflow: auto; height: auto; }
    .ws { display: flex; flex-direction: column; }
    .left { border-right: 0; }
    .panel { flex: none; max-height: none; }
    .tab-body { max-height: 46vh; }
    .editor-card { flex: none; height: 460px; }
    .stage { height: 78vh; min-height: 520px; border-top: 1px solid var(--line); }
    .crumb-track, .crumb-sep, .crumb kbd { display: none; }
    .py span { display: none; }
    .pipeline { right: 64px; grid-template-columns: 1fr; }
    .pipeline > .stage-link, #pExec { display: none !important; }
    .stats { display: none; }
}
@media (max-width: 560px) {
    .bar { gap: 8px; padding: 0 10px; }
    .logo b { display: none; }
    .seg-btn { padding: 0 9px; }
    .ring span { display: none; }
    .transport { gap: 2px; }
    #firstBtn, #lastBtn { display: none; }
    .tab-body { padding: 16px; }
}
