/* LiveFlow 聚 Depth — STUDIO (V71), see js/studio.js
   The canvas is the viewport between the bars; every moved control is reset here (position, inset, transform),
   so the old fixed layout in style.css does not pull it away. */

body.studio {
    --st-top: 38px;
    --st-opt: 34px;
    --st-tools: 46px;
    --st-dock: 324px;
    --st-time: 56px;
    --st-panel: rgba(236,236,232,.035);
    --st-panel2: rgba(12,12,14,.92);
    --st-line: var(--hair);
    --st-hi: rgba(236,236,232,.08);
    --vp-l: var(--st-tools);
    --vp-r: var(--st-dock);
    --vp-t: calc(var(--st-top) + var(--st-opt));
    --vp-b: var(--st-time);
    overflow: hidden;
}
:root[data-paper="light"] body.studio { --st-panel: rgba(16,16,18,.03); --st-panel2: rgba(246,246,243,.94); --st-hi: rgba(16,16,18,.07); }
@media (max-width: 1280px) and (min-width: 761px) { body.studio { --st-dock: 286px; } }

/* ---------- the viewport ---------- */
body.studio:not(.overlay) canvas#c,
body.studio:not(.overlay) #hud,
body.studio:not(.overlay) #veil {
    inset: auto !important;
    left: var(--vp-l) !important;
    top: var(--vp-t) !important;
    width: calc(100vw - var(--vp-l) - var(--vp-r)) !important;
    height: calc(100dvh - var(--vp-t) - var(--vp-b)) !important;
}
body.studio.hide-ui:not(.overlay) { --vp-l: 0px; --vp-r: 0px; --vp-t: var(--st-top); --vp-b: 0px; }
body.studio.hide-ui .st-top { opacity: 1 !important; pointer-events: auto !important; }

/* ---------- what the studio replaces ---------- */
body.studio .brand, body.studio .titlebar, body.studio .lowleft, body.studio .rb-bar, body.studio .mbar,
body.studio .corner, body.studio #foot, body.studio .st-gone, body.studio #sheetBtn { display: none !important; }
body.studio.overlay .st-top, body.studio.overlay .st-opts, body.studio.overlay .st-tools, body.studio.overlay .st-dock,
body.studio.overlay .st-time, body.studio.overlay .st-status { display: none !important; }

/* ---------- shared chrome ---------- */
.st-top, .st-opts, .st-tools, .st-dock, .st-time, .st-status {
    position: fixed; z-index: 20; box-sizing: border-box;
    font-family: var(--latin); font-weight: 500; font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim);
    opacity: 1 !important;
}
body:not(.studio) .st-top, body:not(.studio) .st-opts, body:not(.studio) .st-tools, body:not(.studio) .st-dock,
body:not(.studio) .st-time, body:not(.studio) .st-status { display: none; }
.st-top button, .st-opts button, .st-tools button, .st-dock button, .st-time button { opacity: 1; }
.st-top, .st-opts, .st-tools, .st-dock, .st-time { background: var(--ground); }
.st-top *, .st-opts *, .st-tools *, .st-dock *, .st-time * { box-sizing: border-box; }

