/* The Animation builder's studio (animstudio.js) — an editor over the stage in
   the manner of After Effects, in the house's cloth: white glass panels with
   hairlines, the maroon accent, gold for the keys. Top: the animation, its
   versions, Ask Claude, Variations, Blender. Middle: the tools rail, the
   viewer (the animation's own page on a checker, its picked layer outlined,
   its path in gold), the inspector. Bottom: the transport and the timeline. */
.as-studio {
  position: absolute; inset: 10px; z-index: 30; display: grid; grid-template-rows: auto minmax(0, 1fr) 248px; gap: 8px;
  animation: as-in .3s var(--ease-out) both;
}
.as-studio[hidden] { display: none; }
@keyframes as-in { from { opacity: 0; transform: translateY(8px); } }
body.as-on .lt-dock, body.as-on .ll-panel, body.as-on .hist-dock, body.as-on .lab-grip { visibility: hidden; }
.as-studio > div:not(.as-win) {
  min-width: 0; min-height: 0; background: var(--glass-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-rest), inset 0 1px 0 rgba(255, 255, 255, .8);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.as-gap { flex: 1; }
/* buttons: 29px circles and small pills, on the press contract */
.as-ib, .as-btn {
  display: inline-grid; place-items: center; flex: none; border: 1px solid var(--line-soft); background: var(--glass-2); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-rest);
  transition: transform .32s var(--ease-spring), box-shadow .32s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out), border-color .16s var(--ease-out);
}
.as-ib { width: 29px; height: 29px; padding: 0; border-radius: 50%; }
.as-ib svg { width: 14px; height: 14px; }
.as-btn { display: inline-flex; align-items: center; gap: 6px; height: 29px; padding: 0 11px; border-radius: 999px; font: 600 12px var(--sans); text-decoration: none; white-space: nowrap; }
.as-btn svg { width: 14px; height: 14px; }
.as-ib:hover, .as-btn:hover { transform: translateY(-1px); background: #fff; box-shadow: var(--shadow-lift); }
.as-ib:active, .as-btn:active { transform: translateY(1px) scale(.95); transition-duration: .06s; box-shadow: none; }
.as-ib:focus-visible, .as-btn:focus-visible, .as-tool:focus-visible, .as-fxb:focus-visible, .as-vchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.as-ib.primary, .as-btn.primary { background: var(--cta-grad); color: var(--on-cta, #fff); border-color: transparent; box-shadow: var(--bloom); }
.as-btn.on { background: var(--accent-soft); border-color: rgba(123, 30, 46, .35); color: var(--accent-deep); box-shadow: 0 0 10px rgba(123, 30, 46, .14); }
.as-btn.danger { color: var(--danger-ink, #A32B23); border-color: rgba(192, 58, 49, .3); background: rgba(192, 58, 49, .06); }
.as-btn:disabled, .as-fxb:disabled { opacity: .45; pointer-events: none; }

/* ---- the top bar ---- */
.as-top { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 10px; }
.as-mark { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--cta-grad); color: #fff; box-shadow: var(--bloom); }
.as-mark svg { width: 13px; height: 13px; }
.as-title { display: flex; flex-direction: column; min-width: 0; max-width: 230px; }
.as-title b { font: 700 13.5px var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-title span { font: 400 10.5px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-title span[data-dirty]::after { content: ' · saving…'; font-family: var(--sans); }
.as-versions { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 0 1 auto; overflow-x: auto; padding: 2px 4px; scrollbar-width: none; }
.as-vacts { display: flex; align-items: center; gap: 5px; flex: none; }
.as-vnow { flex: none; font: 700 10px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-deep); padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); }
.as-vchip {
  flex: none; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 24px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px dashed rgba(26, 26, 26, .28); background: rgba(255, 255, 255, .5); color: var(--ink); font: 600 11.5px var(--sans);
  transition: transform .32s var(--ease-spring), background .16s var(--ease-out), border-color .16s var(--ease-out);
}
.as-vchip:hover { transform: translateY(-1px); background: #fff; }
.as-vchip:active { transform: scale(.95); transition-duration: .06s; }
.as-vchip.on { border-style: solid; border-color: rgba(201, 154, 20, .8); background: rgba(245, 197, 24, .28); }
.as-ask { display: flex; align-items: center; gap: 4px; flex: 0 1 380px; min-width: 180px; padding: 2px 2px 2px 12px; border-radius: 999px; background: rgba(255, 255, 255, .75); border: 1px solid var(--line); }
.as-ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 30, 46, .12); background: #fff; }
.as-ask input { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; padding: 5px 0; font: 13px var(--sans); outline: none; }
.as-ask .as-ib { width: 27px; height: 27px; }
@media (max-width: 1500px) { .as-top .as-btn span { display: none; } .as-top .as-btn { width: 29px; padding: 0; justify-content: center; } .as-vacts .as-btn span { display: inline; } .as-vacts .as-btn { width: auto; padding: 0 10px; } }

/* ---- the middle: tools, viewer, inspector ---- */
.as-main { display: grid; grid-template-columns: 46px minmax(0, 1fr) 290px; gap: 0; overflow: hidden; }
.as-rail { display: flex; flex-direction: column; gap: 4px; padding: 8px 7px; border-right: 1px solid var(--line-soft); }
.as-tool {
  width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer;
  transition: transform .32s var(--ease-spring), background .16s var(--ease-out), color .16s var(--ease-out);
}
.as-tool svg { width: 16px; height: 16px; }
.as-tool:hover { background: rgba(26, 26, 26, .06); color: var(--ink); }
.as-tool:active { transform: scale(.92); transition-duration: .06s; }
.as-tool.on { background: var(--accent-soft); border-color: rgba(123, 30, 46, .3); color: var(--accent-deep); box-shadow: 0 0 10px rgba(123, 30, 46, .12); }
.as-tool[data-tool="hand"] { margin-top: auto; }
.as-view {
  position: relative; overflow: hidden; min-height: 0;
  background: repeating-conic-gradient(#ECEAE8 0 25%, #F7F6F5 0 50%) 50% / 18px 18px;
}
.as-frames { position: absolute; inset: 14px; display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); gap: 12px; }
.as-fbox { position: relative; min-width: 0; min-height: 0; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 18px 50px rgba(26, 26, 26, .22); border: 1px solid var(--line-soft); }
.as-fbox iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.as-fbox.is-version { box-shadow: 0 18px 50px rgba(26, 26, 26, .18), 0 0 0 2px rgba(245, 197, 24, .7); }
.as-flabel { position: absolute; z-index: 2; left: 8px; top: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(20, 20, 20, .78); color: #fff; font: 700 10px var(--sans); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.as-ov { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; cursor: default; }
.as-view[data-tool="hand"] .as-ov { pointer-events: none; }
.as-view[data-tool="pick"] .as-ov { cursor: cell; }
.as-view:is([data-tool="rect"], [data-tool="ellipse"], [data-tool="star"], [data-tool="pen"], [data-tool="path"]) .as-ov { cursor: crosshair; }
.as-ov-box { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.as-ov-tag { font: 700 10px var(--sans); fill: var(--accent-deep); paint-order: stroke; stroke: rgba(255, 255, 255, .9); stroke-width: 3px; }
.as-ov-path { fill: none; stroke: #C99A14; stroke-width: 2; stroke-dasharray: 5 5; }
.as-ov-pt { fill: #fff; stroke: #C99A14; stroke-width: 1.5; }
.as-ov-now { fill: #F5C518; stroke: #141414; stroke-width: 1.5; }
.as-ov-draw { fill: rgba(217, 119, 87, .18); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
polyline.as-ov-draw { fill: none; stroke-dasharray: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
polyline.as-ov-draw.is-path { stroke: #C99A14; stroke-dasharray: 5 5; }
.as-view-note { position: absolute; z-index: 4; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: rgba(20, 20, 20, .82); color: #fff; font: 600 11.5px var(--sans); pointer-events: none; white-space: nowrap; }
.as-view-note[hidden] { display: none; }
.as-insp { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line-soft); }
.as-tabs { flex: none; display: flex; gap: 2px; margin: 8px 10px 4px; padding: 2px; border-radius: 999px; background: rgba(26, 26, 26, .06); box-shadow: inset 0 2px 6px rgba(26, 26, 26, .08); }
.as-tabs button { flex: 1; height: 26px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 12px var(--sans); cursor: pointer; transition: background .16s var(--ease-out), color .16s var(--ease-out); }
.as-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-rest); }
.as-insp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 14px; overscroll-behavior: contain; }
.as-sec { padding: 10px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.as-sec:last-child { border-bottom: 0; }
.as-k { font: 700 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: baseline; gap: 6px; }
.as-k-sub { font: 400 11px var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); opacity: .8; }
.as-mono { font: 400 10.5px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-note { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.as-lead { padding: 14px 2px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.as-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.as-row.end { justify-content: flex-end; }
.as-insp input[type=text], .as-insp input[type=number], .as-insp select, .as-win input[type=text], .as-win textarea, .as-win select { width: 100%; padding: 5px 9px; font-size: 12.5px; border-radius: 9px; }
.as-prop { display: grid; grid-template-columns: 20px 1fr 78px 22px; align-items: center; gap: 6px; }
.as-prop label { font-size: 12px; color: var(--muted); }
.as-prop.has label { color: var(--ink); font-weight: 600; }
.as-prop input { text-align: right; font: 400 12px var(--mono) !important; padding: 3px 6px !important; }
.as-unit { font: 400 10.5px var(--mono); color: var(--muted); }
.as-kbtn { width: 20px; height: 20px; padding: 0; display: grid; place-items: center; border: 0; background: none; color: rgba(26, 26, 26, .4); cursor: pointer; border-radius: 6px; transition: color .16s var(--ease-out), transform .32s var(--ease-spring); }
.as-kbtn svg { width: 11px; height: 11px; }
.as-kbtn:hover { color: var(--accent); transform: scale(1.15); }
.as-kbtn.on { color: #C99A14; }
.as-prop.has .as-kbtn:not(.on) { color: var(--accent-deep); }
.as-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.as-grid2 label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); position: relative; }
.as-grid2 label .as-unit { position: absolute; right: 8px; bottom: 6px; }
.as-grid2 input[type=color] { width: 100%; height: 28px; padding: 2px; border-radius: 9px; }
.as-mini { position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 11px; cursor: pointer; }
.as-check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink); cursor: pointer; }
.as-grid2 label.as-check { flex-direction: row; align-self: end; padding-bottom: 6px; }
.as-check input { width: auto; flex: none; margin: 0; padding: 0; }
.as-foot { padding-top: 12px; }
.as-len { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.as-fx { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.as-fxb {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 9px; text-align: left; cursor: pointer;
  border-radius: 11px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .6); color: var(--ink);
  transition: transform .32s var(--ease-spring), box-shadow .32s var(--ease-out), background .16s var(--ease-out), border-color .16s var(--ease-out);
}
.as-fxb b { font: 700 12px var(--sans); }
.as-fxb span { font-size: 10.5px; line-height: 1.35; color: var(--muted); }
.as-fxb:hover { transform: translateY(-1px); background: #fff; border-color: rgba(123, 30, 46, .3); box-shadow: var(--shadow-lift); }
.as-fxb:active { transform: translateY(1px) scale(.97); transition-duration: .06s; box-shadow: none; }

/* ---- the timeline ---- */
.as-tl { display: flex; flex-direction: column; overflow: hidden; }
.as-transport { flex: none; display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); }
.as-transport .as-ib { width: 27px; height: 27px; box-shadow: none; }
.as-transport .as-play { width: 33px; height: 33px; margin: 0 2px; }
.as-time { margin-left: 10px; font: 500 15px var(--mono); color: var(--ink); letter-spacing: .02em; }
.as-frame { font: 400 11px var(--mono); color: var(--muted); }
.as-hint { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.as-zoom { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); flex: none; }
.as-zoom svg { width: 14px; height: 14px; }
.as-zoom input { width: 110px; }
.as-tl-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.as-names { overflow: hidden; border-right: 1px solid var(--line-soft); padding-bottom: 20px; }
.as-name-head { height: 24px; display: flex; align-items: center; gap: 6px; padding: 0 10px; font: 700 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: rgba(255, 255, 255, .7); }
.as-nrow { height: 26px; display: flex; align-items: center; gap: 5px; padding: 0 8px; font-size: 12px; color: var(--ink); cursor: pointer; border-bottom: 1px solid rgba(26, 26, 26, .04); }
.as-nrow:hover { background: rgba(255, 255, 255, .6); }
.as-nrow.on { background: var(--accent-soft); }
.as-nrow.is-prop { padding-left: 34px; font-size: 11.5px; color: var(--muted); }
.as-exp { width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 5px; }
.as-exp svg { width: 11px; height: 11px; transition: transform .32s var(--ease-spring); }
.as-exp.open svg { transform: rotate(90deg); }
.as-lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.as-lkind { flex: none; font-size: 10px; color: var(--muted); }
.as-empty { padding: 12px 10px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.as-lanes { overflow: auto; position: relative; overscroll-behavior: contain; }
.as-lanes-in { position: relative; min-height: 100%; padding-bottom: 20px; }
.as-ruler { position: sticky; top: 0; z-index: 2; height: 24px; background: rgba(255, 255, 255, .78); border-bottom: 1px solid var(--line-soft); cursor: ew-resize;
  background-image: linear-gradient(90deg, rgba(26, 26, 26, .12) 1px, transparent 1px); background-size: var(--fpx, 8px) 5px; background-repeat: repeat-x; background-position: 0 100%; }
.as-tick { position: absolute; bottom: 0; height: 8px; border-left: 1px solid rgba(26, 26, 26, .3); padding-left: 3px; font: 400 10px var(--mono); color: var(--muted); line-height: 1; }
.as-tick.big { height: 22px; border-left-color: rgba(26, 26, 26, .5); padding-top: 3px; }
.as-end { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.as-rows { position: relative; }
.as-lane { position: absolute; left: 0; right: 0; height: 26px; border-bottom: 1px solid rgba(26, 26, 26, .04); }
.as-lane.is-layer { background: rgba(255, 255, 255, .35); }
.as-lane.on { background: rgba(123, 30, 46, .05); }
.as-end-shade { position: absolute; top: 0; bottom: 0; right: 0; background: rgba(26, 26, 26, .06); pointer-events: none; }
.as-key {
  position: absolute; top: 7px; width: 12px; height: 12px; margin-left: -6px; padding: 0; border: 1.5px solid #8A6A1E; background: #F5C518; transform: rotate(45deg); border-radius: 2px; cursor: grab;
  transition: transform .2s var(--ease-spring), box-shadow .16s var(--ease-out);
}
.as-key.sum { background: #fff; border-color: rgba(26, 26, 26, .55); }
.as-key.e-hold { border-radius: 0; background: #E9E8E3; border-color: #45443F; }
.as-key.e-linear { background: #FBE6DD; border-color: #B4532F; }
.as-key:hover { transform: rotate(45deg) scale(1.25); }
.as-key.on { background: var(--accent); border-color: #fff; box-shadow: 0 0 0 2px var(--accent), 0 0 10px rgba(245, 197, 24, .7); }
.as-key:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.as-pathbar { position: absolute; top: 9px; height: 8px; border-radius: 4px; background: repeating-linear-gradient(90deg, #F5C518 0 6px, rgba(245, 197, 24, .35) 6px 10px); border: 1px solid rgba(138, 106, 30, .5); pointer-events: none; }
.as-pathbar.thin { top: 20px; height: 3px; border: 0; }
.as-head { position: absolute; z-index: 3; top: 0; bottom: 0; width: 0; pointer-events: none; }
.as-head::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--accent); box-shadow: 0 0 8px rgba(123, 30, 46, .35); }
.as-head i { position: absolute; top: 2px; left: -6px; width: 12px; height: 14px; border-radius: 3px 3px 6px 6px; background: var(--accent); }

/* ---- the small window: a version, combining, saving, Blender ---- */
.as-win {
  position: absolute; z-index: 40; right: 300px; top: 64px; width: 360px; max-height: calc(100% - 80px); display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden; background: rgba(255, 255, 255, .92); border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 24px 70px rgba(26, 26, 26, .28), inset 0 1px 0 rgba(255, 255, 255, .9);
  animation: as-win-in .3s var(--ease-out) both;
}
.as-win[hidden] { display: none; }
.as-win.wide { width: 460px; }
.as-win.floating { right: 30px; top: 30px; max-height: calc(100% - 60px); }
@keyframes as-win-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
/* from the panel's Blender or Unreal Engine card: it drops down under the card and works there, in the panel's width */
.as-win.docked {
  position: relative; z-index: auto; right: auto; top: auto; flex: 1 0 100%; width: auto; max-height: none; margin: 0 7px 7px; border-radius: 11px;
  background: #fff; border-color: var(--cl-line-soft, var(--line-soft)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: none; -webkit-backdrop-filter: none; cursor: auto; animation: as-win-drop .32s var(--ease-out) both; transform-origin: top;
}
.as-win.docked .as-win-head { padding: 6px 6px 6px 10px; }
.as-win.docked .as-win-body { padding: 10px 11px 12px; }
.as-win.docked .as-grid2 { grid-template-columns: 1fr; }
@keyframes as-win-drop { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } }
.lab-view .ag-card.is-open, .lab-view .ag-card.is-open:hover { transform: none; }
.lab-view .ag-card.is-open .lab-chev { transform: rotate(90deg); opacity: 1; }
.lab-start-unreal.is-open { border-color: rgba(14, 14, 14, .6); }
.lab-start-blender.is-open { border-color: rgba(232, 125, 13, .7); }
.as-win-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line-soft); }
.as-win-head b { font: 700 13.5px var(--sans); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-win-ic { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-deep); flex: none; }
.as-win-ic svg { width: 14px; height: 14px; }
/* Blender × Claude: the Blender window wears both marks, a Blender-orange rule under its head and an orange primary */
.as-win.is-blender .as-win-head { border-bottom: 2px solid #E87D0D; background: linear-gradient(90deg, rgba(232, 125, 13, .09), rgba(217, 119, 87, .05) 60%, transparent); }
.as-win.is-blender .as-win-ic { width: auto; height: 28px; gap: 5px; display: flex; align-items: center; padding: 0; background: none; }
.as-win.is-blender .as-win-ic > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; }
.as-bl-mark { background: #232323; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.as-bl-mark svg { width: 20px; height: 20px; }
.as-cl-mark { background: var(--clay, #D97757); color: #fff; }
.as-cl-mark svg { width: 15px; height: 15px; }
.as-bl-x { font: 600 13px var(--sans); font-style: normal; color: var(--muted); }
.as-win.is-blender .as-btn.primary { background: linear-gradient(135deg, #F0901F, #E87D0D 55%, #C9650A); color: #fff; box-shadow: 0 4px 14px rgba(232, 125, 13, .35); }
.as-win.is-blender textarea:focus, .as-win.is-blender input[type=text]:focus { border-color: #E87D0D; box-shadow: 0 0 0 3px rgba(232, 125, 13, .18); outline: none; }
.as-win.is-blender .as-drop:hover, .as-win.is-blender .as-drop.over, .as-win.is-blender .as-drop:focus-visible { border-color: #E87D0D; background: rgba(232, 125, 13, .06); }
/* Unreal × Claude: the same lockup in Unreal's own black and white — a black rule under its head and a black primary */
.as-win.is-unreal .as-win-head { border-bottom: 2px solid #0E0E0E; background: linear-gradient(90deg, rgba(14, 14, 14, .08), rgba(217, 119, 87, .05) 60%, transparent); }
.as-win.is-unreal .as-win-ic { width: auto; height: 28px; gap: 5px; display: flex; align-items: center; padding: 0; background: none; }
.as-win.is-unreal .as-win-ic > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; }
.as-ue-mark { background: #0E0E0E; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.as-ue-mark svg { width: 20px; height: 20px; }
.as-win.is-unreal .as-btn.primary { background: linear-gradient(135deg, #3A3A3A, #141414 55%, #000); color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.as-win.is-unreal textarea:focus, .as-win.is-unreal input[type=text]:focus { border-color: #0E0E0E; box-shadow: 0 0 0 3px rgba(14, 14, 14, .14); outline: none; }
.as-win.is-unreal .as-drop:hover, .as-win.is-unreal .as-drop.over, .as-win.is-unreal .as-drop:focus-visible { border-color: #0E0E0E; background: rgba(14, 14, 14, .05); }
.as-win-body { overflow-y: auto; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.as-f { display: flex; flex-direction: column; gap: 4px; font: 700 10px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.as-f textarea { resize: vertical; font: 13px/1.45 var(--sans); letter-spacing: 0; text-transform: none; }
.as-f input { letter-spacing: 0; text-transform: none; font-weight: 400; }
.as-vprev { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-soft); background: #fff; }
.as-vprev iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.as-comb { overflow-x: auto; }
.as-comb table { border-collapse: collapse; width: 100%; font-size: 12px; }
.as-comb th, .as-comb td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); text-align: center; white-space: nowrap; }
.as-comb thead th { font: 700 10px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.as-comb tbody th { text-align: left; font-weight: 600; }
.as-na { color: var(--muted); opacity: .5; }
.as-bl-status { display: flex; flex-wrap: wrap; gap: 6px; }
.as-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: rgba(26, 26, 26, .06); font: 700 10.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.as-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.as-pill.ok { color: var(--ok); background: rgba(14, 138, 95, .1); }
.as-drop { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; border: 1.5px dashed rgba(26, 26, 26, .2); color: var(--muted); font-size: 12px; cursor: pointer; transition: border-color .16s var(--ease-out), background .16s var(--ease-out); }
.as-drop svg { width: 16px; height: 16px; flex: none; }
.as-drop:hover, .as-drop.over, .as-drop:focus-visible { border-color: var(--accent); background: rgba(123, 30, 46, .05); outline: none; }
.as-bl-back { border-top: 1px solid var(--line-soft); border-bottom: 0; }
/* the Blender render, played in the window; what went to Higgsfield; the Send to Higgsfield form */
.as-render { padding-top: 0; }
.as-rprev { border-radius: 12px; overflow: hidden; border: 1px solid var(--line-soft); background: repeating-conic-gradient(rgba(26, 26, 26, .06) 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.as-rprev video, .as-rprev img { display: block; width: 100%; max-height: 230px; object-fit: contain; }
.as-rprev.small video, .as-rprev.small img { max-height: 130px; }
.as-rprev .as-note { padding: 14px; }
.as-note code { font: 11px var(--mono); color: var(--ink); }
.as-note.as-err { color: var(--danger-ink, #A32B23); }
.as-bl-hf { border-top: 1px solid var(--line-soft); border-bottom: 0; }
.as-hf-sends { display: flex; flex-direction: column; gap: 8px; }
.as-hf-sends:empty { display: none; }
.as-hf-send { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .7); }
.as-hf-thumb { width: 76px; height: 52px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: rgba(26, 26, 26, .06); color: var(--muted); }
.as-hf-thumb video { width: 100%; height: 100%; object-fit: cover; }
.as-hf-thumb svg { width: 16px; height: 16px; }
.as-hf-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.as-hf-body p { margin: 0; font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.as-hf-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.as-hf-meta .ag-spin { width: 10px; height: 10px; }
.as-hf-meta.err { color: var(--danger-ink, #A32B23); }
.as-hf-cost { display: inline-flex; align-items: center; margin-left: 2px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); font: 700 11px var(--sans); }
.as-hf-cost .ag-spin { width: 10px; height: 10px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.as-hf-cost.low { background: #fff; color: var(--danger-ink, #A32B23); }
.as-win .as-grid2 input[type=text], .as-win .as-grid2 input[type=number] { width: 100%; padding: 5px 9px; font-size: 12.5px; border-radius: 9px; }
.as-f .as-k-sub { font-weight: 400; }
@media (max-width: 1440px) { #as-vary span, #as-blender span, #as-unreal span, #as-hf span { display: none; } }

@media (max-width: 1100px) { .as-main { grid-template-columns: 44px minmax(0, 1fr) 250px; } .as-hint { display: none; } }
@media (max-width: 768px), (pointer: coarse) and (max-width: 1024px) {
  .as-studio { inset: 8px; grid-template-rows: auto minmax(0, 1fr) 200px; }
  .as-main { grid-template-columns: 40px minmax(0, 1fr); }
  .as-insp { display: none; }
  .as-ask { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .as-studio, .as-win, .as-win.docked { animation: none; }
  .as-ib, .as-btn, .as-tool, .as-fxb, .as-vchip, .as-key, .as-kbtn, .as-exp svg { transition: none; }
}
