/* UI Anatomy — components. Every colour comes from tokens.css (class ui-dark / ui-light on <html>). */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { font: 400 14px/1.45 var(--font-sans); color: var(--text); -webkit-font-smoothing: antialiased; transition: background-color .3s ease, color .3s ease; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--guide); outline-offset: 2px; }
.app { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.mono { font-family: var(--font-mono); }
.grow { flex: 1; min-width: 0; } .t2 { color: var(--text-2); } .t3 { color: var(--text-3); } .acc { color: var(--accent-text); }
.ok-t { color: var(--ok); } .warn-t { color: var(--warn); } .bad-t { color: var(--bad); }
.scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; overscroll-behavior: contain; }
.label { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-3); font: 500 11px var(--font-mono); }
.kbd.on-accent { background: color-mix(in srgb, var(--text) 0%, rgba(255,255,255,.16)); border-color: rgba(255,255,255,.22); color: inherit; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: background-color .3s, border-color .3s, transform .2s, box-shadow .2s; }
.lift:hover { transform: translateY(-3px); border-color: var(--line-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 500 13.5px var(--font-sans); cursor: pointer; transition: background-color .15s, border-color .15s, transform .1s, box-shadow .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); } .btn:active { transform: translateY(1px); } .btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-lg { height: 44px; padding: 0 18px; font-size: 14.5px; border-radius: 11px; } .btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-sm); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; transition: background-color .15s, color .15s; }
.icon-btn:hover, .icon-btn.on { background: var(--surface-2); color: var(--text); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; }
button.chip { cursor: pointer; font-family: inherit; }
.dotc { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; } .pulse { animation: pulse 1.8s ease-in-out infinite; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.count.warn { background: var(--warn-soft); color: var(--warn); }
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 9px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 0 0 1px var(--line); transition: transform .35s var(--ease-spring); }
.seg-btn { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 14px; border: 0; background: transparent; color: var(--text-2); font: 500 13.5px var(--font-sans); cursor: pointer; border-radius: 9px; transition: color .2s; white-space: nowrap; }
.seg-btn.on, .seg-btn:hover { color: var(--text); }
.input { width: 100%; height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 400 14.5px var(--font-sans); outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--text-3); } .input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.sm { height: 36px; font-size: 13.5px; border-radius: var(--radius); }
.field { position: relative; display: block; flex: 1 1 360px; min-width: 0; } .field > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; } .field > .input { padding-left: 42px; }
.select { height: 40px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 400 14px var(--font-sans); width: 100%; }
.tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; }
.sq { width: 34px; height: 34px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sq.acc { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; line-height: 1.5; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .notice.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .notice.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; padding: 0; transition: background-color .15s, border-color .15s; }
.check.on { background: var(--accent); border-color: var(--accent); } .check:disabled { opacity: .35; cursor: default; }
.range { width: 100%; accent-color: var(--accent); }
.spin { animation: spin .9s linear infinite; }

/* ---------- top bar ---------- */
.topbar { height: 60px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); transition: background-color .3s, border-color .3s; }
.app[data-view="home"] .at-ws, .app[data-view="ws"] .at-home { display: none !important; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 600 16px var(--font-display); letter-spacing: 0; }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px -6px var(--accent); }
.crumb { display: flex; flex-direction: column; min-width: 0; } .crumb span { font-size: 11.5px; color: var(--text-3); } .crumb b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-mid { flex: 1; display: flex; justify-content: center; min-width: 0; }
.search { position: relative; width: 100%; max-width: 420px; display: block; } .search .ic { position: absolute; left: 12px; top: 10px; color: var(--text-3); } .search .input { height: 36px; padding: 0 44px 0 36px; font-size: 13.5px; background: var(--surface-2); border-radius: var(--radius); } .search .kbd { position: absolute; right: 8px; top: 8px; }
.match { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 6px; height: 36px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.match.warn { background: var(--warn-soft); color: var(--warn); padding-left: 12px; }
.ring-anim { animation: ring 1.4s var(--ease-out) both; }
.vr { width: 1px; height: 24px; background: var(--line-2); margin: 0 2px; flex: none; }

/* ---------- home ---------- */
.home { flex: 1; min-height: 0; }
.how { margin: 10px 0 0; padding-left: 22px; color: var(--text-2); font-size: 13px; line-height: 1.7; }
/* pipeline */
.pipe { padding: 18px 20px; overflow: hidden; } .pipe-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-weight: 600; } .pipe-head .time { margin-left: auto; color: var(--text-3); font: 400 12.5px var(--font-mono); }
.pipe-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pipe-steps > div { display: flex; flex-direction: column; gap: 8px; } .pipe-steps .bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; position: relative; }
.pipe-steps .bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transition: transform .6s ease; } .pipe-steps .bar .shimmer { position: absolute; inset: 0; }
.pipe-steps b { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; } .pipe-steps small { font-size: 12px; color: var(--text-3); }
.pipe-steps .todo b { color: var(--text-3); } .pipe-steps .done b { color: var(--ok); }
.pipe-note { margin-top: 14px; font-size: 12.5px; color: var(--text-3); }
.pipe-msg { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; padding: 18px 20px; } .pipe-msg .body { flex: 1 1 300px; min-width: 0; } .pipe-msg .body b { display: block; font-weight: 600; } .pipe-msg .body span { color: var(--text-2); font-size: 13.5px; }
.pipe-msg .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pipe-msg details { margin-top: 8px; font-size: 12px; color: var(--text-3); } .pipe-msg summary { cursor: pointer; } .pipe-msg code { display: block; margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--code); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); }
.pipe-msg .big { width: 38px; height: 38px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; flex: none; } .pipe-msg.err { border-color: var(--bad-soft); } .pipe-msg.err .big { background: var(--bad-soft); color: var(--bad); } .pipe-msg.fin { border-color: var(--ok-soft); align-items: center; } .pipe-msg.fin .big { background: var(--ok-soft); color: var(--ok); border-radius: 50%; }
.shimmer { background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
/* library */
/* batch bar, toasts */
.batchbar { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; background: var(--surface); border-radius: 14px; box-shadow: var(--pop); z-index: 20; animation: scaleInC .32s var(--ease-pop) both; max-width: calc(100% - 24px); }
.toasts { position: absolute; top: 72px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; } .toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--pop); font-size: 13.5px; animation: scaleIn .32s var(--ease-pop) both; } .toast .ic { color: var(--ok); } .toast.bad .ic { color: var(--bad); }