/* top: logo, menus, right */
.st-top { left: 0; right: 0; top: 0; height: var(--st-top); display: flex; align-items: center; gap: 14px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--st-line); }
.st-logo { display: flex; align-items: center; gap: 8px; flex: none; }
.st-logo .st-ju { font-family: var(--cjk); font-size: 17px; font-weight: 300; color: var(--ink); letter-spacing: 0; }
body.studio #homeBtn { position: static !important; transform: none !important; font-size: 10px; letter-spacing: .34em; font-weight: 500; color: var(--ink); padding: 0; }
.st-burger { display: none; }
.st-menus { display: flex; align-items: stretch; height: 100%; }
.st-menu { position: relative; display: flex; }
.st-mh { padding: 0 11px; height: 100%; color: var(--dim); letter-spacing: .22em; font-size: 9px; }
.st-mh:hover, .st-menu.open .st-mh { color: var(--ink); background: var(--st-hi); }
.st-ml { position: absolute; left: 0; top: 100%; min-width: 236px; display: none; flex-direction: column; padding: 6px 0;
    background: var(--st-panel2); border: 1px solid var(--st-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 40;
    box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.st-menu.open .st-ml { display: flex; }
.st-ml button { display: flex; justify-content: space-between; gap: 24px; padding: 8px 16px; text-align: left; color: var(--dim); font-size: 9px; letter-spacing: .2em; }
.st-ml button[hidden] { display: none; }
.st-ml button:hover { color: var(--ink); background: var(--st-hi); }
.st-ml kbd { font: inherit; color: var(--faint); letter-spacing: .14em; }
.st-mhr { height: 1px; background: var(--st-line); margin: 5px 0; }
.st-right { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
body.studio #lfStatus, body.studio #lfMenu, body.studio #fsBtn {
    position: static !important; inset: auto !important; transform: none !important; margin: 0 !important; left: auto !important; top: auto !important;
}
body.studio #lfMenu { display: flex !important; align-items: center; padding: 0 !important; border: 0 !important; }
body.studio #lfMenu::before, body.studio #lfMenu::after { display: none !important; }
body.studio #fsBtn { width: 18px; height: 18px; color: var(--dim); }
body.studio #fsBtn svg { width: 100%; height: 100%; }
body.studio .lf-drop { right: 0; left: auto !important; top: calc(100% + 10px) !important; z-index: 45; }

/* options bar */
.st-opts { left: 0; right: 0; top: var(--st-top); height: var(--st-opt); display: flex; align-items: center; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--st-line); overflow-x: auto; scrollbar-width: none; }
.st-opts::-webkit-scrollbar { display: none; }
.st-optslot { flex: none; display: flex; align-items: center; }
body.studio #modelBtn { position: static !important; inset: auto !important; transform: none !important; margin: 0 !important; display: inline-flex !important; align-items: center; gap: 8px; }
.st-vr { width: 1px; height: 16px; background: var(--st-line); flex: none; }
.st-optset { display: flex; align-items: center; gap: 18px; flex: none; }
.st-oseg { display: flex; align-items: center; gap: 2px; }
.st-oseg span { color: var(--faint); margin-right: 8px; font-size: 7.5px; }
.st-oseg button { padding: 5px 8px; color: var(--dim); font-size: 8.5px; letter-spacing: .18em; border: 1px solid transparent; }
.st-oseg button:hover { color: var(--ink); }
.st-oseg button.on { color: var(--ink); border-color: var(--st-line); background: var(--st-hi); }

/* tools */
.st-tools { left: 0; top: calc(var(--st-top) + var(--st-opt)); bottom: 0; width: var(--st-tools); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-right: 1px solid var(--st-line); }
.st-tool, body.studio .st-tools > button {
    position: static !important; inset: auto !important; transform: none !important; margin: 0 !important;
    width: 32px !important; height: 32px !important; display: grid !important; place-items: center; color: var(--dim); border-radius: 4px; flex: none; padding: 0 !important;
}
.st-tool svg, body.studio .st-tools > button svg { width: 18px !important; height: 18px !important; display: block; overflow: visible; }
.st-tool svg path, .st-tool svg rect, .st-tool svg circle { fill: none; stroke: currentColor; stroke-width: 1.25; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.st-tool svg .thin { opacity: .6; }
body.studio #randBtn circle { fill: currentColor; stroke: none; }
.st-tool:hover, body.studio .st-tools > button:hover { color: var(--ink); background: var(--st-hi); }
.st-tool.on { color: var(--ink); background: var(--st-hi); box-shadow: inset 0 0 0 1px var(--st-line); }
.st-tool:disabled { opacity: .3 !important; }
.st-tsep { width: 18px; height: 1px; background: var(--st-line); margin: 5px 0; flex: none; }
.st-tgrow { flex: 1; }
.st-only-phone { display: none !important; }

/* dock */
.st-dock { right: 0; top: calc(var(--st-top) + var(--st-opt)); bottom: var(--st-time); width: var(--st-dock); display: flex; flex-direction: column; border-left: 1px solid var(--st-line); }
.st-ph { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px 9px; color: var(--ink); font-size: 8.5px; letter-spacing: .26em; }
.st-ph b { font-weight: 500; color: var(--faint); }
.st-layers { flex: 0 1 42%; min-height: 150px; display: flex; flex-direction: column; border-bottom: 1px solid var(--st-line); }
.st-layerslot { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 8px; scrollbar-width: thin; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 0; padding: 0 6px; border-bottom: 1px solid var(--st-line); flex: none; }
.st-tabs button { padding: 10px 8px 9px; color: var(--faint); font-size: 8px; letter-spacing: .2em; border-bottom: 1px solid transparent; margin-bottom: -1px; }
.st-tabs button:hover { color: var(--dim); }
.st-tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.st-tabbody { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.st-pane { display: none; padding: 12px 14px 18px; }
.st-pane.on { display: block; }

/* the old columns inside a pane: one column, full width */
body.studio .st-pane .col {
    position: static !important; inset: auto !important; transform: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important;
    width: auto !important; max-width: none !important; min-width: 0 !important; display: block !important; background: none !important;
    opacity: 1 !important; pointer-events: auto !important;
}
body.studio .st-pane .col::before, body.studio .st-pane .col::after { display: none !important; }
body.studio .st-pane .col > .h { display: flex !important; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px !important; color: var(--ink); font-size: 8.5px; letter-spacing: .26em; position: static !important; }
body.studio .st-pane .two, body.studio .st-pane .two.three { display: grid !important; grid-template-columns: 1fr !important; gap: 16px !important; }
body.studio .st-pane .stack { display: grid !important; gap: 10px !important; }
body.studio .st-pane .sl { display: grid !important; grid-template-columns: 74px 1fr !important; align-items: center; gap: 10px !important; width: 100% !important; margin: 0 !important; }
body.studio .st-pane .sl span { font-size: 8px; letter-spacing: .2em; color: var(--dim); }
body.studio .st-pane .sl input[type=range] { width: 100% !important; max-width: none !important; }
body.studio .st-pane .seg { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 6px !important; margin: 0 !important; }
body.studio .st-pane .seg > span { width: 74px; flex: none; font-size: 8px; color: var(--dim); }
body.studio .st-pane .seg button:not(.sw) { padding: 5px 7px !important; font-size: 8.5px; }
body.studio .st-pane .padrow { display: grid !important; grid-template-columns: 74px 1fr; align-items: start; gap: 10px; }
body.studio .st-pane #pad { width: 120px !important; height: 120px !important; position: static !important; }
body.studio .st-pane .col.music .mus-more { display: grid !important; gap: 12px; }
body.studio .st-pane .col.music .row { display: grid !important; gap: 10px !important; }
body.studio .st-pane #musicBox { position: static !important; }
body.studio .st-pane > .col > .seg + .seg, body.studio .st-pane > .col > .seg + .sl, body.studio .st-pane > .col > .sl + .sl { margin-top: 10px !important; }

/* LAYERS: the rail as a list */
body.studio #rail {
    position: static !important; inset: auto !important; transform: none !important; top: auto !important; left: auto !important; max-height: none !important;
    width: 100% !important; display: flex !important; flex-direction: column !important; gap: 3px !important; padding: 0 !important; margin: 0 !important; overflow: visible !important;
    opacity: 1 !important;
}
body.studio #rail .pic {
    position: relative; display: grid !important; grid-template-columns: 22px 44px 1fr 22px; align-items: center; gap: 10px; width: 100% !important; height: auto !important;
    padding: 5px 6px !important; margin: 0 !important; border: 1px solid transparent; border-radius: 4px; background: none;
}
body.studio #rail .pic:hover { background: var(--st-hi); }
body.studio #rail .pic.on { background: var(--st-hi); border-color: var(--st-line); }
body.studio #rail .pic > span:not(.st-lname) { grid-column: 1; grid-row: 1; position: static !important; font-size: 8px; color: var(--faint); text-align: center; letter-spacing: .1em; opacity: 1 !important; }
body.studio #rail .pic .face { grid-column: 2; grid-row: 1; position: static !important; width: 44px !important; height: 44px !important; padding: 0 !important; border-radius: 3px; overflow: hidden; outline: 1px solid var(--st-line); }
body.studio #rail .pic .face > * { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
body.studio #rail .pic .st-lname { grid-column: 3; grid-row: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8.5px; letter-spacing: .18em; color: var(--dim); pointer-events: none; }
body.studio #rail .pic.on .st-lname { color: var(--ink); }
body.studio #rail .pic .x { grid-column: 4; grid-row: 1; position: static !important; inset: auto !important; opacity: .55 !important; width: 22px !important; height: 22px !important; font-size: 13px; color: var(--dim); transform: none !important; display: block !important; }
body.studio #rail .pic .x:hover { opacity: 1 !important; color: var(--err); }
body.studio #rail .pic.wait .face { opacity: .45; }
body.studio #rail > .add, body.studio #rail .add-row { position: static !important; margin: 0 !important; transform: none !important; }
body.studio #rail > .add { order: 99; display: grid !important; place-items: center; width: 100% !important; height: 30px !important; margin-top: 6px !important; border: 1px dashed var(--st-line) !important; border-radius: 4px; font-size: 14px; color: var(--dim); }
body.studio #rail .add-row { order: 100; display: grid !important; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; }
body.studio #rail .add-row .add { width: 100% !important; height: 30px !important; display: grid !important; place-items: center; border: 1px solid var(--st-line) !important; border-radius: 4px; position: static !important; margin: 0 !important; }
body.studio #rail .add-row .add svg { width: 16px; height: 16px; }
body.studio #rail .add:hover { color: var(--ink); background: var(--st-hi); }

/* HISTORY */
.st-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.st-hist li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 7px 8px; cursor: pointer; color: var(--dim); font-size: 8.5px; letter-spacing: .18em; border-radius: 3px; }
.st-hist li b { font-weight: 500; color: var(--faint); }
.st-hist li time { color: var(--faint); letter-spacing: .1em; font-size: 8px; }
.st-hist li:hover { background: var(--st-hi); color: var(--ink); }
.st-hist li.on { background: var(--st-hi); color: var(--ink); box-shadow: inset 2px 0 0 var(--ink); }
.st-hist li.ahead { opacity: .4; }
.st-histbar { display: flex; gap: 6px; margin-top: 14px; }
.st-histbar button { flex: 1; padding: 8px 0; border: 1px solid var(--st-line); color: var(--dim); font-size: 8.5px; letter-spacing: .2em; }
.st-histbar button:hover:not(:disabled) { color: var(--ink); background: var(--st-hi); }
.st-histbar button:disabled { opacity: .3; }

