/* ==========================================================================
   OCE Game Studio – workspace styles (dark engine theme)
   ========================================================================== */
body.gs-open { overflow: hidden; }
#gs-root.gs-root{ --gs-focus: #7fb0e8; scrollbar-color: var(--line-strong) var(--line); scrollbar-width: thin; }
#gs-root.gs-root :focus-visible{ outline: 2px solid var(--gs-focus); outline-offset: 2px; }
#gs-root.gs-root ::selection{ background: var(--accent-soft); color: var(--text); }
#gs-root.gs-root{ position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); color: var(--text-2); font: 13px/1.45 var(--font-ui); }
#gs-root.gs-root.hidden{ display: none; }

#gs-root .gs-top{ display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--bg); border-bottom: 1px solid var(--line-strong); position: relative; flex: 0 0 auto; }
#gs-root .gs-logo{ font-size: 16px; }
#gs-root .gs-title{ font-weight: 600; color: var(--text); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gs-root .gs-save{ font-size: 11px; color: var(--text-3); min-width: 90px; }
#gs-root .gs-spacer{ flex: 1; }
#gs-root .gs-sep{ width: 1px; height: 20px; background: var(--bg-raised); margin: 0 4px; }
#gs-root .gs-group{ display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px; }
#gs-root .gs-btn{ background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 12px; white-space: nowrap; }
#gs-root .gs-btn:hover{ background: var(--surface-3); color: var(--text); }
#gs-root .gs-btn:active{ transform: translateY(1px); }
#gs-root .gs-btn:disabled{ opacity: .48; cursor: not-allowed; }
#gs-root .gs-btn.on{ background: var(--accent-strong); border-color: var(--accent); color: #fff; }
#gs-root .gs-btn.danger{ color: var(--bad); }
#gs-root .gs-btn.danger:hover{ background: #3a1d22; }
#gs-root .gs-btn.gs-play{ font-weight: 600; }

#gs-root .gs-select{ background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; font-size: 12px; }

#gs-root .gs-body{ flex: 1; display: flex; min-height: 0; }
#gs-root .gs-left, #gs-root .gs-right{ flex: 0 0 var(--gs-left-w, 230px); display: flex; flex-direction: column; min-width: 0; background: var(--bg-raised); }
#gs-root .gs-right{ flex-basis: var(--gs-right-w, 300px); }
#gs-root .gs-resizer{ flex: 0 0 5px; cursor: col-resize; background: var(--bg-raised); }
#gs-root .gs-resizer:hover, #gs-root .gs-resizer:active{ background: var(--accent-strong); }
#gs-root .gs-resizer-h{ flex: 0 0 5px; cursor: row-resize; background: var(--bg-raised); }
#gs-root .gs-resizer-h:hover, #gs-root .gs-resizer-h:active{ background: var(--accent-strong); }

#gs-root .gs-center{ flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
#gs-root .gs-viewport{ flex: 1; position: relative; min-height: 0; background: var(--surface-3); }
#gs-root .gs-viewport canvas{ display: block; }
#gs-root .gs-viewbar{ flex: 0 0 auto; padding: 3px 10px; background: var(--bg-raised); border-top: 1px solid var(--line-strong); color: var(--text-3); font-size: 11px; display: flex; justify-content: space-between; }
#gs-root .gs-fallback{ position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--bad); padding: 30px; text-align: center; }

#gs-root .gs-panel-title{ padding: 8px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--line-strong); }
#gs-root .gs-hier, #gs-root .gs-inspector{ flex: 1; overflow: auto; min-height: 0; }
#gs-root .gs-hrow{ display: flex; align-items: center; gap: 5px; padding: 4px 6px 4px 6px; cursor: pointer; font-size: 12px; border-left: 2px solid transparent; }
#gs-root .gs-hrow:hover{ background: var(--surface-3); }
#gs-root .gs-hrow.sel{ background: var(--accent-soft); border-left-color: var(--accent); }
#gs-root .gs-hrow.drop{ outline: 1px dashed var(--accent); outline-offset: -1px; background: #2c4a68; }
#gs-root .gs-hicon{ width: 16px; text-align: center; color: var(--text-3); font-size: 11px; }
#gs-root .gs-hname{ flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gs-root .gs-eye{ background: none; border: none; color: var(--ok); cursor: pointer; font-size: 11px; padding: 0 2px; }
#gs-root .gs-eye.off{ color: var(--text-3); text-decoration: line-through; }
#gs-root .gs-empty{ padding: 18px 12px; color: var(--text-3); font-size: 12px; }

#gs-root .gs-inspector{ padding: 8px; }
#gs-root .gs-sec{ background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px; margin-bottom: 8px; }
#gs-root .gs-sec-h{ font-weight: 600; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
#gs-root .gs-tag{ font-size: 10px; background: var(--bg-raised); color: var(--text-2); border-radius: 4px; padding: 1px 6px; font-weight: 400; }
#gs-root .gs-field{ margin-bottom: 6px; }
#gs-root .gs-field label{ display: block; font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
#gs-root .gs-field input[type="number"], #gs-root .gs-field input[type="text"], #gs-root .gs-field select, #gs-root .gs-field textarea, #gs-root #gs-name{ width: 100%; background: var(--surface); color: var(--text-2); border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; font-size: 12px; box-sizing: border-box; }
#gs-root .gs-field input[type="color"]{ width: 100%; height: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px; }
#gs-root .gs-field input[type="range"]{ width: 100%; accent-color: var(--accent); }
#gs-root .gs-vec{ display: flex; gap: 4px; }
#gs-root .gs-vec input{ flex: 1; min-width: 0; }
#gs-root .gs-vec i{ font-style: normal; font-size: 10px; color: var(--text-3); align-self: center; width: 10px; }
#gs-root .gs-check{ display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 4px 0; }
#gs-root .gs-check input{ accent-color: var(--accent); }
#gs-root .gs-grid2{ display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#gs-root .gs-maprow{ display: flex; align-items: center; gap: 6px; margin-top: 4px; }
#gs-root .gs-maprow span{ flex: 0 0 62px; font-size: 11px; color: var(--text-3); text-transform: capitalize; }
#gs-root .gs-maprow select{ flex: 1; min-width: 0; background: var(--surface); color: var(--text-2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; font-size: 11px; }
#gs-root .gs-grid2 label{ font-size: 11px; color: var(--text-3); }
#gs-root .gs-grid2 input, #gs-root .gs-grid2 select{ width: 100%; margin-top: 2px; background: var(--surface); color: var(--text-2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; font-size: 12px; box-sizing: border-box; }
#gs-root .gs-code{ width: 100%; background: var(--bg-raised); color: #9fd0a8; border: 1px solid var(--line); border-radius: 5px; font: 11px/1.5 var(--font-mono); padding: 6px; resize: vertical; direction: ltr; text-align: left; }
#gs-root .gs-comp{ border-top: 1px solid var(--line-strong); padding-top: 6px; margin-top: 6px; }
#gs-root .gs-comp b{ font-size: 12px; color: var(--text-2); }
#gs-root .gs-mini{ background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; font-size: 11px; cursor: pointer; margin-top: 4px; }
#gs-root .gs-mini.danger{ color: var(--bad); }
#gs-root .gs-objactions{ display: flex; gap: 6px; }
#gs-root .gs-objactions .gs-btn{ flex: 1; }

#gs-root .gs-bottom{ flex: 0 0 var(--gs-bottom-h, 190px); display: flex; flex-direction: column; background: var(--bg-raised); border-top: 1px solid var(--line-strong); min-height: 0; }
#gs-root .gs-tabs{ display: flex; gap: 2px; padding: 4px 8px 0; }
#gs-root .gs-tab{ background: none; border: none; color: var(--text-3); padding: 5px 14px; cursor: pointer; font-size: 12px; border-bottom: 2px solid transparent; }
#gs-root .gs-tab.on{ color: var(--text); border-bottom-color: var(--accent); }
#gs-root .gs-tabpage{ flex: 1; display: none; overflow: auto; padding: 8px; }
#gs-root .gs-tabpage.on{ display: block; }
#gs-root .gs-assets-bar{ display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#gs-root .gs-dim{ color: var(--text-3); font-size: 11px; }
#gs-root .gs-assetgrid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 10px; }
#gs-root .gs-asset{ background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; cursor: pointer; }
#gs-root .gs-asset:hover{ border-color: var(--accent); }
#gs-root .gs-asset img{ width: 100%; height: 64px; object-fit: cover; display: block; background: var(--bg-raised); }
#gs-root .gs-asset span{ display: block; font-size: 10px; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
#gs-root .gs-assetlist{ display: flex; flex-direction: column; gap: 3px; }
#gs-root .gs-file{ display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 6px; font-size: 12px; }
#gs-root .gs-file b{ flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gs-root .gs-scripts{ display: flex; flex-direction: column; gap: 4px; }
#gs-root .gs-console{ font: 11px/1.5 var(--font-mono); direction: ltr; text-align: left; }
#gs-root .gs-log{ padding: 1px 4px; white-space: pre-wrap; word-break: break-word; }
#gs-root .gs-log.info{ color: var(--text-2); }
#gs-root .gs-log.warn{ color: var(--warn); }
#gs-root .gs-log.error{ color: var(--bad); }

#gs-root .gs-addmenu{ position: absolute; top: 38px; right: 210px; z-index: 80; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; min-width: 170px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#gs-root .gs-addmenu button{ background: none; border: none; color: var(--text-2); text-align: left; padding: 6px 10px; border-radius: 5px; cursor: pointer; font-size: 12px; }
#gs-root .gs-addmenu button:hover{ background: var(--accent-strong); color: #fff; }

/* cinematic mode */
#gs-root .gs-lb{ position: absolute; left: 0; right: 0; height: 11%; background: #000; z-index: 30; pointer-events: none; }
#gs-root .gs-lb-top{ top: 0; } #gs-root .gs-lb-bottom{ bottom: 0; }
#gs-root .gs-cine-title{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 31; color: #e8d9b0; font: 600 26px Georgia, serif; letter-spacing: 4px; text-transform: uppercase; text-shadow: 0 2px 12px #000; pointer-events: none; white-space: nowrap; }
#gs-root .gs-cinepanel{ position: absolute; top: 44px; right: 12px; z-index: 60; width: 280px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.55); font-size: 12px; color: var(--text-2); }
#gs-root .gs-cine-h{ font-weight: 600; margin-bottom: 8px; color: #e8d9b0; }
#gs-root .gs-cine-row{ display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
#gs-root .gs-cine-row label{ display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); }
#gs-root .gs-cine-row.btns{ gap: 6px; }
#gs-root .gs-cine-row .gs-btn{ padding: 4px 10px; font-size: 11px; }
#gs-root .gs-cine-keys{ max-height: 160px; overflow-y: auto; margin: 6px 0; display: flex; flex-direction: column; gap: 3px; }
#gs-root .gs-cine-key{ display: flex; align-items: center; gap: 8px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 8px; font-size: 11px; }
#gs-root .gs-cine-key span:first-child{ color: #e8d9b0; min-width: 38px; }
#gs-root .gs-cine-key span:nth-child(2){ flex: 1; color: var(--text-3); font-family: var(--font-mono); font-size: 10px; }
#gs-root .gs-cine-key button{ background: none; border: none; color: var(--bad); cursor: pointer; padding: 0 4px; }

