.legacy-editors { position: relative; font-size: 10px; }
.legacy-editors summary { cursor: pointer; padding: 10px; color: var(--fighter-muted); }
.legacy-editors > div { position: absolute; right: 0; top: 100%; z-index: 40; display: grid; min-width: 170px; background: #111416; border: 1px solid #34393f; padding: 6px; }
.fighter-app.studio-mode > .workspace { display: none !important; }
body { grid-template-columns: minmax(0, 1fr); }
#studio .motion-heading { grid-template-columns: 1fr; }
#studio .motion-heading > label:first-child { display: none; }
#studio { min-height: 0; display: grid; grid-template-rows: 48px minmax(0, 1fr); background: #101214; --studio-line: #303436; font-family: system-ui, sans-serif; }
#studio button, #studio input, #studio select, #studio summary { font-family: inherit; letter-spacing: 0; }
#studio input, #studio select { font-size: 12px; }
#studio button { font-size: 12px; }
#studio button:disabled { opacity: 0.4; cursor: not-allowed; }
#studio img { width: 16px; height: 16px; flex: none; filter: invert(0.85); }
.studio-bar { display: flex; align-items: center; gap: 16px; padding: 0 12px; border-bottom: 1px solid var(--studio-line); background: #191c1e; min-width: 0; }
.studio-bar button { display: flex; align-items: center; gap: 8px; min-width: 0; }
#studio-name { max-width: 200px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
#studio-home { border: 0; background: transparent; padding-left: 0; }
#studio-location { font-size: 12px; color: #a9b0b5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#studio-saved { margin-left: auto; font-size: 11px; color: #90b49c; white-space: nowrap; }
#studio-test { background: #273a31; border-color: #587961; }
.studio-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr) 410px; min-height: 0; min-width: 0; }
.studio-library { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; padding: 12px 10px 0; gap: 8px; border-right: 1px solid var(--studio-line); background: #171a1c; min-width: 0; min-height: 0; }
#studio-search, #studio-filter { width: 100%; min-width: 0; background: #101315; border-color: #34393d; }
#studio-assets { overflow: auto; min-height: 0; }
.studio-asset-group h3 { color: #9aa3a8; font-size: 10px; text-transform: uppercase; margin: 14px 4px 6px; }
.studio-asset-group:first-child h3 { margin-top: 4px; }
#studio .studio-asset { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; text-align: left; min-height: 32px; padding: 6px; }
.studio-asset span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#studio .studio-asset.active { background: #303c38; color: #c4dfce; }
.studio-add { padding: 10px 0; border-top: 1px solid var(--studio-line); display: grid; gap: 5px; font-size: 11px; color: #9aa3a8; }
.studio-add select { min-width: 0; }
.studio-empty { font-size: 12px; color: #a9b0b5; padding: 10px; }
.studio-graph-area { display: grid; grid-template-rows: 44px minmax(0, 1fr) 28px; min-width: 0; min-height: 0; }
.studio-graph-toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--studio-line); }
#studio .studio-graph-toolbar button { width: 30px; height: 30px; min-height: 30px; padding: 5px; display: flex; align-items: center; justify-content: center; background: #1c2022; }
#studio-zoom { font-size: 11px; min-width: 40px; text-align: center; color: #9ca7ad; }
#studio .studio-graph-toolbar #studio-preview { margin-left: auto; width: auto; padding: 0 8px; gap: 6px; }
#studio-graph { position: relative; overflow: hidden; touch-action: none; background-color: #111416; background-image: radial-gradient(#353a3d 1px, transparent 1px); background-size: 20px 20px; outline-offset: -2px; cursor: grab; }
#studio-graph:active { cursor: grabbing; }
#studio-world { position: absolute; width: 1px; height: 1px; transform-origin: 0 0; }
#studio-edges { position: absolute; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
#studio-edges path { fill: none; stroke: #5a6967; stroke-width: 2; }
#studio-edges text { fill: #aeb8b6; text-anchor: middle; font-size: 11px; paint-order: stroke; stroke: #111416; stroke-width: 4px; stroke-linejoin: round; }
.studio-node { position: absolute; width: 200px; height: 96px; display: flex; align-items: center; padding: 12px; gap: 10px; border: 1px solid #41494d; border-left: 3px solid var(--node-color, #9ab1b3); border-radius: 6px; background: #202527; box-shadow: 0 4px 14px #0004; }
.studio-node[data-kind="move"], .studio-node[data-kind="command"] { --node-color: #ddb977; }
.studio-node[data-kind="event"] { --node-color: #d88d96; }
.studio-node[data-kind="animation"] { --node-color: #94be9f; }
.studio-node[data-kind="entity"] { --node-color: #9eace0; }
.studio-node[data-kind="stage"] { --node-color: #b4ba8b; }
.studio-node.selected { outline: 2px solid #c6ddd1; outline-offset: 3px; }
#studio .studio-node-select { flex: 1; min-width: 0; display: grid; gap: 6px; border: 0; background: none; padding: 0; min-height: 65px; text-align: left; cursor: grab; }
.studio-node-kind { color: var(--node-color, #a9bcc3); font-size: 10px; text-transform: uppercase; }
.studio-node strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-node small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #a5aeb3; font-size: 11px; line-height: 14px; }
.studio-thumbnail { width: 26px; height: 39px; object-fit: contain; image-rendering: pixelated; pointer-events: none; }
#studio .studio-port { position: absolute; right: -7px; top: 41px; width: 14px; height: 14px; min-height: 0; padding: 0; border-radius: 50%; border: 3px solid #95bda0; background: #18201b; cursor: crosshair; }
#studio .studio-node-open { position: absolute; right: 2px; top: 2px; min-height: 20px; height: 20px; width: 20px; padding: 2px; border: 0; background: transparent; }
.studio-graph-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; color: #95a09e; font-size: 10px; border-top: 1px solid var(--studio-line); }
.studio-inspector { display: grid; grid-template-rows: 44px minmax(0, 1fr); min-height: 0; min-width: 0; border-left: 1px solid var(--studio-line); background: #191c1e; }
.studio-inspector-title { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--studio-line); min-width: 0; font-size: 13px; }
#studio-inspector-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#studio-expand { width: 28px; min-height: 28px; padding: 5px; }
#studio-inspector-body { min-height: 0; overflow: hidden; }
#studio #editor-panel, #studio #stage-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #171b1d; }
#studio .author-tabs { display: none; }
#studio .author-pane { flex: 1; min-height: 0; overflow: auto; }
#studio .editor-header { flex: none; grid-template-columns: minmax(0, 1fr) 105px; padding: 10px 12px; }
#studio .editor-header > :nth-child(n+3) { display: none; }
#studio:not([data-inspector="character"]):not([data-inspector="animation"]) .editor-header { display: none; }
#studio[data-inspector="animation"] .editor-header { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px 28px; }
#studio[data-inspector="animation"] .editor-header > :nth-child(-n+2) { display: none; }
#studio[data-inspector="animation"] .editor-header > :nth-child(n+3) { display: grid; }
#studio .editor-header span, #studio .field > span { font-size: 11px; white-space: normal; }
#studio .logic-author { display: flex; flex-direction: column; min-height: 0; }
#studio .asset-sidebar { display: block; border: 0; background: none; order: 2; }
#studio .asset-list { display: none; }
#studio .logic-inspector { padding: 0 12px 12px; overflow: visible; }
.studio-section { border-bottom: 1px solid var(--studio-line); padding: 10px 0; }
.studio-section > summary, .studio-files > summary, .studio-native > summary { cursor: pointer; color: #d2dcda; font-size: 12px; padding: 4px 0; }
.studio-section[open] > summary { margin-bottom: 10px; }
#studio .timeline-author { margin: 0; padding: 0; border: 0; }
#studio .event-fields, #studio .attribute-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#studio .event-track { display: none; }
#studio .event-inspector { background: transparent; border: 0; padding: 12px 0; }
#studio .timeline-heading h3 { display: none; }
#studio .timeline-heading select { width: 100%; }
#studio .attribute-section { margin: 0; padding: 0; border: 0; }
.studio-native { grid-column: 1 / -1; }
.studio-native .field { margin-top: 8px; }
.studio-files { flex: none; border-top: 1px solid var(--studio-line); background: #15191b; }
.studio-files > summary { padding: 12px; }
#studio .studio-files .editor-actions { border: 0; background: transparent; }
#studio .studio-files .editor-actions > * { display: grid; }
#studio .resource-card { padding: 8px 0; border: 0; border-top: 1px solid var(--studio-line); background: transparent; }
#studio .motion-stage { max-width: 768px; margin: 0 auto; }
#studio .stage-editor-body { flex: 1; overflow: auto; min-height: 0; }
#studio .stage-editor-header, #studio .stage-editor-actions { flex: none; }
#studio.inspector-expanded .studio-layout { grid-template-columns: 188px minmax(0, 1fr); }
#studio.inspector-expanded .studio-graph-area { display: none; }
#studio.inspector-expanded .studio-inspector { width: 100%; }
#studio-connect { border: 1px solid #495851; border-radius: 6px; background: #1c2220; color: #eff4f0; padding: 24px; width: 340px; max-width: calc(100% - 24px); }
#studio-connect::backdrop { background: #0009; }
#studio-connect h2 { margin: 0 0 20px; font-size: 16px; }
#studio-connect label { display: grid; gap: 8px; font-size: 12px; }
#studio-connect form > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
@media (max-width: 1100px) {
    .studio-layout { grid-template-columns: 155px minmax(0, 1fr) 350px; }
    #studio-location { display: none; }
}
@media (max-width: 900px) {
    #studio { min-height: calc(100dvh - 115px); }
    .studio-layout { grid-template-columns: 140px minmax(0, 1fr); grid-template-rows: 360px auto; }
    .studio-library { grid-column: 1; grid-row: 1; }
    .studio-graph-area { grid-column: 2; grid-row: 1; }
    .studio-inspector { grid-column: 1 / -1; min-height: 480px; border-top: 1px solid var(--studio-line); }
    #studio-inspector-body { overflow: visible; }
    #studio .author-pane { max-height: 680px; }
    #studio .stage-editor-body { max-height: 600px; }
    #studio-saved { display: none; }
    #studio-test { margin-left: auto; }
    #studio.inspector-expanded .studio-layout { grid-template-columns: 1fr; grid-template-rows: auto; }
    #studio.inspector-expanded .studio-library { display: none; }
}
@media (max-width: 520px) {
    .studio-layout { grid-template-columns: 112px minmax(0, 1fr); }
    .studio-library { padding: 8px 5px 0; }
    #studio .studio-asset { gap: 5px; font-size: 11px; padding: 4px 2px; }
    #studio .studio-asset img { width: 12px; }
    #studio .studio-graph-toolbar { gap: 1px; padding: 4px; flex-wrap: wrap; }
    .studio-graph-area { grid-template-rows: 72px minmax(0, 1fr) 28px; }
    #studio-name { max-width: 145px; }
    #studio-count { font-size: 9px; }
    #studio-selection { display: none; }
}