/* timeline */
.st-time { left: 0; right: 0; bottom: 0; height: var(--st-time); display: flex; align-items: center; gap: 14px; padding: 0 14px 0 calc(var(--st-tools) + 10px); border-top: 1px solid var(--st-line); z-index: 21; }
.st-trans { display: flex; align-items: center; gap: 4px; flex: none; }
body.studio .st-trans > button { position: static !important; display: inline-flex !important; align-items: center; gap: 7px; padding: 6px 9px !important; margin: 0 !important; font-size: 8.5px; letter-spacing: .2em; color: var(--dim); border: 1px solid transparent; border-radius: 3px; width: auto !important; }
body.studio .st-trans > button:hover { color: var(--ink); background: var(--st-hi); }
body.studio .st-trans .key { color: var(--faint); font-size: 7.5px; }
.st-wave { position: relative; flex: 1; min-width: 0; height: 36px; border: 1px solid var(--st-line); border-radius: 3px; cursor: pointer; overflow: hidden; }
.st-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.st-wlbl { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 8px; letter-spacing: .24em; pointer-events: none; }
.st-wtime { position: absolute; right: 8px; top: 3px; color: var(--faint); font-size: 7.5px; letter-spacing: .16em; pointer-events: none; font-variant-numeric: tabular-nums; }
.st-recslot { flex: none; display: flex; align-items: center; }
body.studio #recBtn { position: static !important; inset: auto !important; transform: none !important; top: auto !important; right: auto !important; display: flex !important; align-items: center; gap: 8px; }
body.studio #recBtn svg { width: 20px; height: 20px; }