@media (max-width: 900px) {
  #gs-root .gs-left{ flex-basis: 190px; }
  #gs-root .gs-right{ flex-basis: 260px; }
  #gs-root .gs-title{ max-width: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  #gs-root.gs-root *, #gs-root.gs-root *::before, #gs-root.gs-root *::after{ scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== Team panel (studio-team.js) ===================================================== */
#gs-root .gs-body{ position: relative; }
#gs-root .gt-toggle{ display: inline-flex; align-items: center; gap: 6px; position: relative; }
#gs-root .gt-avs{ display: inline-flex; }
#gs-root .gt-avs .gt-av{ margin-left: -5px; box-shadow: 0 0 0 2px var(--line); }
#gs-root .gt-avs .gt-av:first-child{ margin-left: 0; }
#gs-root .gt-badge{ min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: var(--text); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
#gs-root .gt-av{ --c: #7c5cff; width: 26px; height: 26px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: var(--c); color: #fff; font-weight: 700; font-size: 12px; position: relative; }
#gs-root .gt-av.xs{ width: 18px; height: 18px; font-size: 9px; }
#gs-root .gt-av.online::after, #gs-root .gt-av.studio::after{ content: ''; position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--line); }
#gs-root .gt-av.xs.studio::after{ width: 6px; height: 6px; }
#gs-root .gt-av.busy{ box-shadow: 0 0 0 2px var(--warn); }

#gs-root .gt-panel{ position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 92vw); z-index: 5; display: flex; flex-direction: column; background: var(--bg-raised); border-left: 1px solid var(--line-strong); box-shadow: -18px 0 40px -18px rgba(0,0,0,.7); }
#gs-root .gt-panel.hidden{ display: none; }
#gs-root .gt-tabs{ display: flex; align-items: stretch; border-bottom: 1px solid var(--line-strong); flex: none; }
#gs-root .gt-tabs button{ flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-3); padding: 10px 6px 8px; cursor: pointer; font: 600 12px/1 inherit; }
#gs-root .gt-tabs button[aria-selected="true"]{ color: var(--text); border-bottom-color: var(--accent); }
#gs-root .gt-tabs .gt-close{ flex: 0 0 38px; font-size: 18px; }
#gs-root .gt-body{ flex: 1; min-height: 0; display: flex; flex-direction: column; }
#gs-root .gt-scroll{ flex: 1; overflow: auto; padding: 4px 12px 14px; }
#gs-root .gt-h{ margin: 14px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); display: flex; gap: 6px; align-items: baseline; }
#gs-root .gt-h small{ color: var(--text-3); letter-spacing: 0; }
#gs-root .gt-empty{ color: var(--text-3); text-align: center; padding: 24px 12px; line-height: 1.6; }
#gs-root .gt-empty.small{ padding: 6px 0; text-align: left; font-size: 12px; }
#gs-root .gt-hint{ color: var(--text-3); font-size: 12px; margin: 6px 0 0; line-height: 1.5; }

/* chat */
#gs-root .gt-chat{ flex: 1; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
#gs-root .gt-msg{ max-width: 88%; align-self: flex-start; margin-top: 8px; }
#gs-root .gt-msg.grouped{ margin-top: 2px; }
#gs-root .gt-msg.mine{ align-self: flex-end; }
#gs-root .gt-meta{ display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
#gs-root .gt-msg.mine .gt-meta{ justify-content: flex-end; }
#gs-root .gt-meta b{ color: var(--text-2); }
#gs-root .gt-bubble{ background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 7px 10px; word-wrap: break-word; overflow-wrap: anywhere; }
#gs-root .gt-msg.mine .gt-bubble{ background: #2c4a68; border-color: #3a6390; }
#gs-root .gt-bubble code{ background: var(--bg); padding: 1px 4px; border-radius: 4px; font: 12px var(--font-mono); }
#gs-root .gt-code{ background: var(--bg); border-radius: 6px; padding: 8px; margin: 6px 0 0; overflow: auto; font: 12px/1.4 var(--font-mono); white-space: pre; }
#gs-root .gt-bubble a{ color: var(--accent); }
#gs-root .gt-form{ border-top: 1px solid var(--line-strong); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; flex: none; }
#gs-root .gt-form textarea, #gs-root .gt-invite input, #gs-root .gt-invite select{ width: 100%; box-sizing: border-box; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
#gs-root .gt-form textarea:focus, #gs-root .gt-invite input:focus, #gs-root .gt-invite select:focus{ border-color: var(--accent); outline: none; }
#gs-root .gt-form-row{ display: flex; justify-content: space-between; gap: 8px; }
#gs-root .gt-objlink{ background: #2f4a66; border: 1px solid #3c5f84; color: var(--accent); border-radius: 6px; padding: 2px 8px; margin-top: 4px; cursor: pointer; font: inherit; font-size: 11px; }
#gs-root .gt-objlink.inline{ padding: 0 5px; margin: 0; }
#gs-root .gt-objlink:hover{ background: var(--accent-strong); color: #fff; }

/* activity */
#gs-root .gt-act{ display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.45; }
#gs-root .gt-act > div{ flex: 1; min-width: 0; overflow-wrap: anywhere; }
#gs-root .gt-act time{ display: block; color: var(--text-3); font-size: 11px; }
#gs-root .gt-act.live{ background: linear-gradient(90deg, rgba(61,220,132,.07), transparent 60%); border-radius: 6px; padding-left: 4px; }

/* team */
#gs-root .gt-member{ display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); }
#gs-root .gt-member > div{ flex: 1; min-width: 0; }
#gs-root .gt-member b{ display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
#gs-root .gt-member small{ display: block; color: var(--text-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gs-root .gt-member.pending{ opacity: .8; }
#gs-root .gt-role{ font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
#gs-root .gt-role.owner{ background: #3a2f12; color: var(--warn); }
#gs-root .gt-role.editor{ background: #23415e; color: var(--accent); }
#gs-root .gt-can{ width: 18px; text-align: center; font-size: 12px; }
#gs-root .gt-can.no{ opacity: .55; }
#gs-root .gs-btn.small{ padding: 3px 8px; font-size: 11px; }
#gs-root .gt-switch{ display: flex; align-items: center; gap: 10px; margin-top: 12px; cursor: pointer; }
#gs-root .gt-switch input{ position: absolute; opacity: 0; width: 1px; height: 1px; }
#gs-root .gt-switch span{ width: 38px; height: 22px; border-radius: 11px; background: var(--bg-raised); position: relative; transition: background .15s; flex: none; }
#gs-root .gt-switch span::after{ content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
#gs-root .gt-switch input:checked + span{ background: var(--ok); }
#gs-root .gt-switch input:checked + span::after{ transform: translateX(16px); }
#gs-root .gt-switch input:focus-visible + span{ outline: 2px solid var(--gs-focus); outline-offset: 2px; }
#gs-root .gt-switch b{ color: var(--text); }
#gs-root .gt-status{ margin-top: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
#gs-root .gt-status.on{ border-color: #23593d; background: rgba(47,191,113,.08); }
#gs-root .gt-status span{ color: var(--text-3); font-size: 12px; }
#gs-root .gt-invite{ display: grid; grid-template-columns: 1fr; gap: 6px; }
#gs-root .gt-results{ margin-top: 4px; }

/* hierarchy: who has which object selected / is moving it */
#gs-root .gt-hmarks{ display: inline-flex; gap: 2px; margin-left: auto; }
#gs-root .gt-hmarks + .gs-eye{ margin-left: 4px; }

/* view-only mode (team editing off and not the admin) */
#gs-root .gs-ro-banner{ flex: none; padding: 6px 12px; background: var(--surface); color: #ffd98a; border-bottom: 1px solid #4a3d16; font-size: 12px; }
#gs-root .gs-ro-banner.hidden{ display: none; }
#gs-root.gs-readonly .gs-inspector input, #gs-root.gs-readonly .gs-inspector select, #gs-root.gs-readonly .gs-inspector textarea, #gs-root.gs-readonly .gs-inspector button,
#gs-root.gs-readonly .gs-eye{ pointer-events: none; opacity: .55; }
#gs-root.gs-readonly [data-a="add"], #gs-root.gs-readonly [data-a="save"], #gs-root.gs-readonly [data-a="undo"], #gs-root.gs-readonly [data-a="redo"], #gs-root.gs-readonly #gs-gizmo{ display: none; }
#gs-root.gs-readonly .gs-hrow{ cursor: default; }

/* ===== Layering + isolation fixes ======================================================
   The app header (sticky, z-index 100) and the phone navigation (z-index 200) sat ON TOP of the
   studio: Play, Add, Save, Export and Team in the studio toolbar could not be clicked.
   While a game panel is open they are hidden (visibility keeps the page layout behind unchanged). */
body.gs-open .topbar, body.gs-open .sidebar { visibility: hidden; }
/* style.css gives every input 42px min-height and a focus glow – the studio uses compact engine controls */
#gs-root input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), #gs-root select, #gs-root textarea { min-height: 0; }
#gs-root input:focus, #gs-root select:focus, #gs-root textarea:focus { box-shadow: none; border-color: var(--accent); }
#gs-root select.gs-select { width: auto; min-width: 92px; }
#gs-root .gs-assetgrid > .gs-empty, #gs-root .gs-assetgrid > p { grid-column: 1 / -1; }
/* the studio toolbar has ~25 controls – wrap instead of pushing Export / Desktop App / Cine off-screen */
#gs-root .gs-top { flex-wrap: wrap; row-gap: 6px; }

/* ===== Unity-style workspace (neutral grey engine theme) ================================
   Toolbar: [back · title · save | tools]  [▶ ⏸ centred]  [team · save · build]
   Panels with tab headers (Hierarchy · Scene · Inspector · Assets/Scripts/Console),
   flat inspector components with label | field rows, compact 20px controls. */
#gs-root.gs-root { background: var(--bg); color: var(--text-2); font: 12px/1.4 var(--font-ui); }
#gs-root .gs-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 36px; padding: 0 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
#gs-root .gs-tb { display: flex; align-items: center; gap: 4px; min-width: 0; }
#gs-root .gs-tb-left { justify-self: start; }
#gs-root .gs-tb-right { justify-self: end; overflow-x: auto; scrollbar-width: none; }
#gs-root .gs-tb-right::-webkit-scrollbar { display: none; }
#gs-root .gs-tb-tools { margin-left: 8px; }
#gs-root .gs-title { max-width: 200px; font-weight: 600; color: var(--text); }
#gs-root .gs-save { min-width: 0; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }

#gs-root .gs-btn { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: 3px; font-size: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
#gs-root .gs-btn:hover { background: var(--surface-3); color: var(--text); }
#gs-root .gs-btn.on { background: #46607c; border-color: var(--accent); color: #fff; }
#gs-root .gs-btn:disabled { opacity: .45; }
#gs-root .gs-group { gap: 0; padding: 0; background: none; border: 0; border-radius: 3px; }
#gs-root .gs-group > .gs-btn { border-radius: 0; margin-left: -1px; }
#gs-root .gs-group > .gs-btn:first-child { border-radius: 3px 0 0 3px; margin-left: 0; }
#gs-root .gs-group > .gs-btn:last-child { border-radius: 0 3px 3px 0; }
#gs-root .gs-tb-tools [data-gizmo] { width: 28px; justify-content: center; font-size: 14px; }
#gs-root .gs-playgroup > .gs-btn { width: 34px; justify-content: center; font-size: 13px; }
#gs-root .gs-playgroup > .gs-btn.on { background: var(--accent-soft); border-color: var(--accent-strong); }
#gs-root.gs-root.playing .gs-top { box-shadow: inset 0 -2px 0 var(--accent-strong); }

/* panel tab headers */
#gs-root .gs-ptabs { flex: none; display: flex; align-items: flex-end; height: 26px; padding: 0 4px 0 0; background: var(--surface); border-bottom: 1px solid var(--line); }
#gs-root .gs-ptab { position: relative; top: 1px; padding: 4px 12px 5px; margin-left: 3px; background: var(--bg-raised); color: var(--text); border: 1px solid var(--line); border-bottom-color: var(--line); border-radius: 3px 3px 0 0; font-size: 12px; }
#gs-root .gs-ptools { margin-left: auto; align-self: center; display: flex; align-items: center; gap: 3px; }
#gs-root .gs-ptools .gs-btn, #gs-root .gs-ptools select.gs-select { height: 20px; padding: 0 7px; font-size: 11px; }
#gs-root .gs-ptools select.gs-select { min-width: 84px; background: var(--surface-2); border-color: var(--line-strong); border-radius: 3px; }
#gs-root .gs-scenetabs .gs-ptab { background: var(--surface); border-bottom-color: var(--line-strong); }
#gs-root #gs-hier-tools .gs-btn { width: 24px; justify-content: center; padding: 0; font-size: 14px; }

/* panels */
#gs-root .gs-left, #gs-root .gs-right { background: var(--bg-raised); }
#gs-root .gs-resizer { width: 3px; background: var(--bg); }
#gs-root .gs-resizer-h { height: 3px; background: var(--bg); }
#gs-root .gs-viewport { background: var(--surface); }
#gs-root .gs-viewbar { background: var(--surface); border-top: 1px solid var(--line); color: var(--text-3); }
#gs-root .gs-hier { padding-top: 2px; }
#gs-root .gs-hrow { min-height: 20px; padding-top: 1px; padding-bottom: 1px; border-left: 0; }
#gs-root .gs-hrow:hover { background: var(--surface-3); }
#gs-root .gs-hrow.sel { background: var(--accent-soft); color: var(--text); }
#gs-root .gs-eye { color: var(--text-3); }
#gs-root .gs-eye.off { color: var(--text-3); }

/* inspector: flat components, label | value rows */
#gs-root .gs-inspector { padding: 0 0 12px; }
#gs-root .gs-sec { background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; padding: 0 8px 8px; margin: 0; }
#gs-root .gs-sec-h { margin: 0 -8px 6px; padding: 5px 8px; background: var(--surface-3); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); font-weight: 600; color: var(--text); }
#gs-root .gs-field:has(> label) { display: grid; grid-template-columns: minmax(70px, 38%) minmax(0, 1fr); align-items: center; gap: 6px; margin-bottom: 3px; }
#gs-root .gs-field > label { margin: 0; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-field input[type="number"], #gs-root .gs-field input[type="text"], #gs-root .gs-field select, #gs-root #gs-name { height: 20px; padding: 1px 5px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 3px; font-size: 12px; }
#gs-root .gs-field textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; }
#gs-root .gs-field input:focus, #gs-root .gs-field select:focus, #gs-root .gs-field textarea:focus { border-color: var(--accent-strong); }
#gs-root .gs-field input[type="color"] { height: 20px; background: var(--surface); border-color: var(--line); border-radius: 3px; }
#gs-root .gs-vec { gap: 3px; align-items: center; }
#gs-root .gs-vec i { width: auto; padding: 0 1px 0 3px; font-size: 11px; color: var(--text-2); }
#gs-root .gs-check { color: var(--text-2); }

/* bottom panel as tabs */
#gs-root .gs-bottom { background: var(--bg-raised); border-top: 0; }
#gs-root .gs-tabs { gap: 0; padding: 0 4px 0 0; height: 26px; align-items: flex-end; background: var(--surface); border-bottom: 1px solid var(--line); }
#gs-root .gs-tab { position: relative; top: 1px; margin-left: 3px; padding: 4px 12px 5px; color: var(--text-2); border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; font-size: 12px; }
#gs-root .gs-tab.on { background: var(--bg-raised); color: var(--text); border-color: var(--line); border-bottom-color: var(--line); }
#gs-root .gs-tabpage { background: var(--bg-raised); }

/* narrow windows: toolbar flows instead of a centred play group */
@media (max-width: 1180px) {
  #gs-root .gs-top { display: flex; flex-wrap: wrap; row-gap: 4px; padding: 4px 8px; }
  #gs-root .gs-tb-right { justify-self: auto; margin-left: auto; }
}
/* team panel docks like an editor panel (the scene view shrinks) instead of floating over it */
#gs-root .gt-panel { position: relative; inset: auto; flex: 0 0 min(340px, 40vw); width: auto; z-index: 1; box-shadow: none; border-left: 3px solid var(--line); }
#gs-root .gt-tabs { height: 26px; background: var(--surface); border-bottom: 1px solid var(--line); align-items: flex-end; }
#gs-root .gt-tabs button { padding: 4px 8px 5px; font-weight: 400; color: var(--text-2); border-bottom: 0; border-radius: 3px 3px 0 0; border: 1px solid transparent; position: relative; top: 1px; flex: 0 0 auto; margin-left: 3px; }
#gs-root .gt-tabs button[aria-selected="true"] { background: var(--bg-raised); color: var(--text); border-color: var(--line); border-bottom-color: var(--line); }
#gs-root .gt-tabs .gt-close { margin-left: auto; flex: 0 0 28px; border: 0; top: 0; align-self: center; }
#gs-root .gt-panel { background: var(--bg-raised); }
/* inspector rows: label | control | optional value (sliders show their number on the right) */
#gs-root .gs-field:has(> label) { grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) auto; }
#gs-root .gs-field:has(> label) > :nth-child(2):last-child { grid-column: 2 / 4; }
#gs-root .gs-field > span, #gs-root .gs-field > output { font-size: 11px; color: var(--text-2); min-width: 30px; text-align: right; }
#gs-root .gs-field:has(> .gs-maprow) { display: block; }
#gs-root .gs-field:has(> .gs-maprow) > label { display: block; margin-bottom: 3px; }
#gs-root .gs-maprow { display: grid; grid-template-columns: minmax(70px, 38%) minmax(0, 1fr); align-items: center; gap: 6px; margin: 0 0 3px; }
#gs-root .gs-maprow > span { padding-left: 10px; color: var(--text-2); text-transform: capitalize; text-align: left; }
#gs-root .gs-right { flex-basis: var(--gs-right-w, 330px); }
#gs-root .gs-vec input { padding-left: 3px; padding-right: 2px; }

/* ===== Add menu (grouped like an engine's GameObject menu) + Shape section ===== */
#gs-root .gs-addmenu-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, auto)); gap: 2px 10px; padding: 8px; max-width: min(92vw, 900px); max-height: 70vh; overflow: auto; flex-direction: row; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 90; }
#gs-root .gs-addcol { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#gs-root .gs-addh { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: 3px; }
#gs-root .gs-addmenu-grid button { white-space: nowrap; padding: 4px 8px; border-radius: 3px; text-align: left; }
#gs-root .gs-addmenu-grid button:hover { background: var(--accent-soft); }
#gs-root .gs-shape .gs-sec-h { justify-content: space-between; }
#gs-root .gs-shape .gs-mini { margin-left: auto; font-weight: 400; }
#gs-root .gs-subh { margin: 8px 0 4px; padding-top: 6px; border-top: 1px solid var(--line-strong); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
#gs-root .gs-shape input[type="range"] { width: 100%; accent-color: var(--accent); }
@media (max-width: 900px) { #gs-root .gs-addmenu-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); } }

/* ===== One control style for every window in the studio (World, Gameplay, Cine, Team, menus) =====
   :where() keeps this at low specificity: specific panel rules still win, but nothing falls back to the
   app's 42px navy form style any more. */
#gs-root :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), select) {
  width: auto; min-height: 0; height: 24px; padding: 1px 7px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 3px; font: 12px/1.2 inherit; box-shadow: none;
}
#gs-root :where(textarea) { min-height: 0; padding: 6px 8px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 3px; font-size: 12px; box-shadow: none; }
#gs-root :where(input, select, textarea):focus { border-color: var(--accent-strong); outline: none; box-shadow: none; }
#gs-root input[type="range"] { min-height: 0; height: 16px; padding: 0; margin: 0; border: 0; background: none; accent-color: var(--accent); }
#gs-root :where(button.primary, .gs-cinepanel button:not(.gs-panel-x)) {
  min-height: 0; height: 24px; padding: 0 10px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 12px; box-shadow: none; display: inline-flex; align-items: center; gap: 4px; width: auto;
}
#gs-root :where(button.primary) { background: var(--accent-soft); border-color: var(--accent-strong); color: var(--text); }
#gs-root :where(.gs-cinepanel button:not(.gs-panel-x)):hover { background: var(--surface-3); }