/* ---------- screen view ---------- */
.ws { flex: 1; min-height: 0; display: flex; position: relative; }
.panel { position: relative; flex: none; background: var(--surface); display: flex; flex-direction: column; min-height: 0; overflow: hidden; transition: background-color .3s, border-color .3s; }
.panel.left { width: var(--lw, 324px); border-right: 1px solid var(--line); } .panel.right { width: var(--rw, 340px); border-left: 1px solid var(--line); } .panel.closed { display: none; }
.grip { position: absolute; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 4; } .grip:hover, .grip.drag { background: var(--accent-soft); } .left .grip { right: 0; } .right .grip { left: 0; }
.pbody { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
.tabs { display: flex; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-3); font: 500 13.5px var(--font-sans); cursor: pointer; transition: color .15s, border-color .2s; }
.tab:hover { color: var(--text); } .tab.on { color: var(--text); border-bottom-color: var(--accent); }
.pad { padding: 12px; } .findbox { position: sticky; top: 0; background: var(--surface); padding: 12px 12px 8px; z-index: 1; }
.tree { padding: 0 8px 8px; }
.row-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font: 400 13.5px var(--font-sans); cursor: pointer; text-align: left; transition: background-color .12s; }
.row-btn:hover { background: var(--surface-2); } .row-btn.on { background: var(--accent-soft); }
.row-btn .chev { width: 14px; color: var(--text-3); transition: transform .2s; display: inline-flex; flex: none; } .row-btn .chev.open { transform: rotate(90deg); }
.row-btn .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .row-btn .n { font: 400 12px var(--font-mono); color: var(--text-3); } .row-btn .wdot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); flex: none; } .legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--k); }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 12px 0; }
.agrid { padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-auto-rows: max-content; gap: 10px; }
.acard { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); overflow: hidden; padding: 0; text-align: left; display: flex; flex-direction: column; cursor: pointer; color: inherit; transition: border-color .15s; } .acard:hover { border-color: var(--line-2); }
.acard .th { aspect-ratio: 1 / 1; padding: 12px; background-color: var(--canvas); background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 10px 10px; } .acard img { width: 100%; height: 100%; object-fit: contain; display: block; }
.acard .cap { padding: 8px 10px; } .acard b { display: block; font: 500 11.5px var(--font-mono); word-break: break-all; } .acard small { color: var(--text-3); font-size: 11.5px; }
.clist { padding: 12px; display: flex; flex-direction: column; gap: 10px; } .ctile { display: flex; gap: 10px; align-items: flex-start; } .ctile .ic { margin-top: 1px; color: var(--warn); } .ctile.info .ic { color: var(--accent-text); } .ctile.fine .ic { color: var(--ok); }
.ctile b { display: block; font-weight: 600; font-size: 13.5px; } .ctile p { color: var(--text-2); font-size: 12.5px; margin: 2px 0 8px; }
/* canvas */
.vp { flex: 1; min-width: 0; position: relative; overflow: hidden; outline: none; cursor: grab; touch-action: none; transition: background-color .3s; } .vp.panning { cursor: grabbing; } .vp, .vp * { user-select: none; -webkit-user-select: none; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: flex; gap: 110px; align-items: flex-start; will-change: transform; }
.fr { position: relative; display: flex; flex-direction: column; flex: none; }
.fl { position: absolute; left: 0; right: 0; bottom: 100%; overflow: hidden; font-size: calc(12.5px / var(--z, 1)); line-height: 1.3; padding-bottom: calc(8px / var(--z, 1)); color: var(--text-3); white-space: nowrap; display: flex; gap: calc(7px / var(--z, 1)); align-items: center; }
.fl > * { flex: none; } .fl b { color: var(--text); font-weight: 600; } .fl .dim { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); } .fl .chip { height: calc(20px / var(--z, 1)); font-size: calc(11.5px / var(--z, 1)); padding: 0 calc(8px / var(--z, 1)); gap: calc(5px / var(--z, 1)); } .fl .dotc { width: calc(6px / var(--z, 1)); height: calc(6px / var(--z, 1)); }
.fb { position: relative; background: #000; border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6), 0 0 0 1px var(--line); overflow: hidden; } .fb.pick { box-shadow: 0 0 0 calc(3px / var(--z, 1)) var(--accent), 0 30px 60px -30px rgba(0,0,0,.6); }
.fb img, .fb iframe { position: absolute; left: 0; top: 0; display: block; border: 0; pointer-events: none; }
.ov { position: absolute; inset: 0; pointer-events: none; }
.hl { position: absolute; box-sizing: border-box; border: calc(2px / var(--z, 1)) solid var(--accent); border-radius: calc(3px / var(--z, 1)); } .hl.hov { border-width: calc(1.5px / var(--z, 1)); border-color: var(--accent-hover); } .hl.ghost { border-style: dashed; opacity: .7; } .hl.issue { border-color: var(--bad); }
.tag { position: absolute; background: var(--accent); color: var(--accent-ink); font: 500 calc(11px / var(--z, 1)) var(--font-mono); white-space: nowrap; padding: calc(2px / var(--z, 1)) calc(6px / var(--z, 1)); border-radius: calc(4px / var(--z, 1)); transform: translateY(calc(4px / var(--z, 1))); }
.rz { position: absolute; right: 0; bottom: 0; width: calc(26px / var(--z, 1)); height: calc(26px / var(--z, 1)); background: var(--accent); cursor: nwse-resize; pointer-events: auto; border-radius: calc(8px / var(--z, 1)) 0 0 0; }
.split-line { position: absolute; top: 0; bottom: 0; width: calc(2px / var(--z, 1)); background: #fff; box-shadow: 0 0 0 calc(1px / var(--z, 1)) rgba(0,0,0,.4); }
.hint { position: absolute; left: 16px; top: 12px; margin: 0; color: var(--text-3); font-size: 12.5px; pointer-events: none; max-width: 70%; display: flex; gap: 6px; align-items: center; }
.float { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 5px; background: var(--surface); border-radius: 14px; box-shadow: var(--pop); max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: center; cursor: default; }
.float .icon-btn { width: 32px; height: 32px; } .float .z { min-width: 50px; text-align: center; font: 500 12.5px var(--font-mono); color: var(--text-2); } .float .sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; } .float label { display: flex; align-items: center; gap: 8px; padding: 0 8px; color: var(--text-2); font-size: 12.5px; } .float .range { width: 130px; }
/* inspector */
.sec { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; } .sec:last-child { border-bottom: 0; }
.sec h2 { font-size: 15px; font-weight: 600; } .sec p { color: var(--text-2); font-size: 13px; line-height: 1.5; } .sec .hd { display: flex; align-items: center; gap: 10px; } .sec .hd .grow b { display: block; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sec .hd .grow span { color: var(--text-3); font-size: 12.5px; }
.sec .lh { display: flex; align-items: center; justify-content: space-between; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .stat { display: flex; gap: 10px; align-items: center; padding: 10px 12px; } .stat b { display: block; font: 600 17px var(--font-mono); line-height: 1.2; } .stat span { color: var(--text-2); font-size: 12px; }
.plist { display: flex; flex-direction: column; gap: 2px; } .plist .row-btn { flex-wrap: wrap; min-height: 38px; padding: 4px 8px; } .plist .track { flex: 1 1 100%; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-left: 30px; } .plist .track i { display: block; height: 100%; background: var(--kind-prefab); transform-origin: left; animation: grow .9s var(--ease-out) both; }
.anch { display: flex; gap: 14px; align-items: center; } .anch .g { display: grid; grid-template-columns: repeat(3, 20px); gap: 3px; padding: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); flex: none; } .anch .g i { width: 20px; height: 20px; border-radius: 4px; background: var(--surface-3); } .anch .g i.on { background: var(--k); }
.anch .g.lay { display: flex; width: 78px; height: 78px; align-items: center; justify-content: center; text-align: center; color: var(--text-3); font-size: 11.5px; line-height: 1.3; }
.code { margin: 0; padding: 10px 12px; background: var(--code); border: 1px solid var(--line); border-radius: var(--radius); font: 400 12px/1.7 var(--font-mono); white-space: pre-wrap; word-break: break-word; color: var(--text-2); } .code b { color: var(--text); font-weight: 500; } .code .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; box-shadow: 0 0 0 1px var(--line-2); }
.form { display: grid; grid-template-columns: 112px 1fr; gap: 10px; align-items: center; font-size: 13px; } .form > span:nth-child(odd), .form > label { color: var(--text-3); }
table.scal { width: 100%; border-collapse: collapse; font-size: 13px; } .scal th { color: var(--text-3); font-weight: 500; text-align: right; padding: 4px 6px; font-size: 12px; } .scal th:first-child { text-align: left; }
.scal td { padding: 8px 6px; text-align: right; border-top: 1px solid var(--line); font-family: var(--font-mono); color: var(--ok); } .scal td:first-child { text-align: left; font-family: var(--font-sans); color: var(--text); } .scal td.bad { color: var(--bad); font-weight: 600; } .scal tbody tr { cursor: pointer; } .scal tr.on td { background: var(--accent-soft); } .scal tbody tr:hover td { background: var(--surface-2); } .scal tr.on:hover td { background: var(--accent-soft); }

/* ---------- modals, drawer ---------- */
dialog { color: var(--text); font: 400 14px/1.45 var(--font-sans); }
dialog::backdrop { background: rgba(5,7,12,.55); backdrop-filter: blur(6px); animation: fade .25s ease both; }
.modal { border: 0; padding: 0; border-radius: var(--radius-xl); width: min(980px, 94vw); background: var(--surface); box-shadow: var(--pop); } .modal.narrow { width: min(760px, 94vw); }
.modal[open] { display: flex; flex-direction: column; max-height: min(92vh, 100dvh - 32px); overflow: hidden; margin: auto; animation: scaleIn .32s var(--ease-pop) both; }
.modal > header, .drawer > header { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 20px; border-bottom: 1px solid var(--line); flex: none; } .modal > header > div, .drawer > header > div { flex: 1; min-width: 0; } .modal h2, .drawer h2 { font-size: 16px; font-weight: 600; } .modal > header p, .drawer > header p { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; } .ck i { width: 20px; height: 20px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--ok-soft); color: var(--ok); } .ck i.w { background: var(--warn-soft); color: var(--warn); }
.batch-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 16px; flex: 1 1 auto; min-height: 0; } .batch-body .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .batch-body .acts { display: flex; gap: 8px; justify-content: flex-end; }
.drawer { border: 0; padding: 0; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(480px, 100vw); max-width: 100vw; background: var(--surface); box-shadow: var(--pop); }
.drawer[open] { display: flex; flex-direction: column; overflow: hidden; animation: slideIn .38s var(--ease-out) both; }
.drawer-body { flex: 1 1 auto; min-height: 0; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.set-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .3s; } .set-card.focus { box-shadow: 0 0 0 3px var(--accent); }
.set-head { display: flex; align-items: center; gap: 10px; } .set-head h3 { font-size: 14.5px; font-weight: 600; margin-right: auto; } .set-card p { color: var(--text-2); font-size: 13px; line-height: 1.5; } .set-card label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.set-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .set-row .input { flex: 999 1 200px; min-width: 0; height: 40px; font: 400 13px var(--font-mono); border-radius: var(--radius); } .set-row .btn { height: 40px; }
.set-msg { font-size: 12.5px; } .set-msg:empty { display: none; } .set-card ol { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; line-height: 1.7; }