/* status line over the viewport */
.st-status { left: calc(var(--vp-l) + 12px); right: calc(var(--vp-r) + 12px); bottom: calc(var(--vp-b) + 8px); display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 6; pointer-events: none; color: var(--faint); font-size: 7.5px; }
.st-status > * { pointer-events: auto; }
body.studio #renderedPts { position: static !important; transform: none !important; font-size: 7.5px; letter-spacing: .22em; color: var(--faint); }
#stStatL::after { content: attr(data-more); margin-left: 14px; }
body.studio .st-status .byline { position: static !important; font-size: 7.5px; letter-spacing: .22em; color: var(--faint); }
body.studio.hide-ui .st-status { display: none; }

/* the hint stays centred over the viewport */
body.studio .hint { left: calc(var(--vp-l) + (100vw - var(--vp-l) - var(--vp-r)) / 2) !important; right: auto !important; transform: translateX(-50%) !important; bottom: calc(var(--vp-b) + 30px) !important; top: auto !important; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
    body.studio {
        --st-top: 44px; --st-opt: 36px; --st-tools: 0px; --st-strip: 54px; --st-time: 46px; --st-sheet: min(52dvh, 420px);
        --vp-l: 0px; --vp-r: 0px; --vp-b: calc(var(--st-strip) + var(--st-time) + env(safe-area-inset-bottom, 0px));
    }
    body.studio.st-sheet { --vp-b: calc(var(--st-strip) + var(--st-time) + var(--st-sheet) + env(safe-area-inset-bottom, 0px)); }
    .st-only-phone { display: grid !important; }
    .st-tabs .st-only-phone { display: block !important; }
    .st-top { gap: 10px; padding: 0 10px; }
    .st-burger { display: grid; gap: 3px; width: 30px; height: 30px; place-content: center; }
    .st-burger i { display: block; width: 15px; height: 1px; background: var(--ink); }
    .st-menus { display: none; position: fixed; left: 0; right: 0; top: var(--st-top); bottom: 0; flex-direction: column; overflow: auto; height: auto;
        background: var(--st-panel2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 8px 0 30px; z-index: 50; }
    body.st-menus-open .st-menus { display: flex; }
    .st-menu { flex-direction: column; }
    .st-mh { height: auto; padding: 14px 18px; text-align: left; font-size: 10px; color: var(--ink); }
    .st-ml { position: static; display: none; box-shadow: none; border: 0; background: none; backdrop-filter: none; padding: 0 0 8px 10px; }
    .st-ml button { padding: 11px 18px; font-size: 9.5px; }
    .st-right { gap: 10px; }
    body.studio #lfStatus { display: none !important; }
    body.studio #fsBtn { display: none !important; }
    .st-tools { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: calc(var(--st-strip) + env(safe-area-inset-bottom, 0px)); flex-direction: row; padding: 0 8px env(safe-area-inset-bottom, 0px); gap: 2px;
        border-right: 0; border-top: 1px solid var(--st-line); overflow-x: auto; justify-content: flex-start; scrollbar-width: none; z-index: 23; }
    .st-tools::-webkit-scrollbar { display: none; }
    .st-tool, body.studio .st-tools > button { width: 40px !important; height: 40px !important; }
    .st-tsep { width: 1px; height: 20px; margin: 0 4px; }
    .st-tgrow { flex: 1 0 4px; }
    #stOrbit { display: none !important; }
    .st-time { bottom: calc(var(--st-strip) + env(safe-area-inset-bottom, 0px)); height: var(--st-time); padding: 0 10px; gap: 8px; }
    body.studio .st-trans > button { padding: 6px 6px !important; font-size: 8px; }
    body.studio .st-trans .key { display: none; }
    body.studio #lightBtn { display: none !important; }
    .st-wave { height: 30px; }
    body.studio #recBtn .lbl { display: none; }
    .st-dock { left: 0; right: 0; width: auto; top: auto; bottom: calc(var(--st-strip) + var(--st-time) + env(safe-area-inset-bottom, 0px)); height: var(--st-sheet);
        border-left: 0; border-top: 1px solid var(--st-line); transform: translateY(calc(100% + var(--st-time) + var(--st-strip) + 20px)); transition: transform .28s cubic-bezier(.3,.7,.2,1); z-index: 22; }
    body.st-sheet .st-dock { transform: none; }
    .st-dock .st-tabs { order: -1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 4px; }
    .st-dock .st-tabs::-webkit-scrollbar { display: none; }
    .st-tabs button { padding: 13px 10px 12px; white-space: nowrap; }
    .st-layers { display: none; flex: 1; border-bottom: 0; }
    .st-dock[data-tab="layers"] .st-layers { display: flex; }
    .st-dock[data-tab="layers"] .st-tabbody { display: none; }
    .st-layers .st-ph { display: none; }
    .st-layerslot { padding-top: 8px; }
    .st-status { bottom: calc(var(--vp-b) + 6px); }
    #stStatL::after { display: none; }
    body.studio .st-status .byline { display: none; }
    body.studio .st-pane .sl input[type=range] { height: 28px; }
    body.studio .hint { bottom: calc(var(--vp-b) + 24px) !important; width: calc(100vw - 32px); text-align: center; }
}

/* ---------- V71 fixes: the moved icon buttons carry id rules from style.css, so they are reset by id ---------- */
body.studio #randBtn, body.studio #paper, body.studio #overlayBtn, body.studio #keysBtn {
    position: static !important; inset: auto !important; transform: none !important; margin: 0 !important; left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
    width: 32px !important; height: 32px !important; display: grid !important; place-items: center; padding: 0 !important; font-size: 0 !important; flex: none;
}
body.studio #paper svg, body.studio #randBtn svg, body.studio #overlayBtn svg, body.studio #keysBtn svg { width: 18px !important; height: 18px !important; }
body.studio .st-tools > .st-only-phone { display: none !important; }
body.studio #modelBtn .ju { font-size: 20px !important; }
.st-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tabs button { padding: 10px 7px 9px; letter-spacing: .16em; white-space: nowrap; flex: none; }
#stStatL { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.st-wlbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
@media (max-width: 760px) {
    body.studio #randBtn, body.studio #paper, body.studio #overlayBtn, body.studio #keysBtn { width: 40px !important; height: 40px !important; }
    body.studio .st-tools > .st-only-phone { display: grid !important; }
    body.studio #keysBtn { display: none !important; }
    body.studio #profileBtn .pf-k, body.studio #profileBtn .pf-dot { display: none !important; }
    body.studio #lfMenu { max-width: 40vw; overflow: hidden; }
    .st-wlbl { font-size: 7px; letter-spacing: .16em; }
    .st-tabs button { padding: 13px 9px 12px; }
}
.st-top { z-index: 30; }
body.studio #rail .add-row .add.word:not(.gen) { text-transform: none; font-family: var(--latin); letter-spacing: .06em; font-size: 12px; }
@media (min-width: 761px) {
    .st-tools { bottom: var(--st-time); }
    .st-time { padding-left: 14px; }
}
.st-wtime { background: var(--ground); padding: 1px 5px; border-radius: 2px; }