/* floating tool window (World / Gameplay / Cine) */
#gs-root .gs-cinepanel { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 12px 32px rgba(0,0,0,.45); padding: 0 10px 10px; width: 290px; }
#gs-root .gs-cine-h { display: flex; align-items: center; margin: 0 -10px 8px; padding: 6px 6px 6px 10px; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: 4px 4px 0 0; font-weight: 600; color: var(--text); }
#gs-root .gs-panel-x { margin-left: auto; width: 22px; height: 22px; padding: 0; border: 0; background: none; color: var(--text-2); font-size: 16px; line-height: 1; border-radius: 3px; cursor: pointer; }
#gs-root .gs-panel-x:hover { background: var(--surface-3); color: var(--text); }
#gs-root .gs-cine-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
#gs-root .gs-cine-row label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text-2); }
#gs-root .gs-cine-row label input { width: 70px; }
#gs-root .gs-cinepanel textarea { width: 100%; box-sizing: border-box; font-family: var(--font-mono); }
#gs-root .gs-cinepanel > input, #gs-root .gs-cinepanel label > input:not([type="checkbox"]) { box-sizing: border-box; }

/* team panel fields */
#gs-root .gt-invite input, #gs-root .gt-invite select { height: 26px; padding: 2px 8px; background: var(--surface); border-color: var(--line); border-radius: 3px; }
#gs-root .gt-form textarea { background: var(--surface); border-color: var(--line); border-radius: 3px; }

/* X / Y / Z rows get more room so values like -45.84 are not cut off */
#gs-root .gs-field:has(> .gs-vec) { grid-template-columns: minmax(56px, 24%) minmax(0, 1fr); }
#gs-root .gs-vec input { min-width: 0; font-variant-numeric: tabular-nums; }
#gs-root .gs-cine-row label input[type="checkbox"] { width: auto; }
#gs-root .gs-cine-row input:not([type="checkbox"], [type="number"]) { flex: 1; min-width: 0; }

/* ===== Viewports: 1 / 2 / 4 views with orientation gizmo (modern floating overlays) ===== */
#gs-root .gs-panes { position: absolute; inset: 0; pointer-events: none; }
#gs-root .gs-pane { position: absolute; pointer-events: auto; box-sizing: border-box; outline: 1px solid transparent; outline-offset: -1px; transition: outline-color .15s; touch-action: none; }
#gs-root .gs-panes[data-layout="two"] .gs-pane, #gs-root .gs-panes[data-layout="four"] .gs-pane { outline-color: var(--line); }
#gs-root .gs-panes[data-layout="two"] .gs-pane.active, #gs-root .gs-panes[data-layout="four"] .gs-pane.active { outline: 1px solid color-mix(in srgb, var(--accent) 75%, transparent); }
#gs-root .gs-pane-head { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; z-index: 2; }
#gs-root .gs-pane-head select.gs-pane-view {
  height: 24px; padding: 0 22px 0 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08);
  background: rgba(30,30,32,.62) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23c8c8c8'/%3E%3C/svg%3E") no-repeat right 9px center;
  -webkit-appearance: none; appearance: none; color: var(--text); font-size: 11.5px; font-weight: 500;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(0,0,0,.25); cursor: pointer; width: auto;
}
#gs-root .gs-pane-head select.gs-pane-view:hover { background-color: rgba(50,50,54,.8); }
#gs-root .gs-viewgizmo { position: absolute; top: 6px; right: 6px; width: 72px; z-index: 2; display: flex; flex-direction: column; align-items: center; user-select: none; }
#gs-root .gs-viewgizmo svg { display: block; overflow: visible; }
#gs-root .gs-vg-bg { fill: rgba(30,30,32,0); stroke: none; transition: fill .15s; }
#gs-root .gs-viewgizmo:hover .gs-vg-bg { fill: rgba(30,30,32,.45); }
#gs-root .gs-vg-axis { cursor: pointer; }
#gs-root .gs-vg-axis circle { transition: r .12s; }
#gs-root .gs-vg-axis:hover circle { stroke: #fff; stroke-width: 2; }
#gs-root .gs-vg-axis text { font: 700 9px/1 var(--font-ui); fill: var(--bg-raised); pointer-events: none; }
#gs-root .gs-vg-centre circle { fill: #d8d8d8; stroke: rgba(0,0,0,.35); cursor: pointer; }
#gs-root .gs-vg-centre:hover circle { fill: #fff; }
#gs-root .gs-viewname { margin-top: -2px; padding: 1px 8px; border-radius: 9px; font-size: 10.5px; color: var(--text); background: rgba(30,30,32,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#gs-root .gs-layout { margin: 0 2px; }
#gs-root .gs-layout .gs-btn { width: 26px; justify-content: center; padding: 0; font-size: 13px; }
/* Play: one game view without editor overlays; clicks go to the game (pointer lock) */
#gs-root.gs-root.playing .gs-pane-head, #gs-root.gs-root.playing .gs-viewgizmo { display: none; }
#gs-root.gs-root.playing .gs-layout { opacity: .4; pointer-events: none; }
/* the old "Perspective/Orthographic" select is now the gizmo's centre button */
#gs-root #gs-cam { display: none; }
/* the 3D canvas always fills exactly the Scene view (display scaling 125 %/150 % made it overflow) */
#gs-root .gs-viewport { overflow: hidden; }
#gs-root .gs-viewport > canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* ===== Components in the Inspector (Physics, Controller, Audio, Particles, Animator, AI …) ===== */
#gs-root .gs-comps-sec .gs-sec-h { justify-content: space-between; }
#gs-root #gs-addcomp { margin-left: auto; font-weight: 500; }
#gs-root .gs-comp { margin: 0 -8px; padding: 0 8px 8px; border-top: 1px solid var(--line-strong); border-bottom: 0; background: transparent; }
#gs-root .gs-comp + .gs-comp { margin-top: 0; }
#gs-root .gs-comp-h { display: flex; align-items: center; gap: 6px; margin: 0 -8px 6px; padding: 5px 8px; background: var(--surface-3); border-bottom: 1px solid var(--line-strong); }
#gs-root .gs-comp-h b { flex: 1; font-size: 12px; color: var(--text); font-weight: 600; }
#gs-root .gs-comp-ic { width: 18px; text-align: center; }
#gs-root .gs-comp-h .gs-mini { width: 22px; height: 20px; padding: 0; justify-content: center; }
#gs-root .gs-comp-hint { font-size: 11px; color: var(--text-3); margin: -2px 0 6px; line-height: 1.4; }
#gs-root .gs-comp .gs-code { width: 100%; box-sizing: border-box; min-height: 120px; font: 12px/1.45 var(--font-mono); }
#gs-root .gs-comp-empty { padding: 4px 0 2px; font-size: 11.5px; }
/* Animation Controller: state machine editor (v5.46) */
#gs-root .gs-sm { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 6px; }
#gs-root .gs-sm-h { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; }
#gs-root .gs-sm-h b { flex: 1; color: var(--text-2); font-weight: 600; }
#gs-root .gs-sm-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
#gs-root .gs-sm-row > input[type=text], #gs-root .gs-sm-row > select { flex: 1 1 0; min-width: 0; }
#gs-root .gs-sm-row > input[type=number] { width: 56px; flex: 0 0 auto; }
#gs-root .gs-sm-row .gs-mini { flex: 0 0 auto; }
#gs-root .gs-sm-state { display: flex; flex-direction: column; gap: 3px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
#gs-root .gs-sm-blend { display: flex; flex-direction: column; gap: 3px; padding-left: 10px; border-left: 2px solid var(--line-strong); }
#gs-root .gs-sm-start.on { color: var(--accent); }
#gs-root .gs-sm-trans { flex-wrap: wrap; }
#gs-root .gs-sm-trans > input[type=text] { order: 5; flex: 1 0 100%; }   /* the condition gets its own line */
#gs-root .gs-sm-trans input[type=text].bad { border-color: #e5484d; }
#gs-root .gs-sm-note { font-size: 11px; }
#gs-root .gs-compmenu { grid-template-columns: repeat(4, minmax(140px, auto)); }
#gs-root .gs-compmenu button:disabled { opacity: .4; cursor: default; background: none; }

/* ===== Prefabs + Project window ===== */
#gs-root .gs-hrow.prefab .gs-hname, #gs-root .gs-hrow.prefab .gs-hicon { color: var(--accent); }
#gs-root .gs-hrow.prefab-part .gs-hname { color: #c4bbff; }
#gs-root .gs-hrow.sel.prefab .gs-hname, #gs-root .gs-hrow.sel.prefab-part .gs-hname { color: var(--text); }
#gs-root .gs-prefab-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 6px 8px; background: #2a2552; border-bottom: 1px solid #1a1738; color: #e0dbff; font-size: 12px; }
#gs-root .gs-prefab-bar > span { flex: 1 1 100%; margin-bottom: 2px; }
#gs-root .gs-prefab-bar.part { background: var(--surface-3); color: #b9c6d6; }
#gs-root .gs-prefab-bar.part > span { flex: 1; margin: 0; }
#gs-root .gs-prefab-bar.missing { background: #4a2e2e; color: #ffd0d0; }
#gs-root .gs-proj { display: flex; height: 100%; min-height: 0; }
#gs-root .gs-proj-tree { flex: 0 0 160px; border-right: 1px solid var(--line-strong); padding: 4px 0; overflow: auto; }
#gs-root .gs-proj-tree button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 10px; background: none; border: 0; color: var(--text-2); font-size: 12px; text-align: left; cursor: pointer; }
#gs-root .gs-proj-tree button:hover { background: var(--surface-3); }
#gs-root .gs-proj-tree button.on { background: var(--accent-soft); color: var(--text); }
#gs-root .gs-proj-tree button small { margin-left: auto; color: var(--text-3); }
#gs-root .gs-proj-tree button.on small { color: #d6e6f7; }
#gs-root .gs-proj-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#gs-root .gs-proj-bar { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-bottom: 1px solid var(--line-strong); }
#gs-root .gs-proj-bar input[type="search"] { width: 220px; }
#gs-root .gs-proj-bar .gs-dim { font-size: 11px; }
#gs-root .gs-proj-grid { flex: 1; overflow: auto; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; align-content: start; border: 1px dashed transparent; }
#gs-root .gs-proj-grid.drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
#gs-root .gs-proj-grid > .gs-empty { grid-column: 1 / -1; }
#gs-root .gs-ptile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 6px; border-radius: 4px; cursor: default; text-align: center; }
#gs-root .gs-ptile:hover { background: var(--surface-3); }
#gs-root .gs-ptile.prefab { cursor: grab; }
#gs-root .gs-ptile-ic { width: 56px; height: 56px; display: grid; place-items: center; font-size: 30px; border-radius: 6px; background: var(--surface); overflow: hidden; }
#gs-root .gs-ptile.prefab .gs-ptile-ic { color: var(--accent); background: linear-gradient(160deg, #3a3170, #221d45); }
#gs-root .gs-ptile-ic img { width: 100%; height: 100%; object-fit: cover; }
#gs-root .gs-ptile b { max-width: 100%; font-size: 11.5px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gs-root .gs-ptile small { max-width: 100%; font-size: 10px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gs-root .gs-ptile-act { position: absolute; top: 4px; right: 4px; display: none; gap: 2px; }
#gs-root .gs-ptile:hover .gs-ptile-act { display: flex; }
#gs-root .gs-ptile-act button { width: 22px; height: 20px; padding: 0; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface-2); color: var(--text); font-size: 11px; cursor: pointer; }
#gs-root .gs-ptile-act button:hover { background: var(--accent-soft); color: var(--text); }
#gs-root .gs-pane.playing .gs-pane-head { display: none; }

/* ===== Editor tools: search, tags, multi-select, history, shortcuts, play mode ===== */
#gs-root .gs-hier-search { padding: 4px 6px; border-bottom: 1px solid var(--line-strong); }
#gs-root .gs-hier-search input { width: 100%; box-sizing: border-box; height: 22px; font-size: 12px; }
#gs-root .gs-htag { margin-left: 6px; padding: 0 5px; border-radius: 3px; background: #342d63; color: #d9d2ff; font-size: 10px; line-height: 15px; white-space: nowrap; }
#gs-root .gs-hrow .gs-hname { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-multi-note { padding: 6px 8px; background: #231f47; color: #e0dbff; font-size: 11.5px; border-bottom: 1px solid #1a1738; }
#gs-root .gs-floatpanel { position: absolute; top: 44px; right: 10px; z-index: 30; width: 260px; max-height: calc(100% - 64px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.45); color: var(--text); font-size: 12px; }
#gs-root .gs-floathead { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 10px; border-bottom: 1px solid var(--line); }
#gs-root .gs-floathead .gs-dim { font-size: 11px; }
#gs-root .gs-histlist { overflow: auto; padding: 4px 0; }
#gs-root .gs-hist { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 10px; background: none; border: 0; color: var(--text); font-size: 12px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-hist span { width: 14px; flex: 0 0 14px; text-align: center; color: #8fb7e3; }
#gs-root .gs-hist:hover { background: var(--surface-3); }
#gs-root .gs-hist.now { background: var(--accent-soft); color: var(--text); }
#gs-root .gs-hist.future { color: var(--text-3); }
#gs-root .gs-hist.future span { color: var(--text-3); }
#gs-root .gs-histhint { padding: 6px 10px; border-top: 1px solid var(--line); font-size: 11px; }
#gs-root .gs-keys { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0,0,0,.45); }
#gs-root .gs-keys-box { width: min(760px, 92%); max-height: 86%; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); color: var(--text); }
#gs-root .gs-keys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 22px; padding: 12px 16px 16px; }
#gs-root .gs-keys-grid h4 { margin: 8px 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
#gs-root .gs-keys-grid div { display: flex; align-items: baseline; gap: 10px; padding: 3px 0; font-size: 12px; }
#gs-root .gs-keys-grid kbd { flex: 0 0 auto; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-3); color: var(--text); font: 11px/1.5 var(--font-mono); text-align: center; }
#gs-root .gs-playbanner { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 25; padding: 5px 14px; border-radius: 14px; background: rgba(28,60,100,.85); color: #dcebff; font-size: 12px; pointer-events: none; white-space: nowrap; }
#gs-root.playing .gs-left, #gs-root.playing .gs-right, #gs-root.playing .gs-bottom { box-shadow: inset 0 0 0 9999px rgba(110,90,230,.13); }
#gs-root.playing .gs-viewport { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: -2px; }