/* ---------- motion ---------- */
.fade-up { animation: fadeUp .5s var(--ease-out) both; } .scale-in { animation: scaleIn .32s var(--ease-pop) both; } .slide-in { animation: slideIn .38s var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes scaleInC { from { opacity: 0; transform: translateX(-50%) scale(.96) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes ring { from { stroke-dashoffset: 94.25; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------- narrow ---------- */
@media (max-width: 980px) {
  .hide-sm { display: none !important; }
  .panel { position: absolute; top: 0; bottom: 0; z-index: 6; box-shadow: var(--pop); max-width: 88vw; } .panel.left { left: 0; } .panel.right { right: 0; } .grip { display: none; }
  .pipe-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lib-hint { display: none; } .home-wrap { padding: 20px 16px 120px; } .topbar { padding: 0 10px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* fixes after first review */
.field > span:first-child { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; display: inline-flex; }
.field > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.findbox .field > .input { padding-left: 36px; }
.search > span:first-child { position: absolute; left: 12px; top: 10px; color: var(--text-3); display: inline-flex; } .search .ic { position: static; }
.label { white-space: nowrap; }
.tabs { gap: 14px; padding: 0 14px; overflow: hidden; } .tab { font-size: 13px; gap: 5px; flex: none; }
/* a file input that is invisible but still clickable through its label (display:none inputs do not open in every browser) */
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
label.dropzone { position: relative; } label.dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.pipe-head .btn { margin-left: 12px; }

/* detections */
.hl.content { border: calc(1.5px / var(--z, 1)) dashed var(--kind-prefab, var(--accent)); background: color-mix(in srgb, var(--kind-prefab, var(--accent)) 6%, transparent); border-radius: 0; pointer-events: none; }
.row-btn .tg { font-size: 10.5px; line-height: 1; padding: 3px 5px; border-radius: 5px; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line); flex: none; }
.row-btn:disabled { cursor: default; opacity: 1; }

/* model picker on the add card */
.model-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.model-row label { font-weight: 500; }
.model-row .select.sm { width: auto; min-width: 190px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.model-row .t3 { font-size: 12.5px; }

/* other AI providers in Settings */
.prov { display: grid; gap: 8px; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--line); }
.prov h4 { margin: 0; font-size: 14px; font-weight: 600; }
.prov .t3 { font-size: 12.5px; margin: 0; }

.toplink { color: var(--text-2); font-size: 13.5px; text-decoration: none; padding: 6px 10px; border-radius: 8px; } .toplink:hover { background: var(--surface-2); color: var(--text); }

.dropzone.off { opacity: .5; pointer-events: none; }
.add .notice a { color: var(--accent-text); }

/* a screen whose build is running, failed or not started: the frame holds its place and says what is going on */
.match.bad { background: var(--bad-soft); color: var(--bad); }
.bspin { display: inline-flex; animation: spin .9s linear infinite; } .bspin.sm { margin-right: -2px; }
.fb.pending { background: var(--surface-2, #17171a); }
.skel { position: absolute; inset: 0; overflow: hidden; }
.skel i { position: absolute; background: color-mix(in srgb, var(--text) 9%, transparent); }
.skel.on i { background: linear-gradient(100deg, color-mix(in srgb, var(--text) 7%, transparent) 30%, color-mix(in srgb, var(--text) 16%, transparent) 50%, color-mix(in srgb, var(--text) 7%, transparent) 70%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.bpanel { position: absolute; left: 0; top: 0; z-index: 5; cursor: default; width: min(360px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 22px 22px 20px; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 24px 48px -24px rgba(0,0,0,.55); font-size: 13.5px; line-height: 1.45; pointer-events: auto; }
.bpanel b { font-size: 15px; font-weight: 600; } .bpanel p { margin: 0; color: var(--text-2); overflow-wrap: anywhere; } .bpanel .dim { color: var(--text-3); font-size: 12.5px; } .bpanel .btn { margin-top: 6px; }
.bpanel .bicon, .bpanel .bspin { color: var(--accent); } .bpanel.bad .bicon { color: var(--bad); }
.tile.bad b { color: var(--bad); }
@media (prefers-reduced-motion: reduce) { .skel.on i, .bspin { animation: none; } }



/* ================= home: hero, screens, importer ================= */
.home-wrap { max-width: 1320px; margin: 0 auto; padding: 44px 28px 120px; display: flex; flex-direction: column; gap: 44px; }
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.home h1 { font-size: clamp(34px, 4.1vw, 58px); line-height: 1.02; letter-spacing: -.038em; font-weight: 650; text-wrap: balance; }
.lead { max-width: 34em; color: var(--text-2); font-size: 16px; line-height: 1.5; }
.add { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.add-row { display: flex; gap: 10px; flex-wrap: wrap; } .add-row .input { height: 48px; } .add-row .btn-lg { height: 48px; }
.dropzone { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; color: var(--text-2); font-size: 13.5px; border: 1px dashed var(--line-2); border-radius: var(--radius); transition: border-color .2s, background-color .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); } .dropzone small { color: var(--text-3); font-size: 12.5px; }
.add-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; font-size: 13px; }
/* the stage: one real screen, as designed on the left of the line and as planned on the right, next to what Unity gets */
/* screens */
.lib-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; } .lib-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; } .filters { display: flex; gap: 6px; margin-left: 8px; flex-wrap: wrap; } .lib-hint { margin-left: auto; font-size: 12.5px; color: var(--text-3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.shot { position: relative; display: flex; flex-direction: column; min-width: 0; }
.shot .open { display: block; width: 100%; height: 232px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; cursor: pointer; background-color: var(--canvas); transition: border-color .15s, transform .15s; }
.shot .open:hover { border-color: var(--line-2); transform: translateY(-2px); } .shot.picked .open { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.shot .open img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.shot .cap { display: flex; flex-direction: column; gap: 3px; padding: 10px 2px 0; min-width: 0; }
.shot .ttl-row { display: flex; align-items: center; gap: 4px; min-height: 26px; } .shot .ttl { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot .ttl-row .icon-btn { width: 26px; height: 26px; border-radius: 7px; opacity: 0; } .shot:hover .icon-btn, .shot .icon-btn:focus-visible { opacity: 1; } @media (hover: none) { .shot .ttl-row .icon-btn { opacity: 1; } }
.shot .ttl-row .input { height: 28px; padding: 0 8px; font-size: 13.5px; border-radius: 7px; }
.shot .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; } .shot .meta span:first-child { overflow: hidden; text-overflow: ellipsis; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); } .state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; } .state.ok { color: var(--ok); } .state.warn { color: var(--warn); } .state.bad { color: var(--bad); }
.shot .check { position: absolute; top: 10px; left: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.shot .cap .btn { align-self: flex-start; margin-top: 4px; }
.empty { grid-column: 1 / -1; padding: 28px; border: 1px dashed var(--line-2); border-radius: var(--radius-md); color: var(--text-2); text-align: center; }
@media (max-width: 1080px) { .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
@media (max-width: 980px) { .home-wrap { padding: 24px 16px 120px; gap: 32px; } }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .shot .open { height: 190px; } }

/* ================= export dialog: settings in groups, package as a tree, actions always in view ================= */
.modal.export { width: min(1060px, 94vw); }
.x-cols { display: flex; flex-wrap: wrap; flex: 1 1 auto; min-height: 0; }
.x-main { flex: 999 1 540px; min-width: 0; padding: 18px 20px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.x-grp { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); } .x-grp.wide { grid-column: 1 / -1; }
.x-grp > h3 { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: 600; } .x-grp > h3 small { font-weight: 400; font-size: 12.5px; color: var(--text-3); }
.x-grp .note { color: var(--text-3); font-size: 12.5px; line-height: 1.45; } .x-grp .note:empty { display: none; }
.x-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; } .fld > label, .fld > .lb { font-size: 12.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; } .fld > small { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; line-height: 1.4; } .fld > small.bad-t { color: var(--bad); }
.fld .select { height: 36px; font-size: 13.5px; } .fld .inl { display: flex; align-items: center; gap: 8px; min-width: 0; } .fld .inl .input { min-width: 0; } .fld .inl .t3 { font-size: 12.5px; flex: none; }
.ext { flex: none; color: var(--text-3); font: 400 13px var(--font-mono); }
.x-side { flex: 1 1 270px; min-width: 0; padding: 18px 18px 20px; background: var(--surface-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.x-side h3 { font-size: 13.5px; font-weight: 600; }
.ptree, .ptree ul { list-style: none; margin: 0; padding: 0; } .ptree { font-size: 12.5px; } .ptree ul { margin-left: 9px; border-left: 1px solid var(--line-2); }
.ptree .r { display: flex; align-items: center; gap: 7px; min-height: 28px; min-width: 0; } .ptree ul .r { padding-left: 12px; position: relative; } .ptree ul .r::before { content: ''; position: absolute; left: 0; top: 50%; width: 8px; border-top: 1px solid var(--line-2); }
.ptree .r b { font: 500 12.5px var(--font-mono); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ptree .r .ic { color: var(--k, var(--text-3)); } .ptree .r small { margin-left: auto; padding-left: 8px; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.x-foot { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.x-foot .st { flex: 1 1 240px; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.4; color: var(--text-2); } .x-foot .st.ok { color: var(--ok); } .x-foot .st.bad { color: var(--bad); } .x-foot .st:empty { visibility: hidden; }
.x-foot .btn { height: 40px; }
@media (max-width: 700px) { .x-main, .x-fields { grid-template-columns: minmax(0, 1fr); } .x-side { border-left: 0; border-top: 1px solid var(--line); } }

/* the screen's name in the top bar: one line, double-click to rename */
.crumb { flex-direction: row; align-items: baseline; gap: 7px; white-space: nowrap; } .crumb span { font-size: 13.5px; } .crumb b { cursor: text; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; } .crumb b:hover { background: var(--surface-2); }
.crumb .input { width: min(260px, 40vw); height: 32px; align-self: center; }
.hero:has(.stage[hidden]) { grid-template-columns: minmax(0, 720px); }

/* ================= workspace: layers | canvas | inspector ================= */
.app[data-view="ws"] .topbar { height: 52px; gap: 8px; padding: 0 12px; }
.app[data-view="ws"] .topbar .btn { height: 32px; padding: 0 12px; font-size: 13px; } .app[data-view="ws"] .topbar .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
.app[data-view="ws"] .topbar .btn-primary { box-shadow: none; }
.topbar .seg { --sp: 3px; padding: 3px; border-radius: 9px; } .topbar .seg-ind { top: 3px; bottom: 3px; left: 3px; border-radius: 7px; } .topbar .seg-btn { height: 26px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.match { height: 28px; padding: 0 10px 0 6px; font-size: 12.5px; border-radius: 8px; } .match.warn { padding-left: 10px; background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.label { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--text-2); font-weight: 600; }
/* panels */
.tabs { gap: 0; padding: 0 6px; } .tab { height: 38px; padding: 0 8px; font-size: 13px; gap: 6px; } .tab .count { height: 16px; min-width: 18px; font-size: 11px; padding: 0 5px; }
.findbox { padding: 8px 8px 6px; } .findbox .input.sm { height: 30px; font-size: 13px; border-radius: 8px; background: var(--surface-2); border-color: transparent; } .findbox .input.sm:focus { border-color: var(--accent); background: var(--surface); box-shadow: none; }
.findbox .field > .ic { left: 10px; } .findbox .field > .input { padding-left: 32px; }
.tree { padding: 0 6px 8px; }
.row-btn { min-height: 28px; gap: 6px; padding: 0 6px; font-size: 13px; border-radius: 6px; } .row-btn .kindsq { width: 18px; height: 18px; border-radius: 5px; } .row-btn .kindsq svg { width: 12px; height: 12px; }
.row-btn.on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.row-btn .chev { height: 20px; align-items: center; justify-content: center; border-radius: 4px; cursor: pointer; } .row-btn .chev:hover { background: var(--surface-3); color: var(--text); }
.row-btn .input.sm { flex: 1; min-width: 0; height: 22px; padding: 0 6px; font-size: 13px; border-radius: 5px; }
.row-btn .n { font-size: 11.5px; }
.legend { gap: 4px 10px; padding: 8px 12px; font-size: 11.5px; } .legend i { width: 7px; height: 7px; border-radius: 2px; }
.sec { padding: 14px; gap: 8px; } .sec h2 { font-size: 13.5px; } .sec .hd .grow b { font-size: 14px; cursor: text; } .sec .hd { gap: 8px; } .sec .hd .icon-btn { width: 28px; height: 28px; border-radius: 7px; }
.sec .hd .input.sm { height: 28px; padding: 0 8px; font-size: 14px; font-weight: 600; border-radius: 7px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 9px 11px; background: var(--surface); } .stat b { font: 600 16px var(--font-sans); letter-spacing: -.01em; } .stat span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.sec .tile { padding: 10px 12px; border-radius: var(--radius); } .plist .row-btn { min-height: 30px; }
.code { font-size: 11.5px; line-height: 1.65; border-radius: 8px; }
/* canvas: flat, frames as plain artboards, one status bar */
.fb { border-radius: 2px; box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px -24px rgba(0,0,0,.5); } .fb.pick { box-shadow: 0 0 0 calc(2px / var(--z, 1)) var(--accent); }
.fl { font-size: calc(12px / var(--z, 1)); padding-bottom: calc(6px / var(--z, 1)); } .fl b { font-weight: 500; color: var(--text-2); }
.world { gap: 96px; }
.tag { border-radius: calc(3px / var(--z, 1)); }
.vbar { position: absolute; left: 0; right: 0; bottom: 0; height: 36px; display: flex; align-items: center; gap: 12px; padding: 0 6px 0 12px; background: var(--surface); border-top: 1px solid var(--line); cursor: default; z-index: 3; }
.vbar .hint { position: static; flex: 1; min-width: 0; max-width: none; margin: 0; display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.vbar .hint .ic { flex: none; }
.vbar .float { position: static; transform: none; flex: none; max-width: none; flex-wrap: nowrap; padding: 0; gap: 2px; background: none; box-shadow: none; border-radius: 0; }
.vbar .float .icon-btn { width: 28px; height: 28px; border-radius: 7px; } .vbar .float .btn.z { min-width: 48px; border-color: transparent; background: none; font: 500 12px var(--font-mono); color: var(--text-2); } .vbar .float .btn.z:hover { background: var(--surface-2); color: var(--text); } .vbar .float .sep { height: 16px; margin: 0 6px; } .vbar .float .btn-sm { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.vbar .float .seg { --sp: 2px; padding: 2px; border-radius: 8px; } .vbar .float .seg-ind { top: 2px; bottom: 2px; left: 2px; border-radius: 6px; } .vbar .float .seg-btn { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.vbar .float label { font-size: 12px; padding: 0 4px; gap: 6px; } .vbar .float .range { width: 84px; }
@media (max-width: 760px) { .vbar .hint { display: none; } .vbar { justify-content: flex-end; overflow-x: auto; } }
.fl b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rz { width: calc(14px / var(--z, 1)); height: calc(14px / var(--z, 1)); border-radius: calc(4px / var(--z, 1)) 0 0 0; }
/* panel handles: on the edge of each panel, pointing the way the panel moves */
.edge { position: absolute; top: 50%; z-index: 7; width: 16px; height: 52px; margin-top: -26px; padding: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-3); cursor: pointer; transition: color .15s, background-color .15s, width .15s; }
.edge:hover { color: var(--text); background: var(--surface-2); width: 20px; }
.edge.l { left: 0; border-left: 0; border-radius: 0 8px 8px 0; } .edge.r { right: 0; border-right: 0; border-radius: 8px 0 0 8px; }
.ws.left-open .edge.l { left: var(--lw, 324px); } .ws.right-open .edge.r { right: var(--rw, 340px); }
@media (max-width: 980px) { .ws.left-open .edge.l { left: min(var(--lw, 324px), 88vw); } .ws.right-open .edge.r { right: min(var(--rw, 340px), 88vw); } }
/* rulers along the top and left of the canvas, in design units from the first frame's corner */
.ruler { display: none; position: absolute; z-index: 2; background: var(--surface); pointer-events: none; }
.vp.rulers .ruler { display: block; }
.ruler.h { left: 20px; top: 0; width: calc(100% - 20px); height: 20px; box-shadow: 0 1px 0 var(--line); }
.ruler.v { left: 0; top: 20px; width: 20px; height: calc(100% - 20px); box-shadow: 1px 0 0 var(--line); }
.ruler.c { left: 0; top: 0; width: 20px; height: 20px; z-index: 3; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.vbar .float .icon-btn.on { color: var(--accent-text); background: var(--accent-soft); }
/* with rulers on, the layers handle sits just past the left ruler instead of on top of it */
.ws.has-rulers .edge.l { margin-left: 20px; }

/* the importer download: in the top bar of the home page, in reach from the first moment */
.getimp { height: 34px; padding: 0 12px; font-size: 13px; gap: 7px; } .getimp .t3 { font-weight: 400; font-size: 12px; }
/* home footer: what the app is, where to read more, who made it */
.foot { display: flex; flex-wrap: wrap; gap: 20px 48px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.foot-about { flex: 1 1 340px; max-width: 520px; display: flex; flex-direction: column; gap: 8px; } .foot-about > b { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 14px; } .foot-about .mark { width: 22px; height: 22px; border-radius: 7px; box-shadow: none; } .foot-about p { line-height: 1.55; }
.foot-links, .foot-credit { display: flex; flex-direction: column; gap: 8px; } .foot-credit { margin-left: auto; } .foot-credit b { color: var(--text); font-weight: 600; }
.foot a { color: var(--text-2); text-decoration: none; } .foot a:hover { color: var(--accent-text); text-decoration: underline; }
@media (max-width: 700px) { .foot-credit { margin-left: 0; } }
/* account: the button in the top bar, its menu, the accounts dialog */
.userbtn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 4px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 13px var(--font-sans); cursor: pointer; max-width: 180px; white-space: nowrap; }
.userbtn:hover { background: var(--surface-2); } .userbtn span:last-child { overflow: hidden; text-overflow: ellipsis; }
.ava { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 12.5px; }
.usermenu { position: absolute; top: 54px; right: 12px; z-index: 40; width: 250px; padding: 6px; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--pop); display: flex; flex-direction: column; gap: 2px; }
.usermenu .who { display: flex; flex-direction: column; gap: 3px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); min-width: 0; } .usermenu .who span { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.usermenu .row-btn { min-height: 34px; gap: 10px; } .usermenu .row-btn .ic { color: var(--text-3); }
@media (max-width: 980px) { .userbtn { padding: 0 4px; } }
.ulist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.urow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-top: 1px solid var(--line); } .urow:first-child { border-top: 0; } .urow.off .grow, .urow.off .ava { opacity: .55; }
.urow .grow { display: flex; flex-direction: column; min-width: 160px; font-size: 13px; } .urow .grow b { font-weight: 600; } .urow .grow span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; } .urow .grow .t3 { font-size: 12px; color: var(--text-3); }
.urow .chip { height: 22px; font-size: 11.5px; } .uacts { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; padding-left: 40px; }
#passBody .acts { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Unity Preview: the stage, its states and the settings panel ---------- */
#pvCanvas { position: absolute; left: 0; top: 0; display: block; cursor: default; outline: none; touch-action: none; }
.fb.pv .ov { pointer-events: none; }
.fb.pv { background: #162238; }
.fb.pv .pv-under { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.fb.pv .pv-under { opacity: .28; filter: grayscale(.4); }
.pv-safe i { position: absolute; background: color-mix(in srgb, var(--accent) 16%, transparent); outline: calc(1px / var(--z, 1)) dashed var(--accent-text); pointer-events: none; }
.pv-lines i { position: absolute; box-sizing: border-box; border: calc(1px / var(--z, 1)) solid color-mix(in srgb, var(--kind-container) 70%, transparent); pointer-events: none; }
.pv-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -60%); z-index: 4; width: min(340px, calc(100% - 48px)); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; text-align: center; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--pop); cursor: default; }
.pv-card b { font-size: 14.5px; font-weight: 600; } .pv-card p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.5; } .pv-card .mono { font: 400 12px var(--font-mono); color: var(--text-3); }
.pv-card .sq { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); } .pv-card .sq.bad { background: var(--bad-soft); color: var(--bad); }
.pv-bar { width: 100%; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; } .pv-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }
.vbar .hint .pv-live { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 500; } .pv-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.vbar .hint > span, .vbar .hint > button { flex: none; } .vbar .hint { gap: 12px; } .vbar .hint .pv-warn { color: var(--warn); }
.vbar .hint .pv-chip { pointer-events: auto; height: 22px; padding: 0 8px; border: 0; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font: 500 12px var(--font-sans); cursor: pointer; }
.pv-form { grid-template-columns: 96px minmax(0, 1fr); gap: 8px 10px; } .pv-form .select.sm, .pv-form .input.sm { height: 30px; font-size: 13px; padding: 0 8px; border-radius: 8px; }
.select.sm { height: 30px; font-size: 13px; padding: 0 8px; border-radius: 8px; }
.pv-size { display: flex; align-items: center; gap: 6px; color: var(--text-3); } .pv-size .input { min-width: 0; flex: 1; font-family: var(--font-mono); font-size: 12.5px; }
.pv-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 2px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.pv-seg button { height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: 500 12px var(--font-sans); cursor: pointer; } .pv-seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.pv-check { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; cursor: pointer; } .pv-check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.pv-range { display: flex; align-items: center; gap: 8px; min-width: 0; } .pv-range .range { flex: 1; min-width: 0; } .pv-range .mono { font: 400 12px var(--font-mono); color: var(--text-2); min-width: 34px; text-align: right; }
.pv-fonts { display: flex; flex-direction: column; gap: 6px; } .pv-fonts > div, .pv-lib > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; min-width: 0; } .pv-fonts > div > span:first-child, .pv-lib > div > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-lib { font-size: 13px; color: var(--text-2); } .pv-lib summary { cursor: pointer; padding: 2px 0; } .pv-lib > div { padding: 4px 0; } .pv-lib > div > span { white-space: normal; }
.sec input:disabled, .sec select:disabled, .sec button:disabled { opacity: .5; cursor: default; }
/* workspace tile (cut corners, like the logo) and its menu; theme picker; the confirm banner; first steps */
.wswrap { position: relative; }
.wstile { display: inline-flex; align-items: center; gap: 8px; height: 34px; max-width: 220px; padding: 0 12px; border: 0; background: var(--surface-2); color: var(--text); font: 600 var(--t-13) var(--font-display); letter-spacing: .01em; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.wstile:hover:not(:disabled) { background: var(--surface-3); } .wstile:disabled { cursor: default; } .wstile .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wstile .ic { color: var(--text-3); flex: none; }
.wsmenu { top: 42px; left: 0; right: auto; width: 270px; }
.usermenu .grp { padding: 8px 8px 4px; font-size: var(--t-12); color: var(--text-3); }
.usermenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.usermenu a.row-btn { color: var(--text); text-decoration: none; }
.ws-row { min-height: 44px !important; } .ws-row .two { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; } .ws-row .two b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ws-row .two span { font-size: var(--t-12); color: var(--text-3); }
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 4px 4px; } .theme-seg .seg-btn { padding: 0 6px; height: 28px; font-size: var(--t-12); gap: 5px; border-radius: 7px; } .theme-seg .seg-btn.on { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.banner { align-items: center; margin-bottom: 18px; } .banner .btn { margin-left: auto; flex: none; }
#viewerNote { margin-top: 18px; }
.first { padding: 22px 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 14px; grid-column: 1 / -1; max-width: 640px; }
.first h3 { margin: 0; font: 600 var(--t-18) var(--font-display); }
.first .steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 12px; }
.first .steps li { counter-increment: st; display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.first .steps li::before { content: counter(st); grid-row: 1 / 3; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-ink); font: 700 var(--t-13) var(--font-display); clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.first .steps li b { grid-column: 2; } .first .steps li span { grid-column: 2; color: var(--text-2); font-size: var(--t-13); } .first .steps li .btn { grid-column: 3; grid-row: 1 / 3; }
@media (max-width: 700px) { .wstile { max-width: 150px; } .first .steps li { grid-template-columns: 30px 1fr; } .first .steps li .btn { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 6px; } }

/* AI thoughts: the screen's AI calls as a conversation, request then answer */
.tbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 12px 0; }
.tbar p { color: var(--text-2); font-size: 12.5px; margin: 0; }
.tlog { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tmsg { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tmsg.out { margin-right: 18px; border-left: 3px solid var(--accent); }
.tmsg.in { margin-left: 18px; background: var(--surface-2, var(--surface)); border-right: 3px solid var(--text-3, var(--line)); }
.tmsg.in.bad { border-right-color: var(--bad, #e5484d); }
.thead { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; } .thead span { color: var(--text-2); }
.tmeta { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 12px; }
.tmeta dt { color: var(--text-2); } .tmeta dd { margin: 0; font-family: var(--font-mono); overflow-wrap: anywhere; }
.tblock .lh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tblock pre { margin: 0; max-height: 280px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 11.5px/1.5 var(--font-mono); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.tfoot { display: flex; align-items: center; gap: 8px; } .tfoot span { color: var(--text-2); font-size: 12px; }
.terr { color: var(--bad, #e5484d); font-size: 12.5px; margin: 0; overflow-wrap: anywhere; }

/* ---------- the canvas column: view modes and build status sit on the canvas's own bar, not in the top bar ---------- */
.center { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.center > .vp { flex: 1; min-height: 0; }
.vtop { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 44px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.vtop::-webkit-scrollbar { display: none; }
.vtop .seg { --sp: 3px; padding: 3px; border-radius: 9px; flex: none; } .vtop .seg-ind { top: 3px; bottom: 3px; left: 3px; border-radius: 7px; } .vtop .seg-btn { height: 28px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.vtop .seg[hidden] + .match { margin-left: auto; }
.vtop .match { flex: none; }
/* the screen's name takes the room the modes left; the actions keep theirs */
.app[data-view="ws"] .top-mid { flex: 0 0 0; }
.app[data-view="ws"] .crumb { flex: 1 1 auto; min-width: 0; } .crumb b { min-width: 0; }
.topbar > .btn, .topbar > .icon-btn, .topbar > .userbtn, .topbar > .wswrap, .topbar > .brand { flex: none; }
/* the side panels' tabs share the panel's width; a long one scrolls instead of being cut */
.tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.tabs .tab { flex: none; white-space: nowrap; }
/* the tabs fill the panel; in a narrow panel the AI thoughts tab says "AI" (its full name is its tooltip) */
.panel { container-type: inline-size; }
.tabs .tab { flex: 1 0 auto; justify-content: center; }
.tab .tl-short { display: none; }
@container (max-width: 400px) { .tab .tl-full { display: none; } .tab .tl-short { display: inline; } }
.tab .count:empty { display: none; }
/* a narrow canvas: the view modes keep their icons (each name is its tooltip) and the build status stays in view */
.center { container-type: inline-size; }
@container (max-width: 600px) { .vtop .seg-btn .seg-l { display: none; } .vtop .seg-btn { padding: 0 12px; } }
@container (max-width: 380px) { .vtop .match svg + * { display: none; } }

/* ---------- a screen being worked on: its picture under a moving sheen, and one line saying what is happening ---------- */
.shot .open.busy { position: relative; cursor: default; display: grid; place-items: center; color: var(--text-3); }
.shot .open.busy img { opacity: .45; filter: grayscale(.4); }
.shot .open.busy .shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--accent) 14%, transparent) 50%, transparent 70%); background-size: 220% 100%; animation: sheen 1.6s linear infinite; pointer-events: none; }
.shot .open.busy.failed { color: var(--bad); background: var(--bad-soft); }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .shot .open.busy .shimmer { animation: none; } }
.jobline { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; min-width: 0; }
.jobline .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.jobline b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobline small { color: var(--text-3); font-size: 12px; line-height: 1.35; }
.jobline .time { font: 500 12px var(--font-mono); color: var(--text-3); flex: none; }
.jobline .btn-sm { flex: none; height: 26px; padding: 0 8px; font-size: 12px; }
.jobline.warn { background: var(--warn-soft); } .jobline.warn > .ic, .jobline.warn b { color: var(--warn); }
.jobline.bad { background: var(--bad-soft); align-items: flex-start; } .jobline.bad > .ic, .jobline.bad b { color: var(--bad); } .jobline.bad b { white-space: normal; }
.shot .acts { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
/* the step gets the whole width; time and Cancel sit under it */
.jobline { flex-wrap: wrap; row-gap: 6px; }
.jobline .grow { flex: 1 1 calc(100% - 24px); }
.jobline b { white-space: normal; }
.jobline .time { margin-left: 22px; }
.jobline .time + .btn-sm, .jobline > .btn-sm:last-child { margin-left: auto; }
.tbar .tacts { display: flex; gap: 6px; flex: none; }

/* ===== setup guide (guide.js) ===== */
.modal.guide { width: min(640px, 94vw); }
.guide .g-steps { list-style: none; margin: 0; padding: 10px 16px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; }
.guide .g-steps li { flex: 1; min-width: 0; }
.guide .g-steps button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: var(--radius-md); background: none; color: var(--text-3); font: 500 13px var(--font-sans); cursor: pointer; text-align: left; white-space: nowrap; }
.guide .g-steps button:hover { background: var(--surface-2); color: var(--text-2); }
.guide .g-steps .on button { background: var(--surface-2); color: var(--text); }
.guide .g-num { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font: 600 11.5px var(--font-mono); }
.guide .g-steps .on .g-num { background: var(--accent); color: #1a1205; }
.guide .g-steps .done .g-num { background: var(--ok-soft); color: var(--ok); }
.guide .g-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.guide .g-body > label { font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-bottom: -6px; }
.guide .g-lead { margin: 0; color: var(--text-2); line-height: 1.55; }
.guide .g-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.guide .g-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 13.5px var(--font-sans); cursor: pointer; text-align: left; }
.guide .g-pick button small { font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.guide .g-pick button:hover { border-color: var(--text-3); }
.guide .g-pick button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.guide .g-where { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.guide .g-where-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.guide .g-where ol { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 13px; line-height: 1.65; }
.guide .g-tip, .guide .g-safe { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.guide .g-tip .ic, .guide .g-safe .ic { flex: none; margin-top: 2px; }
.guide .g-model { display: flex; flex-direction: column; gap: 6px; } .guide .g-model:empty { display: none; } .guide .g-model label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.guide .g-done { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-md); background: var(--ok-soft); color: var(--ok); }
.guide .g-done b { color: var(--text); } .guide .g-done p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.guide .g-recap { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 13px; line-height: 1.7; } .guide .g-recap b { color: var(--text); font-weight: 600; }
.guide .g-nav { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex: none; }
.set-msg .spin, .gd-state .spin { display: inline-flex; vertical-align: -2px; margin-right: 6px; }
.add.g-point { border-radius: var(--radius-lg); animation: gPoint 1s ease-out 3; }
@keyframes gPoint { 0% { box-shadow: 0 0 0 0 rgba(255,178,36,.55); } 100% { box-shadow: 0 0 0 14px rgba(255,178,36,0); } }

/* the demo: a Figma window and the app side by side; everything is placed in % of the box, so the pointer path holds at any width */
.g-demo { position: relative; aspect-ratio: 560 / 240; border-radius: var(--radius-md); background: var(--bg); border: 1px solid var(--line); overflow: hidden; container-type: inline-size; font-family: var(--font-sans); flex: none; }
.g-demo * { box-sizing: border-box; }
.gd-figma, .gd-app { position: absolute; top: 6%; height: 88%; border-radius: 1.4cqw; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.gd-figma { left: 2%; width: 41%; }
.gd-app { left: 46%; width: 52%; }
.gd-bar { height: 12%; display: flex; align-items: center; gap: 1cqw; padding: 0 2cqw; border-bottom: 1px solid var(--line); font-size: 1.9cqw; color: var(--text-3); }
.gd-bar i { width: 1.2cqw; height: 1.2cqw; border-radius: 50%; background: var(--surface-3); }
.gd-bar span { margin-left: 1cqw; }
.gd-canvas { position: absolute; inset: 12% 0 0; background: var(--surface-2); }
.gd-frame { position: absolute; left: 22%; top: 12%; width: 40%; height: 76%; border-radius: .8cqw; background: #2E3B57; display: flex; flex-direction: column; gap: 6%; padding: 7% 9%; outline: 0 solid #0D99FF; animation: gdFrame 10s infinite; }
.gd-fh { height: 12%; width: 60%; border-radius: .4cqw; background: #F5C04A; }
.gd-fb { height: 22%; border-radius: .6cqw; background: rgba(255,255,255,.18); } .gd-fb.s { width: 70%; }
.gd-btn { margin-top: auto; height: 14%; border-radius: 3cqw; background: #5BD69A; }
.gd-menu { position: absolute; left: 50%; top: 32%; width: 46%; padding: 1cqw 0; border-radius: 1cqw; background: #1E1E1E; color: #eee; font-size: 1.75cqw; display: flex; flex-direction: column; box-shadow: 0 1cqw 3cqw rgba(0,0,0,.35); opacity: 0; animation: gdMenu 10s infinite; }
.gd-menu span { padding: .8cqw 2cqw; white-space: nowrap; } .gd-menu .hl { animation: gdHl 10s infinite; }
.gd-row { position: absolute; left: 4%; right: 4%; top: 8%; height: 16%; display: flex; gap: 2%; }
.gd-input { flex: 1; min-width: 0; display: flex; align-items: center; gap: 1.2cqw; padding: 0 1.6cqw; border-radius: 1cqw; border: 1px solid var(--line-2, var(--line)); background: var(--surface-2); color: var(--text-3); font-size: 1.8cqw; overflow: hidden; }
.gd-input .ic svg { width: 2.2cqw; height: 2.2cqw; }
.gd-type { white-space: nowrap; color: var(--text); clip-path: inset(0 100% 0 0); animation: gdType 10s infinite; }
.gd-go { flex: none; display: grid; place-items: center; padding: 0 2.4cqw; border-radius: 1cqw; background: var(--accent); color: #1a1205; font-weight: 600; font-size: 1.9cqw; animation: gdGo 10s infinite; }
.gd-card { position: absolute; left: 4%; right: 4%; top: 34%; height: 56%; display: flex; gap: 3%; padding: 3%; border-radius: 1.2cqw; border: 1px solid var(--line); background: var(--surface-2); opacity: 0; animation: gdCard 10s infinite; }
.gd-thumb { width: 26%; border-radius: .8cqw; background: #2E3B57; position: relative; overflow: hidden; }
.gd-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.gd-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6%; font-size: 1.9cqw; color: var(--text); position: relative; }
.gd-state { position: absolute; top: 34%; display: flex; align-items: center; gap: .8cqw; font-size: 1.75cqw; white-space: nowrap; }
.gd-state .ic svg { width: 2cqw; height: 2cqw; }
.gd-state.work { color: var(--text-2); animation: gdWork 10s infinite; } .gd-state.ok { color: var(--ok); opacity: 0; animation: gdOk 10s infinite; }
.gd-prog { position: absolute; left: 0; right: 0; bottom: 6%; height: 5%; border-radius: 1cqw; background: var(--surface-3); overflow: hidden; }
.gd-prog i { display: block; height: 100%; width: 0; background: var(--accent); animation: gdProg 10s infinite; }
.gd-cursor { position: absolute; left: 70%; top: 85%; color: var(--text); filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); animation: gdCursor 10s infinite; z-index: 2; }
.gd-cursor .ic svg { width: 3.4cqw; height: 3.4cqw; fill: var(--surface); }
@keyframes gdCursor { 0% { left: 70%; top: 85%; } 10%, 15% { left: 19%; top: 54%; } 21%, 27% { left: 31%; top: 52%; } 35%, 48% { left: 60%; top: 19%; } 56%, 60% { left: 88%; top: 19%; } 68%, 100% { left: 76%; top: 86%; } }
@keyframes gdFrame { 0%, 9% { outline-width: 0; } 10%, 30% { outline-width: .35cqw; } 31%, 100% { outline-width: 0; } }
@keyframes gdMenu { 0%, 14% { opacity: 0; transform: translateY(-1cqw); } 16%, 27% { opacity: 1; transform: none; } 30%, 100% { opacity: 0; } }
@keyframes gdHl { 0%, 20% { background: transparent; } 21%, 30% { background: #0D99FF; } 31%, 100% { background: transparent; } }
@keyframes gdType { 0%, 36% { clip-path: inset(0 100% 0 0); } 40%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes gdGo { 0%, 57% { transform: none; filter: none; } 58% { transform: scale(.92); filter: brightness(.9); } 61%, 100% { transform: none; } }
@keyframes gdCard { 0%, 60% { opacity: 0; transform: translateY(1.5cqw); } 63%, 97% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes gdWork { 0%, 85% { opacity: 1; } 86%, 100% { opacity: 0; } }
@keyframes gdOk { 0%, 85% { opacity: 0; } 87%, 100% { opacity: 1; } }
@keyframes gdProg { 0%, 61% { width: 0; } 86% { width: 100%; } 87%, 100% { width: 100%; background: var(--ok); } }
@media (prefers-reduced-motion: reduce) {
  .g-demo *, .add.g-point { animation: none !important; }
  .gd-type { clip-path: none; } .gd-card { opacity: 1; } .gd-state.work { opacity: 0; } .gd-state.ok { opacity: 1; } .gd-prog i { width: 100%; background: var(--ok); } .gd-cursor { display: none; }
}
@media (max-width: 560px) { .guide .g-steps li:not(.on) { flex: none; } .guide .g-steps li:not(.on) button > span:last-child { display: none; } .guide .g-body { padding: 16px; } }
/* the bar at the top while a call is slow (app.js busy()) */
.busybar { position: fixed; inset: 0 0 auto; height: 3px; z-index: 1000; overflow: hidden; background: var(--accent-soft); pointer-events: none; }
.busybar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--accent); animation: busybar 1.1s ease-in-out infinite; }
@keyframes busybar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .busybar::before { animation: none; width: 100%; opacity: .6; } }

/* ===== phones (app.js phone()): one slim bar, the rest in the ⋯ sheet; panels open from the bottom ===== */
.show-phone { display: none !important; }
.barsback[hidden] { display: none; }
.rot-up .ic svg, .rot-up svg { transform: rotate(-90deg); } .rot-down .ic svg, .rot-down svg { transform: rotate(90deg); }
dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 85dvh; border: 0; padding: 6px 8px calc(12px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: var(--surface); color: var(--text); overflow-y: auto; box-shadow: var(--pop); font: 400 14px/1.45 var(--font-sans); }
dialog.sheet[open] { animation: sheetUp .26s var(--ease-pop, ease) both; }
@keyframes sheetUp { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2, var(--line)); margin: 4px auto 8px; }
.sheet-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font: 500 15px var(--font-sans); text-decoration: none; text-align: left; cursor: pointer; }
.sheet-row:hover, .sheet-row:active { background: var(--surface-2); } .sheet-row:disabled { opacity: .5; }
.sheet-row .ic { color: var(--text-2); flex: none; } .sheet-row.warn .ic { color: var(--warn); }
.sheet-row small { margin-left: auto; color: var(--text-3); font-size: 12px; }
.sheet hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.sheet-head, .sheet-who { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px 10px; min-width: 0; }
.sheet-head b, .sheet-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sheet-head span, .sheet-who span { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.sheet-theme { padding: 6px 8px; } .sheet-theme .seg { width: 100%; }
@media (max-width: 640px) {
  .show-phone:not([hidden]) { display: inline-flex !important; } select.show-phone:not([hidden]) { display: block !important; }
  .topbar, .app[data-view="ws"] .topbar { height: 52px; gap: 6px; padding: 0 8px; }
  .topbar .getimp, .topbar .toplink, .topbar .vr, #openSettings, #userBtn, #userMenu, #rebuild, #figmaLink { display: none !important; }
  .app[data-view="ws"] .wswrap, .app[data-view="ws"] .top-mid, .crumb span { display: none; }
  .wstile { max-width: 52vw; }
  .app[data-view="ws"] .crumb { flex: 1; min-width: 0; }
  .crumb b { font-size: 14px; }
  .modesel { flex: none; width: auto; max-width: 36vw; height: 34px; }
  #moreBtn { flex: none; }
  .app[data-view="ws"] .vtop { display: none; }
  .app.bars-hidden .topbar { display: none; }
  .barsback { position: fixed; top: calc(8px + env(safe-area-inset-top)); right: 8px; z-index: 20; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--pop); }
  .edge { display: none !important; }
  .panel, .panel.left, .panel.right { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-width: none; height: min(62dvh, 560px); border: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; z-index: 30; box-shadow: 0 -12px 40px rgba(0,0,0,.28); animation: sheetUp .26s var(--ease-pop, ease) both; }
  .panel .tabs { padding-right: 48px; }
  .sheet-x { position: absolute; top: 6px; right: 8px; z-index: 2; }
  .vp { touch-action: none; }
}