/* ---------- V72: BRIGHT, layer eye, opacity ---------- */
.st-bright input { width: 110px; margin: 0 8px 0 2px; }
.st-bright b { font-weight: 500; color: var(--ink); min-width: 36px; font-size: 8.5px; letter-spacing: .1em; }
body.studio #rail .pic { grid-template-columns: 22px 16px 44px 1fr 22px !important; }
body.studio #rail .pic .st-eye { grid-column: 1; grid-row: 1; width: 22px; height: 22px; display: grid; place-items: center; color: var(--dim); padding: 0; }
body.studio #rail .pic .st-eye svg { width: 15px; height: 15px; }
body.studio #rail .pic .st-eye path, body.studio #rail .pic .st-eye circle { fill: none; stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
body.studio #rail .pic .st-eye .thin { opacity: .45; }
body.studio #rail .pic .st-eye:hover { color: var(--ink); }
body.studio #rail .pic > span:not(.st-lname) { grid-column: 2 !important; }
body.studio #rail .pic .face { grid-column: 3 !important; }
body.studio #rail .pic .st-lname { grid-column: 4 !important; }
body.studio #rail .pic .x { grid-column: 5 !important; }
body.studio #rail .pic.st-off .face, body.studio #rail .pic.st-off .st-lname { opacity: .3; }
.st-lop { display: grid; grid-template-columns: auto 1fr 38px; align-items: center; gap: 10px; padding: 0 14px 10px; font-size: 7.5px; color: var(--faint); }
.st-lop input { width: 100%; }
.st-lop b { font-weight: 500; color: var(--ink); font-size: 8.5px; letter-spacing: .1em; text-align: right; }
@media (max-width: 760px) { .st-bright input { width: 80px; } .st-lop { padding-top: 10px; } }