/* ===== Tripo-style workspace (v5.31): floating rounded panels, tool rail, viewer bar ===== */
#gs-root { background: var(--bg); font-family: var(--font-ui); }
#gs-root .gs-top { background: var(--bg); border-bottom: 0; }
#gs-root .gs-body { gap: 6px; padding: 0 6px 6px; background: var(--bg); }
#gs-root .gs-left, #gs-root .gs-right, #gs-root .gs-center { border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); }
#gs-root .gs-bottom { margin: 0 6px 6px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); }
#gs-root .gs-resizer { background: transparent; }
#gs-root .gs-ptabs { background: var(--bg-raised); border-bottom: 1px solid var(--line-strong); }
#gs-root .gs-btn, #gs-root .gs-mini, #gs-root input, #gs-root select, #gs-root textarea { border-radius: 8px; }
#gs-root .gs-top .gs-btn { border-radius: 9px; }
#gs-root .gs-btn.on, #gs-root .gs-top .gs-btn.on { background: var(--accent-grad); border-color: transparent; color: #fff; }
#gs-root .gs-play.on, #gs-root [data-a="play"].on { background: var(--ok); }
#gs-root .gs-sec { border-bottom-color: var(--line-strong); }
#gs-root .gs-sec-h { letter-spacing: .02em; }
#gs-root .gs-viewport { background: radial-gradient(120% 90% at 50% 35%, var(--surface-3) 0%, var(--bg-raised) 60%, var(--bg) 100%); }
/* left tool rail */
#gs-root .gs-rail { flex: 0 0 64px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 6px; border-radius: 12px; background: var(--bg-raised); border: 1px solid var(--line-strong); overflow-y: auto; }
#gs-root .gs-rail button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font-size: 10.5px; line-height: 1.1; cursor: pointer; transition: background .15s, color .15s; }
#gs-root .gs-rail button .ic { font-size: 19px; line-height: 1; filter: saturate(.8); }
#gs-root .gs-rail button:hover { background: var(--surface); color: var(--text); }
#gs-root .gs-rail button.on { background: linear-gradient(160deg, rgba(122,104,245,.32), rgba(91,140,255,.18)); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
#gs-root .gs-rail .gs-rail-sep { height: 1px; margin: 4px 6px; background: var(--surface-2); }
#gs-root .gs-rail .gs-rail-ai { margin-top: auto; font-size: 9.5px; text-align: center; color: var(--text-3); padding: 4px 0; }
#gs-root .gs-rail .gs-rail-ai b { display: block; color: var(--accent); font-weight: 600; }
/* tool pane (replaces the Hierarchy while a tool is open) */
#gs-root .gs-toolpane { flex: 1; overflow-y: auto; padding: 12px; color: var(--text); font-size: 12.5px; }
#gs-root .gs-toolpane h3 { margin: 0 0 4px; font-size: 15px; font-weight: 650; color: var(--text); display: flex; align-items: center; gap: 8px; }
#gs-root .gs-toolpane .gs-tp-sub { margin: 0 0 12px; color: var(--text-3); font-size: 12px; line-height: 1.45; }
#gs-root .gs-toolpane .gs-tp-card { padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-strong); margin-bottom: 10px; }
#gs-root .gs-toolpane .gs-tp-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
#gs-root .gs-toolpane .gs-tp-row > label { flex: 0 0 92px; color: var(--text-2); font-size: 12px; }
#gs-root .gs-toolpane .gs-tp-row > select, #gs-root .gs-toolpane .gs-tp-row > input:not([type="checkbox"]) { flex: 1; min-width: 0; }
#gs-root .gs-toolpane textarea { width: 100%; box-sizing: border-box; min-height: 92px; resize: vertical; padding: 9px 10px; background: var(--bg-raised); border: 1px solid var(--line-strong); color: var(--text); font: inherit; line-height: 1.45; }
#gs-root .gs-toolpane textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
#gs-root .gs-seg { display: flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line-strong); margin-bottom: 10px; }
#gs-root .gs-seg button { flex: 1; padding: 6px 4px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-size: 12px; cursor: pointer; }
#gs-root .gs-seg button.on { background: var(--surface-3); color: var(--text); }
#gs-root .gs-cta { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--accent-grad); color: #fff; font-size: 13.5px; font-weight: 650; cursor: pointer; box-shadow: 0 6px 18px rgba(110,90,240,.35); }
#gs-root .gs-cta:hover { filter: brightness(1.08); }
#gs-root .gs-cta:disabled { opacity: .5; cursor: default; box-shadow: none; }
#gs-root .gs-cta.alt { background: var(--surface-2); box-shadow: none; border: 1px solid var(--line-strong); font-weight: 550; }
#gs-root .gs-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
#gs-root .gs-chips button { padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--text-2); font-size: 11.5px; cursor: pointer; }
#gs-root .gs-chips button:hover { border-color: var(--accent); color: var(--text); }
#gs-root .gs-engine { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 11px; color: var(--text-2); }
#gs-root .gs-engine i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
#gs-root .gs-engine.ai i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
#gs-root .gs-drop { display: grid; place-items: center; min-height: 120px; padding: 10px; border: 1.5px dashed var(--line-strong); border-radius: 10px; color: var(--text-3); text-align: center; cursor: pointer; background: var(--bg-raised); }
#gs-root .gs-drop:hover, #gs-root .gs-drop.over { border-color: var(--accent); color: var(--text); }
#gs-root .gs-drop img { max-width: 100%; max-height: 150px; border-radius: 6px; }
#gs-root .gs-views4 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#gs-root .gs-views4 .gs-drop { min-height: 78px; font-size: 11px; }
#gs-root .gs-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#gs-root .gs-gitem { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); cursor: pointer; }
#gs-root .gs-gitem:hover { border-color: var(--accent); }
#gs-root .gs-gitem .th { aspect-ratio: 1; display: grid; place-items: center; font-size: 30px; background: radial-gradient(circle at 50% 40%, var(--surface-3), var(--bg-raised)); }
#gs-root .gs-gitem .th img { width: 100%; height: 100%; object-fit: cover; }
#gs-root .gs-gitem .cap { padding: 5px 7px; font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-gitem .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent-grad); transition: width .4s; }
#gs-root .gs-gitem .st { position: absolute; top: 6px; left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 10px; background: rgba(0,0,0,.6); color: var(--text); }
#gs-root .gs-gitem .st.fail { background: rgba(160,40,50,.8); }
/* viewer bar (bottom centre of the Scene view) */
#gs-root .gs-viewerbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(18,19,26,.82); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.07); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
#gs-root .gs-viewerbar button { padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 12px; cursor: pointer; white-space: nowrap; }
#gs-root .gs-viewerbar button:hover { background: rgba(255,255,255,.06); color: var(--text); }
#gs-root .gs-viewerbar button.on { background: color-mix(in srgb, var(--accent) 22%, transparent); color: #fff; }
#gs-root .gs-viewerbar .sep { width: 1px; height: 18px; margin: 0 4px; background: rgba(255,255,255,.1); }
#gs-root.playing .gs-viewerbar { display: none; }
#gs-root .gs-playbanner { bottom: 64px; }
#gs-root .gs-toolpane h3 { flex-wrap: wrap; row-gap: 2px; }
#gs-root .gs-toolpane h3 .gs-dim { flex-basis: 100%; }

/* ===== Code-editor look (v5.32) ==========================================================
   The game workspace uses the same design system as the code Workspace Editor (style.css tokens,
   so it also follows the Light / Dark theme): page header with "← Code", title in the display font,
   green saved state, 30px tool buttons, green Run-style Play button, one rounded workspace card
   (Files-panel style Hierarchy · editor-style tabs · Output-style bottom panel) and the blue status bar. */
#gs-root.gs-root { --gs-focus: var(--accent); --gs-pad: 16px; background: var(--bg); color: var(--text); font: 13px/1.45 var(--font-ui); scrollbar-color: var(--surface-3) transparent; }
#gs-root.gs-root ::selection { background: var(--accent-soft); color: var(--text); }

/* header (like .editor-head) */
#gs-root .gs-top { min-height: 60px; padding: 10px var(--gs-pad); gap: 14px; background: var(--bg); border-bottom: 0; }
#gs-root .gs-tb { gap: 8px; }
#gs-root .gs-tb-left { gap: 12px; }
#gs-root .gs-top [data-a="back"] { height: 34px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--text-2); background: transparent; border: 1px solid var(--line-strong); border-radius: 9px; }
#gs-root .gs-top [data-a="back"]:hover { background: var(--surface-2); color: var(--text); }
#gs-root .gs-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); font-size: 15px; }
#gs-root .gs-title { max-width: 240px; font: 650 1.15rem/1.15 var(--font-display); letter-spacing: -0.02em; color: var(--text); }
#gs-root .gs-save { font-size: 12.5px; font-weight: 500; color: var(--ok); }
#gs-root .gs-save:empty { display: none; }
#gs-root .gs-save.is-dirty { color: var(--warn); }

/* buttons (like .ide-tools button / .editor-actions) */
#gs-root .gs-btn { height: 30px; padding: 0 12px; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; transition: background-color .15s, color .15s, border-color .15s; }
#gs-root .gs-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
#gs-root .gs-btn.on, #gs-root .gs-top .gs-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
#gs-root .gs-btn.danger { color: var(--bad); }
#gs-root .gs-top .gs-btn { height: 36px; padding: 0 14px; font-size: 13px; color: var(--text); border-color: var(--line-strong); border-radius: var(--r-sm); }
#gs-root .gs-top .gs-btn:hover { background: var(--surface-2); border-color: var(--text-3); }
#gs-root .gs-top .gs-tb-tools .gs-btn { width: 36px; padding: 0; justify-content: center; font-size: 15px; }
#gs-root .gs-group { gap: 0; padding: 3px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
#gs-root .gs-group > .gs-btn, #gs-root .gs-group > .gs-btn:first-child, #gs-root .gs-group > .gs-btn:last-child { margin: 0; border: 0; border-radius: 7px; background: transparent; }
#gs-root .gs-top .gs-group > .gs-btn { height: 28px; }
#gs-root .gs-group > .gs-btn:hover { background: var(--surface-2); }
#gs-root .gs-group > .gs-btn.on { background: var(--accent-soft); color: var(--accent); }
#gs-root .gs-playgroup { padding: 0; gap: 6px; background: none; border: 0; }
#gs-root .gs-playgroup > .gs-btn, #gs-root .gs-top .gs-playgroup > .gs-btn { width: auto; height: 36px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
#gs-root .gs-playgroup > [data-a="play"], #gs-root .gs-top .gs-playgroup > [data-a="play"] { background: var(--ok); color: #04170f; border-color: transparent; font-weight: 650; }
#gs-root .gs-playgroup > [data-a="play"]:hover { filter: brightness(1.1); background: var(--ok); }
#gs-root .gs-playgroup > [data-a="play"].on { background: var(--ok); color: #04170f; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
#gs-root .gs-playgroup > [data-a="stop"] { color: var(--bad); }
#gs-root.gs-root.playing .gs-top { box-shadow: none; }
#gs-root .gs-btn.gt-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
#gs-root .gs-mini { height: 24px; display: inline-flex; align-items: center; gap: 4px; padding: 0 9px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; font-size: 11.5px; }
#gs-root .gs-mini:hover { color: var(--text); background: var(--surface-3); }
#gs-root :where(button.primary) { background: var(--accent-grad); border: 0; color: #fff; border-radius: 8px; }

/* one workspace card (like .workspace): rail · hierarchy · scene · inspector, bottom panel, status bar */
#gs-root .gs-body { gap: 0; padding: 0; margin: 0 var(--gs-pad); background: var(--surface); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; }
#gs-root .gs-left, #gs-root .gs-right, #gs-root .gs-center { border: 0; border-radius: 0; }
#gs-root .gs-left, #gs-root .gs-right { background: var(--bg-raised); }
#gs-root .gs-center { background: var(--editor); }
#gs-root .gs-rail { flex: 0 0 72px; gap: 2px; padding: 10px 7px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--bg-raised); }
#gs-root .gs-rail button { gap: 4px; padding: 9px 2px 8px; border-radius: 10px; color: var(--text-2); font-size: 11px; font-weight: 500; position: relative; }
#gs-root .gs-rail button:hover { background: var(--surface-2); color: var(--text); }
#gs-root .gs-rail button.on { background: var(--accent-soft); color: var(--text); box-shadow: none; }
#gs-root .gs-rail button.on::before { content: ''; position: absolute; left: -7px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
#gs-root .gs-rail .gs-rail-sep { background: var(--line); }
#gs-root .gs-rail .gs-rail-ai { color: var(--text-3); }
#gs-root .gs-rail .gs-rail-ai b { color: var(--accent); }
#gs-root .gs-resizer { flex: 0 0 5px; width: 5px; margin: 0 -2px; position: relative; z-index: 2; background: linear-gradient(90deg, transparent 2px, var(--line) 2px, var(--line) 3px, transparent 3px); }
#gs-root .gs-resizer:hover, #gs-root .gs-resizer:active { background: linear-gradient(90deg, transparent 1px, var(--accent) 1px, var(--accent) 4px, transparent 4px); }
#gs-root .gs-resizer-h { flex: 0 0 5px; height: 5px; margin: -2px var(--gs-pad); position: relative; z-index: 2; border: solid var(--line-strong); border-width: 0 1px; background: linear-gradient(180deg, var(--surface) 2px, var(--line-strong) 2px, var(--line-strong) 3px, var(--bg-raised) 3px); }
#gs-root .gs-resizer-h:hover, #gs-root .gs-resizer-h:active { background: linear-gradient(180deg, var(--surface) 1px, var(--accent) 1px, var(--accent) 4px, var(--bg-raised) 4px); }
#gs-root .gs-bottom { margin: 0 var(--gs-pad); border: 1px solid var(--line-strong); border-top: 0; border-bottom: 0; border-radius: 0; background: var(--bg-raised); }

/* panel headers (like .code-toolbar / .panel-title) */
#gs-root .gs-ptabs { height: 38px; align-items: center; padding: 0 8px 0 0; background: var(--bg-raised); border-bottom: 1px solid var(--line); }
#gs-root .gs-ptab, #gs-root .gs-scenetabs .gs-ptab { top: 0; align-self: stretch; display: inline-flex; align-items: center; margin: 0; padding: 0 16px; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 12px; font-weight: 600; color: var(--text-3); }
#gs-root .gs-left .gs-ptab, #gs-root .gs-right .gs-ptab { padding: 0 14px; }
#gs-root .gs-scenetabs .gs-ptab.on { color: var(--text); font-size: 13px; font-weight: 500; background: var(--editor); border-right: 1px solid var(--line); border-bottom-color: var(--accent); }
#gs-root .gs-ptools .gs-btn, #gs-root .gs-ptools select.gs-select { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
#gs-root .gs-ptools select.gs-select { background-color: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
#gs-root .gs-layout { padding: 2px; }
#gs-root .gs-layout .gs-btn { width: 26px; height: 22px; }
#gs-root #gs-hier-tools .gs-btn { width: 26px; height: 26px; padding: 0; border: 0; background: transparent; font-size: 16px; color: var(--text-2); border-radius: 7px; }
#gs-root #gs-hier-tools .gs-btn:hover { background: var(--surface-2); color: var(--text); }

/* hierarchy (like the Files list) */
#gs-root .gs-hier-search { padding: 8px 8px 6px; border-bottom: 0; }
#gs-root .gs-hier-search input, #gs-root .gs-hier-search input[type="search"] { height: 30px; padding: 0 11px; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
#gs-root .gs-hier { padding: 2px 8px 8px; }
#gs-root .gs-hrow { min-height: 30px; gap: 8px; padding: 0 8px; margin-bottom: 1px; border-radius: 7px; border-left: 0; font-size: 13px; color: var(--text-2); transition: background-color .12s, color .12s; }
#gs-root .gs-hrow:hover { background: var(--surface-2); color: var(--text); }
#gs-root .gs-hrow.sel { background: var(--accent-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
#gs-root .gs-hrow.drop { background: var(--accent-soft); outline: 1px dashed var(--accent); }
#gs-root .gs-hicon { color: var(--text-3); }
#gs-root .gs-hrow.sel .gs-hicon { color: var(--accent); }
#gs-root .gs-eye { color: var(--text-3); opacity: .7; }
#gs-root .gs-hrow:hover .gs-eye { opacity: 1; }
#gs-root .gs-eye.off { color: var(--text-3); opacity: .45; }
#gs-root .gs-hrow.sel.prefab .gs-hname, #gs-root .gs-hrow.sel.prefab-part .gs-hname { color: var(--accent); }
#gs-root .gs-htag { background: var(--accent-soft); color: var(--accent); border-radius: 5px; font-weight: 600; }
#gs-root .gs-multi-note { background: var(--accent-soft); color: var(--text); border-bottom-color: var(--line); }

/* inspector */
#gs-root .gs-inspector { padding: 0 0 14px; }
#gs-root .gs-sec { padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
#gs-root .gs-sec-h { margin: 0 -12px 8px; padding: 8px 12px; background: transparent; border: 0; font: 600 12.5px/1.3 var(--font-ui); letter-spacing: 0; color: var(--text); }
#gs-root .gs-comp { margin: 0 -12px; padding: 0 12px 10px; border-top: 1px solid var(--line); }
#gs-root .gs-comp-h { margin: 0 -12px 8px; padding: 7px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
#gs-root .gs-comp-h b { color: var(--text); }
#gs-root .gs-field > label, #gs-root .gs-check, #gs-root .gs-vec i { color: var(--text-2); }
#gs-root .gs-tag { background: var(--surface-2); color: var(--text-2); border-radius: 5px; }

/* inputs: the editor's field style, compact */
#gs-root :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), select),
#gs-root .gs-field input[type="number"], #gs-root .gs-field input[type="text"], #gs-root .gs-field select, #gs-root #gs-name { height: 26px; padding: 1px 8px; color: var(--text); background-color: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12.5px; }
#gs-root :where(textarea), #gs-root .gs-field textarea, #gs-root .gs-toolpane textarea, #gs-root .gt-form textarea { color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 9px; }
#gs-root .gs-field input[type="color"] { height: 26px; background: var(--surface-2); border-color: var(--line-strong); border-radius: 7px; }
#gs-root input:hover:not(:focus), #gs-root select:hover:not(:focus) { border-color: var(--text-3); }
#gs-root input:focus, #gs-root select:focus, #gs-root textarea:focus, #gs-root .gs-field input:focus, #gs-root .gs-field select:focus, #gs-root .gs-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
#gs-root select:not([multiple]) { appearance: none; -webkit-appearance: none; padding-right: 24px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8' fill='none' stroke='%237480a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
#gs-root .gs-code, #gs-root .gs-comp .gs-code { background: var(--editor); color: var(--text); border: 1px solid var(--line-strong); border-radius: 9px; font-family: var(--font-mono); }

/* bottom panel (like the tab strip + Output panel) */
#gs-root .gs-tabs { height: 38px; padding: 0; align-items: stretch; gap: 0; background: var(--bg-raised); border-bottom: 1px solid var(--line); }
#gs-root .gs-tab { top: 0; margin: 0; padding: 0 16px; display: inline-flex; align-items: center; border: 0; border-right: 1px solid var(--line); border-bottom: 2px solid transparent; border-radius: 0; font-size: 13px; font-weight: 500; color: var(--text-3); background: transparent; }
#gs-root .gs-tab:hover { color: var(--text); background: var(--surface); }
#gs-root .gs-tab.on { color: var(--text); background: var(--editor); border-color: var(--line); border-top: 0; border-left: 0; border-bottom: 2px solid var(--accent); }
#gs-root .gs-tabpage { background: var(--bg-raised); }
#gs-root .gs-console { font: 12.5px/1.65 var(--font-mono); color: var(--text-2); }
#gs-root .gs-proj-tree { border-right-color: var(--line); padding: 6px; }
#gs-root .gs-proj-tree button { min-height: 30px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
#gs-root .gs-proj-tree button:hover { background: var(--surface-2); color: var(--text); }
#gs-root .gs-proj-tree button.on { background: var(--accent-soft); color: var(--text); }
#gs-root .gs-proj-tree button.on small { color: var(--accent); }
#gs-root .gs-proj-bar { border-bottom-color: var(--line); padding: 6px 10px; }
#gs-root .gs-ptile { border-radius: 9px; }
#gs-root .gs-ptile:hover { background: var(--surface-2); }
#gs-root .gs-ptile-ic { background: var(--surface-2); border-radius: 9px; }
#gs-root .gs-ptile.prefab .gs-ptile-ic { color: var(--accent); background: var(--accent-soft); }
#gs-root .gs-ptile b { color: var(--text); }

/* status bar (like .workspace-statusbar) */
#gs-root .gs-statusbar { flex: none; display: flex; align-items: center; gap: 18px; height: 26px; padding: 0 14px; margin: 0 var(--gs-pad) var(--gs-pad); background: var(--accent-strong); color: rgba(255,255,255,.92); font-size: 11.5px; font-weight: 500; border-radius: 0 0 var(--r-lg) var(--r-lg); white-space: nowrap; overflow: hidden; }
#gs-root .gs-statusbar > * { flex: none; }
#gs-root .gs-statusbar .gs-st-spacer { flex: 1; }
#gs-root .gs-statusbar .gs-st-sel { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-st-mode::before { content: '✎ Edit mode'; }
#gs-root.gs-root.playing .gs-st-mode::before { content: '▶ Playing'; }
#gs-root.gs-root.playing .gs-statusbar { background: #12a672; }
#gs-root .gs-st-online { color: #c9ffe6; }
#gs-root .gs-viewbar { display: none; }

/* scene view + overlays */
#gs-root .gs-viewport { background: radial-gradient(120% 90% at 50% 35%, var(--surface-2) 0%, var(--editor) 65%, var(--bg) 100%); }
#gs-root .gs-viewerbar { background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line-strong); box-shadow: var(--shadow-soft); border-radius: var(--r-md); }
#gs-root .gs-viewerbar button { color: var(--text-2); font-weight: 500; }
#gs-root .gs-viewerbar button:hover { background: var(--surface-2); color: var(--text); }
#gs-root .gs-viewerbar button.on { background: var(--accent-soft); color: var(--accent); }
#gs-root .gs-viewerbar .sep { background: var(--line-strong); }
#gs-root .gs-pane-head select.gs-pane-view { background-color: color-mix(in srgb, var(--surface) 80%, transparent); border-color: var(--line-strong); color: var(--text); }
#gs-root .gs-pane-head select.gs-pane-view:hover { background-color: var(--surface-2); }
#gs-root .gs-viewname { background: color-mix(in srgb, var(--surface) 75%, transparent); color: var(--text); }
#gs-root .gs-playbanner { background: color-mix(in srgb, var(--ok) 85%, #000); color: #fff; border-radius: 999px; }
#gs-root.playing .gs-left, #gs-root.playing .gs-right, #gs-root.playing .gs-bottom { box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--ok) 6%, transparent); }
#gs-root.playing .gs-viewport { outline-color: var(--ok); }

/* tool pane (Generate, Texture …) */
#gs-root .gs-toolpane { padding: 14px; color: var(--text-2); font-size: 13px; }
#gs-root .gs-toolpane h3 { font: 650 1.05rem/1.2 var(--font-display); letter-spacing: -0.02em; color: var(--text); }
#gs-root .gs-toolpane .gs-tp-sub { color: var(--text-3); }
#gs-root .gs-toolpane .gs-tp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
#gs-root .gs-toolpane .gs-tp-row > label { color: var(--text-2); }
#gs-root .gs-seg { background: var(--surface); border-color: var(--line-strong); border-radius: var(--r-sm); }
#gs-root .gs-seg button { color: var(--text-2); font-weight: 500; }
#gs-root .gs-seg button.on { background: var(--accent-soft); color: var(--accent); }
#gs-root .gs-cta { min-height: 40px; background: var(--accent-grad); border-radius: var(--r-md); font-size: 14px; font-weight: 600; box-shadow: 0 8px 20px -8px rgba(85,101,240,.7), inset 0 1px 0 rgba(255,255,255,.18); }
#gs-root .gs-cta.alt { background: transparent; color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; font-weight: 500; }
#gs-root .gs-cta.alt:hover { background: var(--surface-2); filter: none; }
#gs-root .gs-chips button { background: var(--surface-2); border-color: var(--line); color: var(--text-2); font-size: 12px; border-radius: 999px; }
#gs-root .gs-chips button:hover { border-color: var(--accent); color: var(--text); }
#gs-root .gs-engine { background: var(--surface-2); border-color: var(--line); color: var(--text-2); }
#gs-root .gs-drop { background: var(--surface); border-color: var(--line-strong); color: var(--text-3); border-radius: var(--r-md); }
#gs-root .gs-drop:hover, #gs-root .gs-drop.over { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
#gs-root .gs-gitem { background: var(--surface); border-color: var(--line); border-radius: var(--r-md); }
#gs-root .gs-gitem .th { background: radial-gradient(circle at 50% 40%, var(--surface-3), var(--surface)); }
#gs-root .gs-gitem .cap { color: var(--text-2); }

/* floating windows, menus, team panel */
#gs-root .gs-cinepanel, #gs-root .gs-floatpanel, #gs-root .gs-keys-box, #gs-root .gs-addmenu, #gs-root .gs-addmenu-grid { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-pop); color: var(--text-2); }
#gs-root .gs-cine-h, #gs-root .gs-floathead { background: var(--bg-raised); border-bottom: 1px solid var(--line); border-radius: var(--r-md) var(--r-md) 0 0; color: var(--text); }
#gs-root .gs-cine-h { font-family: var(--font-display); letter-spacing: -0.01em; }
#gs-root .gs-addmenu button, #gs-root .gs-addmenu-grid button { color: var(--text-2); border-radius: 7px; }
#gs-root .gs-addmenu button:hover, #gs-root .gs-addmenu-grid button:hover { background: var(--accent-soft); color: var(--text); }
#gs-root .gs-addh { color: var(--text-3); border-bottom-color: var(--line); text-transform: none; letter-spacing: 0; font-size: 12px; }
#gs-root .gs-hist.now { background: var(--accent-soft); color: var(--text); }
#gs-root .gs-keys { background: var(--backdrop); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#gs-root .gs-keys-grid kbd { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); font-family: var(--font-mono); }
#gs-root .gt-panel { background: var(--bg-raised); border-left: 1px solid var(--line); }
#gs-root .gt-tabs { height: 38px; align-items: stretch; background: var(--bg-raised); border-bottom: 1px solid var(--line); }
#gs-root .gt-tabs button, #gs-root .gt-tabs button[aria-selected="true"] { top: 0; margin: 0; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--text-3); font-weight: 500; font-size: 13px; }
#gs-root .gt-tabs button[aria-selected="true"] { color: var(--text); background: var(--editor); border-bottom-color: var(--accent); }
#gs-root .gt-h { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--text-3); }
#gs-root .gt-bubble { background: var(--surface-2); border-color: var(--line); border-radius: var(--r-md); color: var(--text); }
#gs-root .gt-msg.mine .gt-bubble { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
#gs-root .gt-bubble code, #gs-root .gt-code { background: var(--editor); font-family: var(--font-mono); }
#gs-root .gt-objlink { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
#gs-root .gt-objlink:hover { background: var(--accent-strong); color: #fff; }
#gs-root .gt-switch span { background: var(--surface-3); }
#gs-root .gt-avs .gt-av { box-shadow: 0 0 0 2px var(--bg); }
#gs-root .gt-av.online::after, #gs-root .gt-av.studio::after { box-shadow: 0 0 0 2px var(--bg-raised); }
#gs-root .gt-role { background: var(--surface-2); color: var(--text-2); }
#gs-root .gt-role.owner { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
#gs-root .gt-role.editor { background: var(--accent-soft); color: var(--accent); }
#gs-root .gs-ro-banner { margin: 0 var(--gs-pad) 10px; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: var(--r-sm); background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
#gs-root .gs-prefab-bar { background: var(--accent-soft); color: var(--text); border-bottom-color: var(--line); }
#gs-root .gs-prefab-bar.part { background: var(--surface-2); color: var(--text-2); }
#gs-root .gs-prefab-bar.missing { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }

@media (max-width: 1180px) { #gs-root .gs-top { padding: 8px 12px; row-gap: 8px; } #gs-root.gs-root { --gs-pad: 10px; } }
@media (max-width: 760px) { #gs-root.gs-root { --gs-pad: 0px; } #gs-root .gs-body, #gs-root .gs-statusbar { border-radius: 0; } }

/* header row: flows left → right like the editor's action bar (no centred overlay that can cover buttons) */
#gs-root .gs-top { display: flex; flex-wrap: nowrap; }
#gs-root .gs-tb-left { flex: none; }
#gs-root .gs-tb-center { flex: none; margin-left: auto; }
#gs-root .gs-tb-right { flex: 0 1 auto; min-width: 0; justify-self: auto; overflow-x: auto; }
@media (max-width: 1180px) { #gs-root .gs-top { flex-wrap: wrap; } #gs-root .gs-tb-right { margin-left: 0; } }

/* ================= v5.33 – Photo → 3D, command palette, collapsible panels, toasts ================= */
/* tool panes (Generate, Texture …) need more room than the Hierarchy */
#gs-root .gs-left:has(.gs-toolpane:not(.hidden)) { flex-basis: max(var(--gs-left-w, 230px), 300px); }
/* Photo → 3D (✨ Generate → Image) */
#gs-root .gs-photo-drop { min-height: 170px; line-height: 1.5; font-size: 13px; }
#gs-root .gs-photo-drop b { color: var(--text); }
#gs-root .gs-photo-drop small { display: block; margin-top: 6px; color: var(--text-3); font-size: 11.5px; }
#gs-root .gs-photo { border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--bg-raised); margin-bottom: 10px; }
#gs-root .gs-photo-stage { position: relative; line-height: 0; background: #000; }
#gs-root .gs-photo-stage img { width: 100%; max-height: 300px; object-fit: contain; display: block; }
#gs-root .gs-pbox { position: absolute; border: 2px solid var(--c, var(--accent)); border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.45); cursor: pointer; transition: background .12s, opacity .12s; }
#gs-root .gs-pbox span { position: absolute; left: -2px; top: -2px; transform: translateY(-100%); padding: 1px 5px; border-radius: 3px 3px 3px 0; background: var(--c, var(--accent)); color: #fff; font: 600 10px/1.5 Inter, sans-serif; white-space: nowrap; text-shadow: 0 0 2px rgba(0,0,0,.8); max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-pbox.hot { background: color-mix(in srgb, var(--c, var(--accent)) 28%, transparent); border-width: 3px; z-index: 2; }
#gs-root .gs-pbox.off { opacity: .35; border-style: dashed; }
#gs-root .gs-photo-scan { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--accent) 45%, transparent) 50%, transparent 100%); background-size: 100% 40%; background-repeat: no-repeat; animation: gs-scan 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes gs-scan { 0% { background-position: 0 -40%; } 100% { background-position: 0 140%; } }
#gs-root .gs-photo-bar { display: flex; align-items: center; gap: 6px; padding: 7px 8px; font-size: 11.5px; color: var(--text-2); }
#gs-root .gs-photo-bar span { flex: 1; min-width: 0; }
#gs-root .gs-photo-bar span.err { color: var(--danger, #ff6b6b); }
#gs-root .gs-pitems { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; max-height: 300px; overflow-y: auto; }
#gs-root .gs-pitem { display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); transition: border-color .12s, opacity .12s; }
#gs-root .gs-pitem.hot { border-color: var(--accent); }
#gs-root .gs-pitem.off { opacity: .5; }
#gs-root .gs-pitem input[type="color"] { width: 26px; height: 26px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: none; cursor: pointer; flex: none; }
#gs-root .gs-pitem-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#gs-root .gs-pitem-main b { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
#gs-root .gs-pitem-main b small { color: var(--text-3); font-weight: 400; text-transform: none; }
#gs-root .gs-pitem-main select { width: 100%; font-size: 11.5px; padding: 2px 4px; min-height: 0; height: 24px; }
/* drop a photo on the Scene view */
#gs-root .gs-viewport.gs-dropping::after { content: '\1F4F7  Drop the photo \2013  its items become 3D models'; position: absolute; inset: 10px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text); font-size: 15px; font-weight: 600; z-index: 20; pointer-events: none; }

/* command palette (Ctrl+K) */
#gs-root .gs-palbtn kbd { margin-left: 4px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--line-strong); font: 500 10px/1.5 "Fira Code", monospace; color: var(--text-3); }
#gs-root .gs-palette { position: absolute; inset: 0; z-index: 400; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; background: rgba(5,7,14,.45); backdrop-filter: blur(2px); }
#gs-root .gs-palette-box { width: min(620px, 92vw); border-radius: 14px; background: var(--bg-raised); border: 1px solid var(--line-strong); box-shadow: 0 24px 60px rgba(0,0,0,.5); overflow: hidden; display: flex; flex-direction: column; }
#gs-root .gs-palette-box input { margin: 0; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; padding: 14px 16px; font-size: 15px; background: transparent; color: var(--text); box-shadow: none; }
#gs-root .gs-palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
#gs-root .gs-palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
#gs-root .gs-palette-item b { font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-palette-item small { margin-left: auto; color: var(--text-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
#gs-root .gs-palette-item .g { flex: 0 0 56px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
#gs-root .gs-palette-item.on, #gs-root .gs-palette-item:hover { background: var(--accent-soft); }
#gs-root .gs-palette-item.on { box-shadow: inset 2px 0 0 var(--accent); }
#gs-root .gs-palette-empty { padding: 18px; text-align: center; color: var(--text-3); }
#gs-root .gs-palette-foot { padding: 7px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-3); }

/* collapsible panels + focus mode */
#gs-root.gs-hide-left .gs-left, #gs-root.gs-hide-left .gs-resizer[data-resize="left"],
#gs-root.gs-hide-right .gs-right, #gs-root.gs-hide-right .gs-resizer[data-resize="right"],
#gs-root.gs-hide-bottom .gs-bottom, #gs-root.gs-hide-bottom .gs-resizer-h,
#gs-root.gs-focus .gs-left, #gs-root.gs-focus .gs-right, #gs-root.gs-focus .gs-rail, #gs-root.gs-focus .gs-bottom, #gs-root.gs-focus .gs-resizer, #gs-root.gs-focus .gs-resizer-h { display: none !important; }
#gs-root .gs-restore { display: none; position: absolute; z-index: 30; width: 18px; height: 46px; padding: 0; border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--text-2); font-size: 14px; cursor: pointer; opacity: .75; }
#gs-root .gs-restore:hover { opacity: 1; color: var(--text); border-color: var(--accent); }
#gs-root .gs-restore-left { left: 0; top: 50%; border-radius: 0 8px 8px 0; border-left: 0; }
#gs-root .gs-restore-right { right: 0; top: 50%; border-radius: 8px 0 0 8px; border-right: 0; }
#gs-root .gs-restore-bottom { left: 50%; bottom: 26px; width: 46px; height: 18px; border-radius: 8px 8px 0 0; border-bottom: 0; }
#gs-root.gs-hide-left .gs-restore-left, #gs-root.gs-hide-right .gs-restore-right, #gs-root.gs-hide-bottom .gs-restore-bottom,
#gs-root.gs-focus .gs-restore-left, #gs-root.gs-focus .gs-restore-right, #gs-root.gs-focus .gs-restore-bottom { display: block; }
#gs-root .gs-resizer:hover, #gs-root .gs-resizer-h:hover { background: color-mix(in srgb, var(--accent) 45%, transparent); }

/* toasts (messages while the Console is hidden) */
#gs-root .gs-toasts { position: absolute; right: 18px; bottom: 40px; z-index: 350; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
#gs-root .gs-toast { pointer-events: auto; max-width: 380px; padding: 9px 13px; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); color: var(--text); font-size: 12.5px; line-height: 1.45; box-shadow: 0 10px 30px rgba(0,0,0,.35); cursor: pointer; animation: gs-toast-in .2s ease-out; transition: opacity .3s, transform .3s; }
#gs-root .gs-toast.warn { border-left-color: #f0a030; }
#gs-root .gs-toast.error { border-left-color: #ff5c5c; }
#gs-root .gs-toast.out { opacity: 0; transform: translateX(16px); }
@keyframes gs-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #gs-root .gs-photo-scan, #gs-root .gs-toast { animation: none; } }

/* ================= v5.34 – modelling: point editor, ✏ Model tool, model code editor ================= */
#gs-root .gs-ptwrap { margin: 6px 0 10px; }
#gs-root .gs-ptlabel { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; font-size: 12px; }
#gs-root .gs-ptviews { margin: 0 0 6px; }
#gs-root .gs-pted { width: 100%; max-width: 280px; aspect-ratio: 1; margin: 0 auto; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg); overflow: hidden; touch-action: none; }
#gs-root .gs-pted-svg { width: 100%; height: 100%; display: block; user-select: none; }
#gs-root .gs-pted-svg .gl { stroke: var(--line); stroke-width: .5; }
#gs-root .gs-pted-svg .gl.mid { stroke: var(--line-strong); stroke-width: 1; }
#gs-root .gs-pted-svg .axis { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
#gs-root .gs-pted-svg .ghost { fill: none; stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 4 3; opacity: .55; }
#gs-root .gs-pted-svg .ln { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
#gs-root .gs-pted-svg polyline.ln { fill: none; }
#gs-root .gs-pted-svg .pt { fill: var(--bg-raised); stroke: var(--accent); stroke-width: 2; cursor: grab; }
#gs-root .gs-pted-svg .pt.first { fill: var(--accent); }
#gs-root .gs-pted-svg .pt:hover, #gs-root .gs-pted-svg .pt.on { fill: #fff; stroke-width: 3; cursor: grabbing; }
#gs-root .gs-pthint { margin-top: 4px; font-size: 10.5px; color: var(--text-3); text-align: center; }

#gs-root .gs-md-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 8px 0; }
#gs-root .gs-md-grid button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--text-2); font-size: 11px; cursor: pointer; }
#gs-root .gs-md-grid button span { font-size: 17px; line-height: 1.1; }
#gs-root .gs-md-grid button:hover { border-color: var(--accent); color: var(--text); }
#gs-root .gs-md-row { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
#gs-root .gs-md-row > span { flex: 0 0 82px; font-size: 11.5px; color: var(--text-2); }
#gs-root .gs-md-row .gs-mini { min-width: 32px; }
#gs-root .gs-md-row .gs-mini:disabled { opacity: .4; cursor: default; }
#gs-root .gs-md-file { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 0; font-size: 12px; }
#gs-root .gs-toolpane code { font: 11px "Fira Code", monospace; color: var(--accent); }

/* model code editor */
#gs-root .gs-codepanel { position: absolute; left: 10px; top: 42px; bottom: 44px; z-index: 70; width: min(48%, 620px); min-width: 320px; max-width: calc(100% - 20px); resize: horizontal; overflow: hidden;
  display: flex; flex-direction: column; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
#gs-root .gs-codepanel.hidden { display: none; }
#gs-root .gs-code-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#gs-root .gs-code-head b { font-size: 13px; color: var(--text); white-space: nowrap; }
#gs-root .gs-code-head input#gs-code-name { width: 130px; min-height: 0; height: 28px; padding: 2px 8px; font-size: 12px; }
#gs-root .gs-code-head select { min-height: 0; height: 28px; font-size: 12px; padding: 2px 6px; }
#gs-root .gs-code-head .gs-btn { height: 28px; min-height: 0; padding: 0 10px; }
#gs-root .gs-code-sp { flex: 1; }
#gs-root .gs-code-body { flex: 1; min-height: 0; display: flex; background: var(--bg); }
#gs-root .gs-code-gutter { margin: 0; padding: 10px 6px 10px 8px; min-width: 34px; text-align: right; overflow: hidden; color: var(--text-3); font: 12px/1.55 "Fira Code", monospace; border-right: 1px solid var(--line); user-select: none; white-space: pre; }
#gs-root .gs-code-body textarea { flex: 1; min-width: 0; margin: 0; padding: 10px 12px; border: 0; border-radius: 0; resize: none; background: transparent; color: var(--text); font: 12px/1.55 "Fira Code", monospace; tab-size: 2; white-space: pre; overflow: auto; box-shadow: none; outline: none; }
#gs-root .gs-code-status { padding: 6px 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-code-status.ok { color: #45c98a; }
#gs-root .gs-code-status.err { color: #ff6b6b; white-space: normal; }
#gs-root .gs-code-help { border-top: 1px solid var(--line); font-size: 11.5px; max-height: 40%; overflow: auto; }
#gs-root .gs-code-help summary { padding: 6px 10px; cursor: pointer; color: var(--text-2); }
#gs-root .gs-code-help table { border-collapse: collapse; margin: 0 10px 10px; }
#gs-root .gs-code-help td { padding: 3px 6px; vertical-align: top; border-top: 1px solid var(--line); color: var(--text-2); }
#gs-root .gs-code-help td code { font: 11px "Fira Code", monospace; color: var(--accent); white-space: nowrap; }

/* ================= v5.35 – 🦴 Rig + 🎞 Animation timeline ================= */
#gs-root .gs-rig-opts { display: flex; gap: 14px; margin-bottom: 6px; }
#gs-root .gs-rig-tree { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); padding: 3px 0; }
#gs-root .gs-rig-bone { display: flex; align-items: center; gap: 5px; padding: 3px 8px; font-size: 12px; cursor: pointer; color: var(--text-2); }
#gs-root .gs-rig-bone span { color: var(--text-3); font-size: 11px; }
#gs-root .gs-rig-bone small { margin-left: auto; color: var(--text-3); font-size: 10px; }
#gs-root .gs-rig-bone:hover { background: var(--surface-2); color: var(--text); }
#gs-root .gs-rig-bone.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 2px 0 0 #ffb020; }
#gs-root .gs-rig-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0 10px; }
#gs-root .gs-rig-presets button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--text-2); font-size: 10.5px; cursor: pointer; }
#gs-root .gs-rig-presets button span { font-size: 16px; }
#gs-root .gs-rig-presets button:hover { border-color: var(--accent); color: var(--text); }
#gs-root .gs-rig-presets button.has { border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--text); }
#gs-root .gs-rec-note { margin: 6px 0; padding: 4px 8px; border-radius: 6px; background: rgba(255, 70, 70, .14); color: #ff8080; font-size: 11.5px; }

#gs-root .gs-anim { display: flex; flex-direction: column; height: 100%; min-height: 0; }
#gs-root .gs-tl-bar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 5px 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
#gs-root .gs-tl-bar select { height: 26px; min-height: 0; padding: 1px 6px; font-size: 12px; max-width: 150px; }
#gs-root .gs-tl-bar .gs-mini.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
#gs-root .gs-tl-obj { color: var(--text); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-tl-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 3px; }
#gs-root .gs-tl-time { font: 12px "Fira Code", monospace; color: var(--text); min-width: 96px; text-align: center; }
#gs-root .gs-tl-lab { display: flex; align-items: center; gap: 4px; color: var(--text-2); }
#gs-root .gs-tl-lab input { width: 58px; height: 24px; min-height: 0; padding: 1px 4px; font-size: 12px; }
#gs-root .gs-tl-playbtn { min-width: 30px; }
#gs-root .gs-tl-rec.on { background: #c62f2f; border-color: #c62f2f; color: #fff; animation: gs-rec 1.2s ease-in-out infinite; }
@keyframes gs-rec { 50% { opacity: .7; } }
#gs-root .gs-tl-rows { position: relative; flex: 1; min-height: 0; overflow: auto; --nm: 150px; }
#gs-root .gs-tl-row { display: grid; grid-template-columns: var(--nm) 1fr; height: 22px; border-bottom: 1px solid var(--line); }
#gs-root .gs-tl-row .nm { padding: 0 6px; font-size: 11.5px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); cursor: pointer; border-right: 1px solid var(--line); background: var(--bg-raised); position: sticky; left: 0; z-index: 2; }
#gs-root .gs-tl-row.empty .nm { color: var(--text-3); }
#gs-root .gs-tl-row.on .nm { color: var(--text); background: var(--accent-soft); box-shadow: inset 2px 0 0 #ffb020; }
#gs-root .gs-tl-row .ln { position: relative; margin: 0 10px; cursor: crosshair; }
#gs-root .gs-tl-row.sum { background: color-mix(in srgb, var(--accent) 6%, transparent); }
#gs-root .gs-tl-row.sum .nm { font-weight: 600; color: var(--text); }
#gs-root .gs-tl-row.ruler { position: sticky; top: 0; z-index: 3; height: 24px; background: var(--bg-raised); }
#gs-root .gs-tl-row.ruler .ln { cursor: ew-resize; }
#gs-root .gs-tl-row.ruler .tk { position: absolute; bottom: 0; width: 1px; height: 5px; background: var(--line-strong); }
#gs-root .gs-tl-row.ruler .tk.big { height: 9px; background: var(--text-3); }
#gs-root .gs-tl-row.ruler .tk i { position: absolute; bottom: 9px; left: 3px; font: normal 9.5px "Fira Code", monospace; color: var(--text-3); }
#gs-root .gs-tl-row.ruler .tk:not(.big) i { display: none; }
#gs-root .kf { position: absolute; top: 50%; width: 9px; height: 9px; margin: -5px 0 0 -5px; transform: rotate(45deg); background: #cfd6e6; border: 1px solid #5a6170; cursor: grab; z-index: 1; }
#gs-root .gs-tl-row.sum .kf { background: var(--accent); border-color: #fff3; }
#gs-root .kf:hover { background: #fff; }
#gs-root .kf.on { background: #ffb020; border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 176, 32, .35); }
#gs-root .gs-tl-row.evr .nm { color: var(--text); cursor: default; }
#gs-root .gs-tl-ev { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: #4fc3a1; cursor: grab; z-index: 1; }
#gs-root .gs-tl-ev::before { content: ''; position: absolute; top: -1px; left: -3px; border: 4px solid transparent; border-top-color: inherit; border-top: 5px solid #4fc3a1; }
#gs-root .gs-tl-ev i { position: absolute; left: 5px; top: -1px; font: normal 10px/16px var(--font-ui); color: #4fc3a1; white-space: nowrap; pointer-events: none; }
#gs-root .gs-tl-ev:hover, #gs-root .gs-tl-ev.on { background: #ffb020; }
#gs-root .gs-tl-ev.on::before { border-top-color: #ffb020; }
#gs-root .gs-tl-ev.on i { color: #ffb020; }
#gs-root .gs-tl-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ff4d4d; pointer-events: none; z-index: 4;
  left: calc(var(--nm) + 10px + (100% - var(--nm) - 20px) * var(--p, 0)); min-height: 100%; }

/* ================= v5.36 – 📊 render statistics overlay ================= */
#gs-root .gs-stats { position: absolute; top: 36px; right: 10px; z-index: 15; width: 220px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--bg-raised) 88%, transparent);
  border: 1px solid var(--line-strong); box-shadow: 0 8px 24px rgba(0,0,0,.35); font: 11.5px/1.5 var(--font-ui); color: var(--text-2); pointer-events: none; backdrop-filter: blur(4px); }
#gs-root .gs-stats .row { display: flex; justify-content: space-between; gap: 8px; }
#gs-root .gs-stats .row b { color: var(--text); font: 600 11.5px "Fira Code", monospace; }
#gs-root .gs-stats .row i { color: var(--text-3); font-style: normal; font-size: 10px; }
#gs-root .gs-stats .row.big { align-items: baseline; justify-content: flex-start; gap: 5px; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
#gs-root .gs-stats .row.big b { font-size: 18px; }
#gs-root .gs-stats .row.big span { margin-left: auto; color: var(--text-3); font-size: 10.5px; }
#gs-root .gs-stats b.ok { color: #45c98a; } #gs-root .gs-stats b.mid { color: #f0a030; } #gs-root .gs-stats b.bad { color: #ff6b6b; }
#gs-root .gs-stats .row.passes, #gs-root .gs-stats .row.gpu { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); font-size: 10px; color: var(--text-3); word-break: break-word; }
#gs-root .gs-stats .row.gpu { border-top: 0; margin-top: 0; padding-top: 0; }

/* ================= v5.40 – 🧩 material graph (node editor) ================= */
#gs-root .gs-tgpanel { position: absolute; left: 10px; top: 42px; bottom: 44px; z-index: 70; width: min(64%, 900px); min-width: 380px; max-width: calc(100% - 20px); resize: horizontal; overflow: hidden;
  display: flex; flex-direction: column; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
#gs-root .gs-tgpanel.hidden { display: none; }
#gs-root .gs-tg-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--line); }
#gs-root .gs-tg-head b { color: var(--text); font-size: 13px; white-space: nowrap; }
#gs-root .gs-tg-head input#tg-name { width: 130px; height: 28px; min-height: 0; padding: 2px 8px; font-size: 12px; }
#gs-root .gs-tg-head select { height: 28px; min-height: 0; padding: 2px 6px; font-size: 12px; }
#gs-root .gs-tg-head .gs-btn { height: 28px; min-height: 0; padding: 0 10px; }
#gs-root .gs-tg-canvas { position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: grab;
  background-color: var(--bg); background-image: radial-gradient(color-mix(in srgb, var(--text-3) 35%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
#gs-root .gs-tg-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#gs-root .gs-tg-wires path { fill: none; stroke: var(--accent); stroke-width: 2.2; opacity: .85; }
#gs-root .gs-tg-wires path.temp { stroke-dasharray: 5 4; opacity: 1; }
#gs-root .gs-tg-nodes { position: absolute; inset: 0; }
#gs-root .gs-tg-node { position: absolute; width: 176px; border-radius: 9px; background: var(--bg-raised); border: 1px solid var(--line-strong); box-shadow: 0 6px 18px rgba(0,0,0,.35); font-size: 11px; color: var(--text-2); cursor: default; }
#gs-root .gs-tg-node.out { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
#gs-root .gs-tg-nh { position: relative; display: flex; align-items: center; gap: 6px; padding: 5px 22px 5px 8px; border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 9px 9px 0 0; cursor: move; }
#gs-root .gs-tg-node.out .gs-tg-nh { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
#gs-root .gs-tg-nh b { color: var(--text); font-size: 11.5px; }
#gs-root .gs-tg-del { margin-left: auto; border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
#gs-root .gs-tg-del:hover { color: #ff6b6b; }
#gs-root .gs-tg-prev { display: block; width: 48px; height: 48px; margin: 6px auto 2px; border-radius: 5px; border: 1px solid var(--line); image-rendering: auto; }
#gs-root .gs-tg-in, #gs-root .gs-tg-prm { position: relative; display: flex; align-items: center; gap: 5px; padding: 2px 8px; min-height: 22px; }
#gs-root .gs-tg-in span, #gs-root .gs-tg-prm span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gs-root .gs-tg-in input, #gs-root .gs-tg-prm input, #gs-root .gs-tg-prm select { width: 62px; height: 20px; min-height: 0; padding: 0 3px; font-size: 10.5px; }
#gs-root .gs-tg-in input[type="color"], #gs-root .gs-tg-prm input[type="color"] { width: 34px; padding: 0; }
#gs-root .gs-tg-node .port { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); cursor: crosshair; box-sizing: border-box; }
#gs-root .gs-tg-node .port.in { left: -6px; top: 50%; margin-top: -5.5px; }
#gs-root .gs-tg-node .port.out { right: -6px; top: 50%; margin-top: -5.5px; }
#gs-root .gs-tg-node .port.on, #gs-root .gs-tg-node .port:hover { background: var(--accent); }
#gs-root .gs-tg-node .port.in.on { cursor: pointer; }
#gs-root .gs-tg-foot { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 11px; min-height: 30px; }
#gs-root .gs-tg-foot #tg-status { flex: 1; min-width: 0; }
#gs-root .gs-tg-outs { display: flex; gap: 6px; }
#gs-root .gs-tg-out { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 9.5px; color: var(--text-3); }
#gs-root .gs-tg-out canvas { width: 36px; height: 36px; border-radius: 4px; border: 1px solid var(--line); }

/* ================= v5.50 – 🧩 visual scripting (same panel as the material graph) ================= */
#gs-root .gs-vspanel input#vs-name { width: 130px; height: 28px; min-height: 0; padding: 2px 8px; font-size: 12px; }
#gs-root .gs-vspanel .gs-tg-head .gs-btn.on { border-color: var(--accent); color: var(--text); }
#gs-root .gs-vs-node { width: 196px; }
#gs-root .gs-vs-node .gs-tg-nh { padding-left: 6px; }
#gs-root .gs-vs-node.c-events .gs-tg-nh { background: color-mix(in srgb, #e5484d 26%, var(--surface)); }
#gs-root .gs-vs-node.c-flow .gs-tg-nh { background: color-mix(in srgb, var(--text-3) 22%, var(--surface)); }
#gs-root .gs-vs-node.c-variables .gs-tg-nh { background: color-mix(in srgb, #30a46c 24%, var(--surface)); }
#gs-root .gs-vs-node.c-functions .gs-tg-nh, #gs-root .gs-vs-node.c-custom .gs-tg-nh { background: color-mix(in srgb, #8e4ec6 26%, var(--surface)); }
#gs-root .gs-vs-node.c-object .gs-tg-nh, #gs-root .gs-vs-node.c-physics .gs-tg-nh, #gs-root .gs-vs-node.c-animation .gs-tg-nh, #gs-root .gs-vs-node.c-ai .gs-tg-nh { background: color-mix(in srgb, #0090ff 22%, var(--surface)); }
#gs-root .gs-vs-node.c-game .gs-tg-nh { background: color-mix(in srgb, #f76b15 22%, var(--surface)); }
#gs-root .gs-vs-out { justify-content: flex-end; text-align: right; }
#gs-root .gs-vs-out span { flex: 0 1 auto; }
#gs-root .gs-vs-val { flex: 1; min-width: 0; font-style: normal; font-size: 10px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
#gs-root .gs-vs-node .gs-tg-in input[type="text"] { width: 74px; }
#gs-root .gs-vs-node .gs-tg-in input[type="checkbox"], #gs-root .gs-vs-node .gs-tg-prm input[type="checkbox"] { width: auto; height: auto; }
#gs-root .gs-vs-node .gs-tg-prm input[type="text"] { width: 92px; }
#gs-root .gs-vs-node .gs-tg-prm select { width: 92px; }
#gs-root .gs-vs-node .port.t-exec { border-radius: 2px; transform: rotate(45deg) scale(.9); border-color: var(--text); }
#gs-root .gs-vs-node .port.t-exec.on, #gs-root .gs-vs-node .port.t-exec:hover { background: var(--text); }
#gs-root .gs-vs-node .port.t-num { border-color: #30a46c; } #gs-root .gs-vs-node .port.t-num.on { background: #30a46c; }
#gs-root .gs-vs-node .port.t-bool { border-color: #e5484d; } #gs-root .gs-vs-node .port.t-bool.on { background: #e5484d; }
#gs-root .gs-vs-node .port.t-str { border-color: #d6409f; } #gs-root .gs-vs-node .port.t-str.on { background: #d6409f; }
#gs-root .gs-vs-node .port.t-vec { border-color: #ffc53d; } #gs-root .gs-vs-node .port.t-vec.on { background: #ffc53d; }
#gs-root .gs-vs-node .port.t-obj { border-color: #0090ff; } #gs-root .gs-vs-node .port.t-obj.on { background: #0090ff; }
#gs-root .gs-vs-node .port.t-list { border-color: #12a594; } #gs-root .gs-vs-node .port.t-list.on { background: #12a594; }
#gs-root .gs-vs-node .port.t-any { border-color: var(--text-3); } #gs-root .gs-vs-node .port.t-any.on { background: var(--text-3); }
#gs-root .gs-vs-wires path.t-exec { stroke: var(--text); stroke-width: 2.6; opacity: .7; }
#gs-root .gs-vs-wires path.t-num { stroke: #30a46c; } #gs-root .gs-vs-wires path.t-bool { stroke: #e5484d; } #gs-root .gs-vs-wires path.t-str { stroke: #d6409f; }
#gs-root .gs-vs-wires path.t-vec { stroke: #ffc53d; } #gs-root .gs-vs-wires path.t-obj { stroke: #0090ff; } #gs-root .gs-vs-wires path.t-list { stroke: #12a594; } #gs-root .gs-vs-wires path.t-any { stroke: var(--text-3); }
#gs-root .gs-vs-bp { border: 0; background: none; padding: 0 2px; font-size: 11px; line-height: 1; cursor: pointer; color: color-mix(in srgb, var(--text-3) 45%, transparent); }
#gs-root .gs-vs-bp:hover { color: #e5484d; }
#gs-root .gs-vs-node.bp .gs-vs-bp { color: #e5484d; }
#gs-root .gs-vs-node.hot { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent), 0 6px 18px rgba(0,0,0,.35); }
#gs-root .gs-vs-node.err { border-color: #e5484d; box-shadow: 0 0 0 2px rgba(229,72,77,.45), 0 6px 18px rgba(0,0,0,.35); }
#gs-root .gs-vs-node.paused { border-color: #ffc53d; box-shadow: 0 0 0 3px rgba(255,197,61,.55), 0 6px 18px rgba(0,0,0,.35); }
#gs-root .gs-vs-side { max-height: 38%; overflow: auto; padding: 8px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; }
#gs-root .gs-vs-row { display: flex; align-items: center; gap: 6px; }
#gs-root .gs-vs-row input, #gs-root .gs-vs-row select { height: 26px; min-height: 0; padding: 2px 6px; font-size: 12px; flex: 1; min-width: 0; }
#gs-root .gs-vs-row input[type="checkbox"] { flex: 0 0 auto; height: auto; }
#gs-root .gs-vs-cust { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
#gs-root .gs-vs-cust textarea { min-height: 64px; font-size: 11.5px; }
#gs-root .gs-vs-side > .gs-btn { align-self: flex-start; height: 26px; min-height: 0; padding: 0 10px; }
#gs-root .gs-vs-dbg { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
#gs-root .gs-vs-dbg .gs-btn { height: 24px; min-height: 0; padding: 0 9px; }
#gs-root .gs-vs-live { color: var(--accent); font-weight: 600; }
#gs-root .gs-vs-pause { color: #ffc53d; }
#gs-root .gs-vs-vars { color: var(--text-2); font-family: var(--mono, monospace); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
#gs-root .gs-vs-err { color: #ff6b6b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
#gs-root .gs-vs-sum { margin: -2px 0 6px; font-size: 11px; }

/* ================= v5.41 – 🖌 vertex paint: colour swatch in tool panels (same look as the Inspector) ================= */
#gs-root .gs-toolpane .gs-tp-row > input[type="color"] { height: 26px; padding: 1px; cursor: pointer; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 7px; }

/* ================= v5.51 – 🌳 behaviour tree editor, 💬 dialogue list, 🧭 navmesh preview ================= */
#gs-root .gs-btpanel .gs-tg-head input#bt-name { width: 150px; height: 28px; min-height: 0; padding: 2px 8px; font-size: 12px; }
#gs-root .gs-btpanel .gs-tg-head .gs-btn.on { border-color: var(--accent); color: var(--text); }
#gs-root .gs-bt-rows { flex: 1; min-height: 0; overflow: auto; padding: 8px 10px 14px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
#gs-root .gs-bt-row { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-left: calc(var(--d) * 22px); padding: 4px 6px 4px 8px; font-size: 11px; color: var(--text-2);
  background: var(--bg-raised); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 7px; }
#gs-root .gs-bt-row::before { content: ''; position: absolute; left: -14px; top: 50%; width: 11px; border-top: 1px solid var(--line-strong); }
#gs-root .gs-bt-row[style*="--d:0"]::before { display: none; }
#gs-root .gs-bt-row.c-composite { border-left-color: var(--accent); }
#gs-root .gs-bt-row.c-decorator { border-left-color: #8e4ec6; }
#gs-root .gs-bt-row.c-condition { border-left-color: #ffc53d; }
#gs-root .gs-bt-row.c-action { border-left-color: #30a46c; }
#gs-root .gs-bt-ic { width: 16px; text-align: center; color: var(--text); }
#gs-root .gs-bt-row select, #gs-root .gs-bt-row input { height: 22px; min-height: 0; padding: 0 4px; font-size: 11px; }
#gs-root .gs-bt-row > select[data-btt] { width: 140px; }
#gs-root .gs-bt-row > input[data-btl] { width: 96px; }
#gs-root .gs-bt-prm { display: inline-flex; align-items: center; gap: 3px; }
#gs-root .gs-bt-prm span { color: var(--text-3); white-space: nowrap; }
#gs-root .gs-bt-prm input[type="number"] { width: 54px; }
#gs-root .gs-bt-prm input[type="text"] { width: 96px; }
#gs-root .gs-bt-prm input[type="checkbox"] { width: auto; height: auto; }
#gs-root .gs-bt-acts { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; }
#gs-root .gs-bt-acts select { width: 92px; }
#gs-root .gs-bt-scores { flex: 1 0 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-top: 3px; border-top: 1px dashed var(--line); }
#gs-root .gs-bt-score { display: inline-flex; align-items: center; gap: 3px; }
#gs-root .gs-bt-score input[type="text"] { width: 74px; } #gs-root .gs-bt-score input[type="number"] { width: 46px; }
#gs-root .gs-bt-st, #gs-root .gs-bt-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
#gs-root .gs-bt-row.s-R .gs-bt-st, #gs-root .gs-bt-legend i.s-R { background: #ffc53d; box-shadow: 0 0 6px #ffc53d; }
#gs-root .gs-bt-row.s-S .gs-bt-st, #gs-root .gs-bt-legend i.s-S { background: #30a46c; }
#gs-root .gs-bt-row.s-F .gs-bt-st, #gs-root .gs-bt-legend i.s-F { background: #e5484d; }
#gs-root .gs-bt-row.s-R { border-color: color-mix(in srgb, #ffc53d 55%, var(--line)); }
#gs-root .gs-bt-legend { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); white-space: nowrap; }
#gs-root .gs-bt-legend i { margin-left: 4px; }
#gs-root .gs-dlg { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
#gs-root .gs-dlg textarea { width: 100%; box-sizing: border-box; min-height: 0; padding: 3px 5px; font-size: 11.5px; resize: vertical; }
#gs-root .gs-dlg > .gs-mini { align-self: flex-start; }
#gs-root .gs-btn.on[data-navprev] { border-color: var(--accent); color: var(--text); }
#gs-root .gs-nav-sum, #gs-root .gs-bt-sum { font-size: 11px; margin: -2px 0 4px; }

/* v5.52 – 🤖 AI development assistant panel */
#gs-root .gs-aspanel { width: min(58%, 760px); }
#gs-root .gs-as-perm { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
#gs-root .gs-as-perm.warn { color: #f0b14a; }
#gs-root .gs-aspanel .gs-tg-head .gs-btn.on { border-color: var(--accent); color: var(--text); }
#gs-root .gs-as-body { flex: 1; min-height: 0; display: flex; }
#gs-root .gs-as-chat { flex: 1; min-width: 0; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; line-height: 1.45; }
#gs-root .gs-as-side { width: 290px; flex: none; border-left: 1px solid var(--line); overflow: auto; padding: 8px 10px; font-size: 12px; color: var(--text-2); }
#gs-root .gs-as-side.hidden { display: none; }
#gs-root .gs-as-side h4, #gs-root .gs-as-msg h4 { margin: 6px 0 4px; font-size: 12.5px; color: var(--text); }
#gs-root .gs-as-hint { margin: 2px 0 8px; color: var(--text-3); font-size: 11.5px; }
#gs-root .gs-as-msg { max-width: 92%; padding: 7px 10px; border-radius: 10px; background: var(--surface); color: var(--text-2); border: 1px solid var(--line); overflow-wrap: anywhere; }
#gs-root .gs-as-msg.user { align-self: flex-end; background: color-mix(in srgb, var(--accent) 20%, var(--surface)); color: var(--text); white-space: pre-wrap; }
#gs-root .gs-as-msg.bot.wait { color: var(--text-3); font-style: italic; }
#gs-root .gs-as-msg.sys { align-self: center; font-size: 11.5px; color: var(--text-3); }
#gs-root .gs-as-msg code { font-family: var(--mono, monospace); font-size: 11.5px; background: var(--bg); padding: 0 4px; border-radius: 4px; }
#gs-root .gs-as-msg pre, #gs-root .gs-as-hist pre { margin: 4px 0; padding: 6px 8px; background: var(--bg); border-radius: 6px; font-size: 11px; white-space: pre-wrap; max-height: 260px; overflow: auto; }
#gs-root .gs-as-li { padding-left: 4px; }
#gs-root .gs-as-gap { height: 6px; }
#gs-root .gs-as-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--line); }
#gs-root .gs-as-quick .gs-btn { height: 26px; min-height: 0; padding: 0 9px; font-size: 11.5px; }
#gs-root .gs-as-input { display: flex; gap: 6px; padding: 6px 10px 10px; }
#gs-root .gs-as-input textarea { flex: 1; resize: vertical; min-height: 38px; max-height: 160px; font-size: 12.5px; padding: 6px 8px; }
#gs-root .gs-as-input .gs-btn { align-self: stretch; min-width: 74px; }
#gs-root .gs-as-card { margin-top: 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg-raised); padding: 6px 8px; }
#gs-root .gs-as-card.applied { border-color: color-mix(in srgb, #3ecf8e 55%, var(--line)); }
#gs-root .gs-as-card.discarded { opacity: .6; }
#gs-root .gs-as-ch { font-weight: 600; color: var(--text); margin-bottom: 4px; font-size: 12px; }
#gs-root .gs-as-ch .destr, #gs-root .gs-as-ch .err { color: #ff6b6b; }
#gs-root .gs-as-step { border-left: 3px solid var(--line-strong); padding: 3px 0 3px 8px; margin: 4px 0; }
#gs-root .gs-as-step.destr { border-left-color: #ff6b6b; background: color-mix(in srgb, #ff6b6b 8%, transparent); }
#gs-root .gs-as-step.err { border-left-color: #ff6b6b; opacity: .8; }
#gs-root .gs-as-step.denied { border-left-color: #f0b14a; }
#gs-root .gs-as-st { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: var(--text); }
#gs-root .gs-as-st > span:first-child { margin-right: auto; }
#gs-root .gs-as-badge { font-size: 10.5px; padding: 0 5px; border-radius: 8px; border: 1px solid var(--line); color: var(--text-3); white-space: nowrap; }
#gs-root .gs-as-why { color: #ff8a8a; font-size: 11.5px; }
#gs-root .gs-as-rows { border-collapse: collapse; font-size: 11px; margin-top: 2px; }
#gs-root .gs-as-rows td { padding: 1px 6px 1px 0; color: var(--text-3); vertical-align: top; max-width: 220px; overflow-wrap: anywhere; }
#gs-root .gs-as-rows td:first-child { color: var(--text-2); }
#gs-root .gs-as-step details { margin-top: 2px; font-size: 11.5px; }
#gs-root .gs-as-diff { margin: 4px 0; padding: 6px 8px; background: var(--bg); border-radius: 6px; font-size: 11px; max-height: 280px; overflow: auto; white-space: pre; }
#gs-root .gs-as-diff .add { color: #3ecf8e; }
#gs-root .gs-as-diff .del { color: #ff6b6b; }
#gs-root .gs-as-diff .gap { color: var(--text-3); }
#gs-root .gs-as-confirm { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: #ff8a8a; font-size: 11.5px; }
#gs-root .gs-as-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
#gs-root .gs-as-actions .gs-btn { height: 28px; min-height: 0; padding: 0 10px; }
#gs-root .gs-as-note { font-size: 11px; color: var(--text-3); }
#gs-root .gs-as-note.ok { color: #3ecf8e; }
#gs-root .gs-as-pr { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
#gs-root .gs-as-pr span { display: flex; flex-direction: column; }
#gs-root .gs-as-pr b { color: var(--text); font-weight: 600; }
#gs-root .gs-as-pr small { color: var(--text-3); }
#gs-root .gs-as-bk { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); }
#gs-root .gs-as-bk small { display: block; color: var(--text-3); }
#gs-root .gs-as-bk .gs-btn { height: 26px; min-height: 0; padding: 0 8px; flex: none; }
#gs-root .gs-as-restore { margin: 4px 0 8px; padding: 6px 8px; border: 1px solid var(--accent); border-radius: 6px; display: flex; flex-direction: column; gap: 3px; }
#gs-root .gs-as-hist { padding: 4px 0; border-bottom: 1px solid var(--line); }
#gs-root .gs-as-hist small { color: var(--text-3); }

/* v5.58 (Phase 11) Project window: details, selection, missing count */
#gs-root .gs-ptile.sel { background: var(--accent-soft); }
#gs-root .gs-proj-tree button small.bad { color: #e5534b; font-weight: 600; }
#gs-root .gs-proj-bar select { max-width: 110px; }
#gs-root .gs-proj-detail { flex: 0 0 270px; border-left: 1px solid var(--line); padding: 8px 10px; overflow: auto; font-size: 12px; }
#gs-root .gs-proj-detail .gs-tp-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
#gs-root .gs-proj-detail .gs-tp-row > label { flex: 0 0 92px; color: var(--text-2); }
#gs-root .gs-proj-detail .gs-tp-row > select, #gs-root .gs-proj-detail .gs-tp-row > input[type="number"] { flex: 1; min-width: 0; }
#gs-root .gs-pd-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
#gs-root .gs-pd-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
#gs-root .gs-pd-prev { margin: 4px 0 8px; padding: 6px; border-radius: 9px; background: var(--surface-2); }
#gs-root .gs-pd-sec { margin: 10px 0 4px; color: var(--text-2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
#gs-root .gs-pd-dep { padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gs-root .gs-pd-dep a { color: var(--accent); text-decoration: none; }
#gs-root .gs-pd-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* v5.59 (Phase 12) Build tool */
#gs-root .gs-bld-bump { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; flex-wrap: wrap; }
#gs-root .gs-bld-bump .gs-dim { margin-left: auto; }
#gs-root .gs-tp-card textarea[data-bnotes] { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
#gs-root .gs-bld-det > summary { cursor: pointer; }
#gs-root .gs-bld-det[open] > summary { margin-bottom: 6px; }
#gs-root .gs-bld-chk { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 12px; }
#gs-root .gs-tp-row input.bad { border-color: #e5534b; }
#gs-root .gs-bld-go { display: flex; gap: 6px; margin: 8px 0 4px; }
#gs-root .gs-bld-go .gs-cta { flex: 1; width: auto; min-width: 0; margin: 0; }
#gs-root .gs-bld-go .gs-cta.alt { flex: 0 0 auto; }
#gs-root .gs-bld-iss { padding: 3px 0; font-size: 12px; line-height: 1.4; }
#gs-root .gs-bld-iss small { display: block; color: var(--text-2); }
#gs-root .gs-bld-iss.error { color: #e5534b; }
#gs-root .gs-bld-iss.warn { color: #d29922; }
#gs-root .gs-bld-iss.ok { color: #3fb950; }
#gs-root .gs-bld-log { max-height: 240px; overflow: auto; margin: 6px 0 0; padding: 6px 8px; border-radius: 7px; background: var(--surface-2); font: 11px/1.45 ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; }
#gs-root .gs-bld-h { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 12px; }
#gs-root .gs-bld-h span { color: var(--text-2); }
#gs-root .gs-bld-h.bad b { color: #e5534b; }

/* v5.64 – live coding, live screens / streaming and Share in the Studio bar (the code editor's modules) */
#gs-root .gt-live{ display: inline-flex; align-items: center; gap: 4px; }
#gs-root .gt-rec, #gs-root .gt-scr{ display: inline-flex; align-items: center; gap: 6px; position: relative; }
#gs-root .gt-rec .rec-dot{ width: 8px; height: 8px; box-shadow: 0 0 0 2px rgba(255, 111, 135, .2); }
#gs-root .gt-rec.recording{ border-color: var(--bad); color: var(--bad); }
#gs-root .gt-rec.recording .rec-dot{ animation: rec-blink 1s infinite; }
#gs-root .gt-scr.live{ border-color: var(--ok); color: var(--ok); }
#gs-root .gt-scr.pubing::after{ content: ""; position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--bg); }
#gs-root .gt-add{ width: 100%; justify-content: center; margin: 2px 0 4px; }
@media (prefers-reduced-motion: reduce){ #gs-root .gt-rec.recording .rec-dot{ animation: none; } }