/* V72 fix: the old foot shade (style.css body::after, height = --stage-b + 60px) took its height from the hidden
   footer, so in the studio it covered the whole viewport and the cloud came out about half as bright */
body.studio::after { display: none !important; }

/* ---------- V73: edit tools ---------- */
#stPaint { position: fixed; left: var(--vp-l); top: var(--vp-t); width: calc(100vw - var(--vp-l) - var(--vp-r)); height: calc(100dvh - var(--vp-t) - var(--vp-b)); z-index: 4; pointer-events: none; cursor: none; touch-action: none; opacity: 1 !important; }
#stPaint canvas { width: 100%; height: 100%; display: block; }
body:not(.studio) #stPaint, body.overlay #stPaint { display: none; }
.st-topts { display: flex; align-items: center; gap: 14px; flex: none; }
.st-topts:empty { display: none; }
.st-tname { color: var(--ink); font-size: 8.5px; letter-spacing: .24em; }
body.st-painting .st-optset .st-oseg:not(.st-bright) { display: none; }
.st-orange input { width: 90px; margin: 0 6px 0 2px; }
.st-orange b { font-weight: 500; color: var(--ink); min-width: 30px; font-size: 8.5px; letter-spacing: .08em; }
.st-act { padding: 5px 9px; border: 1px solid var(--st-line); border-radius: 3px; color: var(--dim); font-size: 8.5px; letter-spacing: .18em; white-space: nowrap; }
.st-act:hover { color: var(--ink); background: var(--st-hi); }
.st-act.hi { color: var(--ink); border-color: var(--dim); }
.st-prompt { width: 220px; background: transparent; border: 0; border-bottom: 1px solid var(--st-line); color: var(--ink); font: inherit; font-size: 9px; letter-spacing: .14em; padding: 5px 2px; text-transform: uppercase; outline: none; }
.st-prompt:focus { border-bottom-color: var(--dim); }
body.st-busy .st-act.hi { animation: stBusy 1s ease-in-out infinite; }
@keyframes stBusy { 50% { opacity: .45; } }
.st-tbtns { display: flex; gap: 4px; flex: none; }
.st-tbtns button { padding: 6px 8px; border: 1px solid transparent; border-radius: 3px; color: var(--dim); font-size: 8px; letter-spacing: .18em; white-space: nowrap; }
.st-tbtns button:hover { color: var(--ink); background: var(--st-hi); }
.st-tbtns button.on { color: var(--ink); border-color: var(--st-line); }
@media (max-width: 760px) {
    .st-tbtns button { padding: 5px 5px; font-size: 7px; letter-spacing: .1em; }
    #stPre { display: none; }
    .st-prompt { width: 160px; }
}
.st-ctx { position: fixed; z-index: 7; left: calc(var(--vp-l) + (100vw - var(--vp-l) - var(--vp-r)) / 2); bottom: calc(var(--vp-b) + 34px); transform: translateX(-50%);
    display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; background: var(--st-panel2); border: 1px solid var(--st-line); border-radius: 6px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-family: var(--latin); font-weight: 500; font-size: 9px; letter-spacing: .2em; color: var(--dim);
    box-shadow: 0 12px 30px rgba(0,0,0,.35); opacity: 1 !important; max-width: calc(100vw - var(--vp-l) - var(--vp-r) - 24px); }
.st-ctx[hidden], body:not(.studio) .st-ctx, body.overlay .st-ctx { display: none; }
body.studio .hint { z-index: 6; }
@media (max-width: 760px) { .st-ctx { flex-wrap: wrap; justify-content: center; gap: 8px; bottom: calc(var(--vp-b) + 26px); } .st-ctx .st-prompt { width: 100%; } }
/* V74: the hairline after 聚 DEPTH sits a little lower, level with DEPTH */
.st-opts > .st-vr { height: 14px; transform: translateY(4px); }
/* V75: 聚 DEPTH under 聚 LIVEFLOW — same 聚 (17 px, same x), DEPTH starts where LIVEFLOW does, both centred in their bars */
body.studio #modelBtn { gap: 8px !important; height: 100%; align-items: center !important; padding: 0 !important; line-height: 1 !important; }
body.studio #modelBtn .ju { font-size: 17px !important; width: 17px; height: auto !important; line-height: 1 !important; display: block !important; margin: 0 !important; padding: 0 !important; transform: none !important; }
body.studio #modelBtn #modelName { padding: 0 !important; margin: 0 !important; line-height: 1 !important; display: block !important; position: static !important; transform: none !important; }
.st-logo .st-ju { line-height: 1; display: block; }
.st-optslot { height: 100%; }
.st-opts > .st-vr { transform: none; height: 14px; }
/* V75: BLEND under OPACITY */
.st-blend { grid-template-columns: auto 1fr; }
.st-blend select { background: transparent; color: var(--ink); border: 1px solid var(--st-line); border-radius: 3px; font: inherit; font-size: 8.5px; letter-spacing: .16em; padding: 4px 6px; outline: none; }
.st-blend select option { background: var(--ground); color: var(--ink); }
/* V76: names take clicks (pick / rename), STACK | TURN and SPACE */
body.studio #rail .pic .st-lname { pointer-events: auto !important; cursor: default; }
body.studio #rail .pic .st-lname[contenteditable="true"] { cursor: text; outline: 1px solid var(--st-line); padding: 2px 4px; color: var(--ink); text-overflow: clip; }
.st-stack { grid-template-columns: auto auto 1fr !important; }
.st-stack .st-oseg button { padding: 4px 8px; font-size: 8px; }
.st-space { display: grid; grid-template-columns: auto 1fr 24px; gap: 8px; align-items: center; }
.st-space input { width: 100%; }
.st-space b { font-weight: 500; color: var(--ink); font-size: 8.5px; text-align: right; }

/* ---------- V77: picks, groups, the icon row under LAYERS ---------- */
body.st-lbar-on #rail > .add, body.st-lbar-on #rail .add-row { display: none !important; }
body.studio #rail .pic.st-picked { background: rgba(120,160,255,.10); border-color: rgba(140,175,255,.35); }
body.studio #rail .pic.st-in-group { padding-left: 22px !important; }
body.studio #rail .pic.st-folded { display: none !important; }
.st-group { display: grid; grid-template-columns: 22px 14px 18px 1fr auto; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 4px; color: var(--dim); font-size: 8.5px; letter-spacing: .18em; cursor: default; user-select: none; }
.st-group:hover { background: var(--st-hi); }
.st-group .st-eye { width: 22px; height: 22px; display: grid; place-items: center; color: var(--dim); }
.st-group svg { width: 15px; height: 15px; }
.st-group svg path, .st-group svg circle { fill: none; stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.st-group svg .thin { opacity: .45; }
.st-garrow { color: var(--faint); font-size: 9px; transition: transform .2s; }
.st-group.open .st-garrow { transform: rotate(90deg); }
.st-gico { display: grid; place-items: center; color: var(--ink); }
.st-gname { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-gname[contenteditable="true"] { outline: 1px solid var(--st-line); padding: 2px 4px; }
.st-gn { font-weight: 500; color: var(--faint); }
.st-lbar { display: flex; justify-content: flex-end; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--st-line); flex: none; }
.st-lbar button { width: 30px; height: 28px; display: grid; place-items: center; color: var(--dim); border-radius: 3px; }
.st-lbar button:hover { color: var(--ink); background: var(--st-hi); }
.st-lbar svg { width: 16px; height: 16px; }
.st-lbar svg path, .st-lbar svg rect, .st-lbar svg circle { fill: none; stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.st-lbar svg .thin { opacity: .6; }
.st-lbar .st-aa { font-family: var(--latin); font-size: 12px; letter-spacing: 0; font-weight: 500; }
@media (max-width: 760px) { .st-lbar button { width: 38px; height: 36px; } }
/* V77: SAVE PROJECT quick button, right of the menus */
.st-quick { display: flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; margin-left: 6px; border: 1px solid var(--st-line); border-radius: 3px; color: var(--ink); font-size: 8.5px; letter-spacing: .2em; flex: none; }
.st-quick:hover { background: var(--st-hi); }
.st-quick svg { width: 14px; height: 14px; }
.st-quick svg path { fill: none; stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
@media (max-width: 760px) { .st-quick span { display: none; } .st-quick { padding: 0 7px; margin-left: 0; } }
.st-lbar .st-aa { text-transform: none; }
.st-layers { flex-basis: 48%; }
/* V78: SAVE PROJECT window */
.st-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); font-family: var(--latin); font-weight: 500; letter-spacing: .2em; color: var(--dim); }
.st-modal[hidden] { display: none; }
.st-mbox { width: min(420px, calc(100vw - 32px)); display: grid; gap: 12px; padding: 24px 24px 20px; background: var(--st-panel2, #0c0c0e); border: 1px solid var(--hair); border-radius: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.st-mh2 { color: var(--ink); font-size: 10px; letter-spacing: .3em; }
.st-mlbl { font-size: 7.5px; color: var(--faint); }
.st-mbox input { background: transparent; border: 0; border-bottom: 1px solid var(--hair); color: var(--ink); font: inherit; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; padding: 6px 2px; outline: none; }
.st-mbox input:focus { border-bottom-color: var(--dim); }
.st-mnote { margin: 0; font-size: 7.5px; line-height: 1.7; color: var(--faint); }
.st-mrow { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.st-mrow button { padding: 8px 14px; border: 1px solid var(--hair); border-radius: 3px; color: var(--dim); font-size: 8.5px; letter-spacing: .2em; }
.st-mrow button.hi { color: var(--ink); border-color: var(--dim); }
.st-mrow button:hover { background: rgba(236,236,232,.08); color: var(--ink); }
body.studio #rail { min-height: 100%; padding-bottom: 24px !important; }
/* V79: where a dragged layer lands */
body.studio #rail { position: relative !important; }
.st-dropline { position: absolute; left: 4px; right: 4px; height: 2px; background: var(--ink); border-radius: 1px; pointer-events: none; z-index: 3; }
.st-dropline.in { left: 26px; background: #8fb0ff; }
.st-dropline.in::after { content: attr(data-lbl); position: absolute; right: 0; top: -14px; font-size: 7px; letter-spacing: .2em; color: #8fb0ff; }
.st-group[draggable="true"] { cursor: grab; }
.st-group.dragging { opacity: .4; }
.st-mnote.warn { color: #e7c39b; }

/* V83: the AI window's reference row stays inside the window (the slider shrinks, nothing is pushed out) */
.gn-ref { min-width: 0; max-width: 100%; box-sizing: border-box; }
.gn-refon { min-width: 0; overflow: hidden; }
.gn-str { min-width: 0; flex: 1 1 0; }
.gn-str span { flex: none; }
.gn-str input { width: auto !important; min-width: 40px !important; max-width: none !important; flex: 1 1 0 !important; }
.gn-refon img { flex: none; }
#gnRefX { flex: none; }
.gn-box { overflow-x: hidden; }
.gn-box > * { min-width: 0; max-width: 100%; }
@media (max-width: 520px) { .gn-ref { gap: 10px; padding: 8px; } .gn-refon { gap: 8px; } .gn-str { font-size: 6.5px; letter-spacing: .16em; gap: 6px; } }
