:root{
  color-scheme:dark;
  background:#1d1e20;
  --editor-ink:#f2f3f1;
  --editor-muted:#a9abad;
  --editor-line:#3b3e40;
  --editor-mint:#afe6c1;
  --editor-surface:#222426;
  --editor-raised:#292b2d;
}
.studio-page{
  min-width:0;
  min-height:100svh;
  margin:0;
  background:#1d1e20;
  color:var(--editor-ink);
  color-scheme:dark;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif;
  -webkit-font-smoothing:antialiased;
}
.studio-page :is(a,button,input,select,summary,canvas):focus-visible{
  outline:2px solid var(--editor-mint);
  outline-offset:2px;
}
.studio-page .skip-link{background:var(--editor-mint);color:#152019}
.studio-page button{transition:background-color .16s,border-color .16s,color .16s,box-shadow .16s}
.studio-workspace [hidden]{display:none!important}

/* A continuous workbench: one library, one stage, one floating context card. */
.studio-topbar{
  position:relative;
  z-index:30;
  display:flex;
  align-items:center;
  width:100%;
  max-width:none;
  height:64px;
  margin:0;
  padding:0 32px;
  gap:34px;
  border-bottom:1px solid #343638;
  background:#202123;
  color:#f4f5f4;
}
.studio-topbar .brand{display:flex;align-items:center;gap:12px;flex:none;font-size:18px;font-weight:680;letter-spacing:-.035em;white-space:nowrap}
.studio-topbar .brand-mark{color:#f0f3ef;font-size:29px;line-height:1}
.studio-topbar .brand small{display:none}
.studio-document-title{
  display:flex;
  align-items:center;
  min-width:0;
  height:28px;
  padding-left:33px;
  border-left:1px solid #4d4e50;
}
.studio-document-title h1{margin:0;color:#e8e9e8;font-size:15px;font-weight:450;line-height:1.2;letter-spacing:0;white-space:nowrap}
.studio-document-title>span{display:none}
.studio-topbar-character{
  position:absolute;
  left:50%;
  display:flex;
  align-items:center;
  gap:13px;
  transform:translateX(-50%);
  color:#e9ece9;
  font-size:14px;
  white-space:nowrap;
}
.studio-topbar-character>span:last-child{color:#b8bdb9;font-size:18px}
.studio-topbar-actions{display:flex;align-items:center;gap:13px;margin-left:auto}
.studio-topbar-actions #preview-mode{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  min-width:137px;
  min-height:40px;
  padding:0 14px;
  border-radius:8px;
  background:var(--editor-mint);
  color:#17261b;
  font-size:13px;
  font-weight:600;
}
.studio-topbar-actions #preview-mode:hover{background:#c4f1d0}
.studio-topbar-actions #preview-mode[aria-pressed="true"]{background:#d6f4de}
.studio-topbar-actions #preview-mode>span{font-size:14px}
.studio-topbar-state{display:flex;align-items:center;gap:7px;margin-left:auto;color:#b0b3b1;font-size:12px;white-space:nowrap}
.studio-topbar-state>span{width:6px;height:6px;border-radius:50%;background:var(--editor-mint)}
.studio-home-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:0 18px;
  border:1px solid #505457;
  border-radius:7px;
  background:#2b2e30;
  color:#e4e8e4;
  font-size:12px;
  font-weight:550;
  white-space:nowrap;
}
.studio-home-link:hover{border-color:#a6cbb2;background:#38433e;color:#fff}
.studio-home-link span{color:var(--editor-mint)}

.studio-main{width:100%;max-width:none;margin:0;padding:0}
.studio-intro,.studio-bottom-note{display:none}
.studio-workspace{
  display:grid;
  grid-template-columns:321px minmax(0,1fr);
  gap:0;
  width:100%;
  height:calc(100svh - 64px);
  min-height:560px;
  overflow:hidden;
  background:#202123;
}
.studio-library{
  min-width:0;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  border-right:1px solid #383a3c;
  background:#222426;
  color:#eef0ee;
  scrollbar-width:thin;
  scrollbar-color:#55595a transparent;
}
.studio-library::-webkit-scrollbar,.studio-inspector::-webkit-scrollbar{width:6px}
.studio-library::-webkit-scrollbar-thumb,.studio-inspector::-webkit-scrollbar-thumb{border-radius:8px;background:#55595a}
.workspace-panel-heading{padding:19px 28px 13px}
.workspace-panel-heading>span{color:#9fa4a3;font-size:11px;letter-spacing:.06em}
.workspace-panel-heading h2{margin:0;color:#f2f3f1;font-size:17px;line-height:1.3;font-weight:600;letter-spacing:-.025em}
.workspace-panel-heading p{margin:5px 0 0;color:#a1a5a5;font-size:11px;line-height:1.5}
.library-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  margin:0 20px;
  border-bottom:1px solid #3b3d3f;
}
.library-tabs button{
  position:relative;
  display:grid;
  place-items:center;
  min-height:58px;
  background:none;
  color:#a8aaac;
  font-size:15px;
  font-weight:450;
}
.library-tabs button:hover{color:#fff}
.library-tabs button[aria-selected="true"],.library-tabs button[aria-pressed="true"]{color:#f5f6f4;font-weight:550}
.library-tabs button[aria-selected="true"]::after,.library-tabs button[aria-pressed="true"]::after{
  content:"";
  position:absolute;
  right:11px;
  bottom:-1px;
  left:11px;
  height:2px;
  background:var(--editor-mint);
}
[data-library-panel="objects"],[data-library-panel="characters"]{min-width:0}
[data-library-panel][hidden]{display:none!important}
.object-tree{padding:20px 13px 18px 28px}
.object-root{display:flex;align-items:center;gap:15px;margin:0 28px;padding:20px 0 0;color:#f1f4f0;font-size:13px}
.object-root>span{font-size:15px;color:#d7dcd7}
.object-root strong{font-weight:520}
.library-objects .object-tree{padding-top:8px;padding-bottom:12px}
.object-tree>summary,.object-tree-title{margin:0 0 13px;color:#f2f3f1;font-size:14px;font-weight:500}
.object-row{
  display:flex;
  align-items:center;
  gap:15px;
  width:100%;
  min-height:35px;
  padding:0 14px;
  border-radius:5px;
  background:transparent;
  color:#e5e7e5;
  font-size:14px;
  line-height:1.25;
  text-align:left;
}
.object-row:hover{background:#303436}
.object-row[aria-selected="true"],.object-row[aria-pressed="true"]{background:#353e3b;color:#fff}
.object-row :is(svg,.object-icon){flex:none;width:22px;height:22px;color:#d8dcda}
.object-row .object-icon{display:inline-grid;place-items:center;font-size:21px;line-height:1}
.object-row :is(.object-eye,.object-visibility){margin-left:auto;color:#cfd4d0}
.object-row[aria-selected="true"] :is(.object-eye,.object-visibility){color:var(--editor-mint)}
.object-row .object-status{flex:none;width:9px;height:9px;margin-left:auto;border:2px solid #e2e8e2;border-radius:50%;background:#909b92;opacity:.82}
.object-row[aria-selected="true"] .object-status{border-color:var(--editor-mint);background:var(--editor-mint);opacity:1}
.object-row[data-present="false"] .object-status{border-color:#89918a;background:transparent;opacity:.55}
.object-row[data-object-select="background"]{margin-top:9px}
.library-section,.accessory-library{margin:12px 20px 0;padding:19px 8px 0;border-top:1px solid #3b3d3f}
.accessory-browser{margin:0 28px;padding:15px 0 0;border-top:1px solid #3e4141}
.library-section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 11px}
.library-section-heading h2{margin:0;color:#eef0ed;font-size:13px;font-weight:520;line-height:1.4;letter-spacing:0}
.library-section-heading>span{color:#949b96;font-size:10px}
.library-characters>.library-section-heading{margin:22px 28px 6px}
.library-section-title,.accessory-library h3{margin:0 0 15px;color:#f0f2ef;font-size:14px;font-weight:500;line-height:1.3}
.accessory-type-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:0 0 17px}
.accessory-type-tabs button{
  position:relative;
  display:grid;
  place-items:center;
  gap:4px;
  min-height:57px;
  padding:5px 2px;
  background:transparent;
  color:#aeb1b0;
  font-size:10px;
  line-height:1.2;
}
.accessory-type-tabs button:hover{color:#f2f3f1}
.accessory-type-tabs button[aria-selected="true"],.accessory-type-tabs button[aria-pressed="true"]{color:var(--editor-mint)}
.accessory-type-tabs button[aria-selected="true"]::after,.accessory-type-tabs button[aria-pressed="true"]::after{
  content:"";
  position:absolute;
  bottom:0;
  left:31%;
  width:38%;
  height:2px;
  background:var(--editor-mint);
}
.accessory-type-tabs :is(svg,.accessory-tab-icon){width:24px;height:24px}
.accessory-type-tabs button>span{font-size:22px;line-height:1}
.accessory-type-tabs button>small{font-size:10px;font-weight:450}
.accessory-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.accessory-card{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-width:0;
  min-height:99px;
  padding:7px;
  border:1px solid #383b3d;
  border-radius:9px;
  background:#303336;
  color:#e5e9e6;
  font-size:10px;
  text-align:center;
}
.accessory-card:hover{border-color:#7b9d86;background:#37413d}
.accessory-card[aria-pressed="true"]{border:2px solid var(--editor-mint);background:#343b39;box-shadow:0 0 0 1px #aee5bf33}
.accessory-card:has(img){min-height:100px;padding:0;overflow:hidden}
.accessory-card :is(img,.accessory-card-image){display:block;width:100%;height:98px;object-fit:cover}
.accessory-card:has(img)>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.accessory-card.text-card{min-height:37px}
.accessory-card svg{max-width:85%;max-height:70px}
.library-bottom{padding-bottom:2px}
.material-quick-toggle{
  display:grid;
  grid-template-columns:1fr 1fr;
  margin:13px 28px 0;
  overflow:hidden;
  border:1px solid #53595a;
  border-radius:7px;
}
.material-quick-toggle button{min-height:36px;background:#252728;color:#babfbd;font-size:12px}
.material-quick-toggle button+button{border-left:1px solid #53595a}
.material-quick-toggle button:hover{background:#353d39;color:#fff}
.material-quick-toggle button[aria-pressed="true"],.material-quick-toggle button.active{border-color:var(--editor-mint);background:#33433a;color:#f4faf5;box-shadow:inset 0 0 0 1px var(--editor-mint)}
.all-shapes-link{display:flex;align-items:center;justify-content:space-between;width:calc(100% - 56px);min-height:54px;margin:11px 28px 20px;background:transparent;color:#c5c9c6;font-size:12px;text-align:left}
.all-shapes-link:hover{color:var(--editor-mint)}

/* Existing presets and all body choices stay available in the library. */
.studio-library .property-panel{padding:17px 28px 24px;background:transparent;color:#e7e9e7}
.studio-library .property-panel>fieldset{margin:0 0 19px}
.studio-library .property-panel .property-help{color:#9b9f9d;font-size:11px;line-height:1.6}
.studio-library legend{display:flex;justify-content:space-between;width:100%;margin-bottom:13px;color:#d6dad6;font-size:12px;font-weight:550}
.studio-library output{color:#9ca3a0;font-size:10px}
.studio-workspace .presets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.studio-workspace .preset{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:7px;
  min-width:0;
  min-height:0;
  padding:5px 5px 8px;
  border:1px solid #444849;
  border-radius:8px;
  background:#303335;
  color:#f0f1ee;
  font-size:11px;
  text-align:left;
}
.studio-workspace .preset:hover{border-color:#87ac94;background:#39413d}
.studio-workspace .preset[aria-pressed="true"]{border-color:var(--editor-mint);box-shadow:inset 0 0 0 1px var(--editor-mint)}
.studio-workspace .preset-icon{display:block;width:100%;height:auto;aspect-ratio:1.12;border-radius:5px;background:#323333;object-fit:cover}
.studio-workspace .preset>span:not(.preset-arrow){display:block;padding:0 3px}
.studio-workspace .preset small{display:block;margin-top:3px;color:#a5aaa6;font-size:9px;line-height:1.3}
.studio-workspace .preset-arrow{position:absolute;right:9px;bottom:10px;margin:0;padding:0;color:var(--editor-mint);font-size:11px}
.studio-library select,.studio-inspector select{
  width:100%;
  min-height:37px;
  padding:7px 29px 7px 10px;
  border:1px solid #505456;
  border-radius:6px;
  background:#303335;
  color:#e9ede9;
  font-size:11px;
  color-scheme:dark;
}
.studio-library select:hover,.studio-inspector select:hover{border-color:#8caa94}
.studio-library details,.studio-inspector details{margin:0 0 21px;padding:0;border:0;border-top:1px solid var(--editor-line);border-radius:0;background:transparent}
.studio-library summary,.studio-inspector summary{padding:14px 0;color:#d6dbd7;font-size:11px;font-weight:550;line-height:1.5}
.studio-library summary span,.studio-inspector summary span{float:right;color:#a3aaa5;font-size:10px;font-weight:400}
.studio-workspace .animals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.studio-workspace .animal{min-height:60px;padding:6px 2px;border-color:#484c4b;background:#303335;color:#d5dcd5;font-size:9px}
.studio-workspace .animal>span{font-size:20px}
.studio-workspace .animal:hover{background:#3a4540}
.studio-workspace .animal.active{border-color:var(--editor-mint);background:#34473b;color:#fff}

/* Stage chrome is visually subordinate to the live WebGL character. */
.studio-workspace .avatar-column{position:relative;display:block;min-width:0;min-height:0;overflow:hidden;background:var(--avatar-background,#252425)}
.studio-workspace .avatar-column .playground{position:relative;display:block;width:100%;height:100%;min-height:0;overflow:hidden;border:0;background:var(--avatar-background,#252425)}
.studio-workspace .avatar-column[data-background="workbench"] .playground{
  background:#242324 url('./workbench-background.png') center center / cover no-repeat;
}
.stage-selection-line{display:none}
.stage-topline{display:none}
.stage-view-controls{
  position:absolute;
  top:23px;
  left:29px;
  z-index:5;
  display:flex;
  align-items:center;
  gap:14px;
}
.stage-view-controls :is(button,select){min-height:38px;padding:0 14px;border:1px solid #484c4e;border-radius:8px;background:#262829dd;color:#eef0ed;font-size:12px}
.stage-view-controls>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.stage-view-controls select{min-width:149px}
.stage-view-controls :is(button,select):hover{border-color:#849c89;background:#333a36}
.studio-workspace .scene-label{top:auto;bottom:35px;left:29px;gap:4px}
.studio-workspace .stage-kicker{color:#aeb3b0;font-size:11px;letter-spacing:0}
.studio-workspace .scene-label #animal-name{color:#e4e5e3;font-size:11px;font-weight:450;letter-spacing:0}
.studio-workspace .scene-footer{right:29px;bottom:35px;left:29px;width:auto;display:grid;grid-template-columns:1fr 1fr;color:#c0c3c1;font-size:11px;pointer-events:none}
.studio-workspace .scene-footer>span:last-child{text-align:left}
.viewport-toolbar{
  position:absolute;
  right:auto;
  bottom:69px;
  left:50%;
  z-index:6;
  display:flex;
  align-items:center;
  gap:3px;
  min-height:46px;
  padding:3px 6px;
  transform:translateX(-50%);
  border:1px solid #565a5b;
  border-radius:10px;
  background:#292b2ddb;
  color:#f0f2ef;
  box-shadow:0 6px 22px #0005;
  -webkit-backdrop-filter:blur(16px);
  backdrop-filter:blur(16px);
  white-space:nowrap;
}
.viewport-tool-group{display:flex;align-items:center;gap:1px}
.viewport-tool-divider{width:1px;height:22px;margin:0 6px;background:#565a5b}
.viewport-toolbar button{display:inline-flex;align-items:center;justify-content:center;min-width:37px;min-height:36px;padding:0 8px;border:0;border-radius:6px;background:transparent;color:#f1f2ef;font-size:19px;line-height:1}
.viewport-toolbar button:hover{background:#425247;color:var(--editor-mint)}
.viewport-toolbar button:active{background:#536858}
.viewport-toolbar #reset{min-width:40px;gap:4px;font-size:18px}
.viewport-toolbar #reset span{display:none}
.viewport-toolbar output{min-width:47px;color:#f4f4f2;font-size:12px;text-align:center;font-variant-numeric:tabular-nums}
.studio-workspace .scene-message{color:#d6ded7}
.studio-workspace .scene-message strong{color:#f1f4ef}
.studio-workspace .outline{border-color:#7f9d86;background:#323b35;color:#f1f7ef}

/* The property card belongs to the selected object, not to a permanent third rail. */
.studio-workspace .studio-inspector{
  position:absolute;
  top:clamp(190px,23vh,260px);
  right:32px;
  z-index:8;
  display:block;
  width:342px;
  max-height:min(375px,calc(100% - 240px));
  min-height:0;
  padding:0;
  overflow-x:hidden;
  overflow-y:auto;
  border:1px solid #515455;
  border-radius:15px;
  background:#292b2de8;
  color:#f2f3f0;
  box-shadow:0 16px 45px #0004;
  -webkit-backdrop-filter:blur(20px);
  backdrop-filter:blur(20px);
  scrollbar-width:thin;
  scrollbar-color:#55595a transparent;
}
.studio-workspace .studio-inspector[hidden]{display:none!important}
.inspector-header{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:57px;margin:0 23px;padding:0;border-bottom:1px solid #505455}
.inspector-header :is(h2,h3){margin:0;color:#f4f4f2;font-size:16px;line-height:1.3;font-weight:600;letter-spacing:-.015em}
.inspector-header button{display:grid;place-items:center;min-width:30px;min-height:30px;padding:0;border-radius:6px;background:transparent;color:#d1d5d1;font-size:18px}
.inspector-header button:hover{background:#3e4640;color:#fff}
.inspector-body{padding:0 23px 22px}
.studio-inspector .workspace-panel-heading,.inspector-tabs{display:none}
.studio-workspace .studio-inspector .property-panel{display:block;min-height:0;overflow:visible;flex:none;padding:19px 0 3px;background:transparent;color:#ecf0ec}
.studio-inspector [data-context-panel][hidden]{display:none!important}
.studio-inspector [data-context-panel]{padding:18px 23px 20px}
.studio-inspector .inspector-body [data-context-panel]{padding:0}
.studio-inspector .accessory-color-custom{display:none}
.studio-inspector[data-context="glasses"] .accessory-color-custom,
.studio-inspector[data-context="neck"] .accessory-color-custom,
.studio-inspector[data-context="hat"] .accessory-color-custom{display:block}
.studio-workspace .studio-inspector .property-panel[hidden]{display:none!important}
.studio-workspace .studio-inspector .property-panel>fieldset{margin:0 0 22px}
.studio-inspector #panel-accessories>div[data-context-panel]>label,
.studio-inspector #panel-accessories>div[data-context-panel]>.fine-tune>label,
.studio-inspector .accessory-color-custom>label{
  display:block;
  margin:0 0 9px;
  color:#e5e8e4;
  font-size:12px;
  font-weight:500;
}
.studio-inspector #panel-accessories>div[data-context-panel]>select{margin:0 0 14px}
.studio-inspector[data-context="neck"] label[for="neck"],
.studio-inspector[data-context="neck"] #neck{display:none!important}
.studio-inspector #panel-accessories>div[data-context-panel]{display:flex;flex-direction:column}
.studio-inspector #panel-accessories>div[data-context-panel]>.fine-tune{order:1}
.studio-inspector #panel-accessories>div[data-context-panel]>[data-remove-accessory]{order:2}
.studio-inspector #panel-accessories>div[data-context-panel]>.position-details{order:3}
.studio-inspector .context-color-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  padding:6px 0 18px;
  border-bottom:1px solid #4e5351;
}
.studio-inspector .context-color-row>span{flex-basis:100%;color:#e5e8e4;font-size:12px}
.studio-inspector .context-color-row button{
  width:33px;
  height:33px;
  border:2px solid #292b2d;
  border-radius:50%;
  outline:1px solid #626865;
  background:var(--swatch);
}
.studio-inspector .context-color-row button:hover{outline-color:#a1c4aa}
.studio-inspector .context-color-row button[aria-pressed="true"]{outline:2px solid var(--editor-mint);outline-offset:2px}
.studio-inspector .fine-tune{display:grid;grid-template-columns:minmax(0,1fr) 43px;align-items:center;gap:4px 9px}
.studio-inspector .fine-tune>label{grid-column:1/-1;margin:15px 0 1px!important}
.studio-inspector .fine-tune input[type=range]{grid-column:1;min-width:0}
.studio-inspector .fine-tune output{grid-column:2;text-align:right;font-size:11px}
.studio-inspector [data-remove-accessory]{display:flex;align-items:center;min-height:45px;width:100%;margin-top:20px;padding:8px 0;border-top:1px solid #4e5351;background:transparent;color:#c5cbc5;font-size:11px;text-align:left}
.studio-inspector [data-remove-accessory]:hover{color:#fff}
.studio-inspector .position-details{margin:0!important;padding:0 0 3px!important;border-top:0!important;border-bottom:0!important}
.studio-inspector .position-details>summary{padding:8px 0!important;color:#b7c1b9!important;font-size:10px!important;font-weight:450!important}
.studio-inspector .position-details>summary:hover{color:var(--editor-mint)!important}
.studio-inspector .position-details[open] .fine-tune{padding-bottom:12px}
.studio-inspector .accessory-color-custom{position:absolute;top:107px;right:23px;margin:0;padding:0;border:0}
.studio-inspector .accessory-color-custom>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.studio-inspector .accessory-color-custom input[type=color]{width:33px;height:33px;padding:2px;border:1px solid #91b99a;border-radius:50%;background:#323635;cursor:pointer}
.studio-workspace .studio-inspector legend,.studio-workspace .background-heading{display:flex;justify-content:space-between;align-items:center;width:100%;margin:0 0 12px;color:#e7e9e6;font-size:12px;font-weight:500}
.studio-workspace .studio-inspector output{color:#e9ece8;font-size:11px;font-weight:450}
.studio-workspace .studio-inspector .property-help{color:#a4aaa5;font-size:10px;line-height:1.6}
.studio-workspace .studio-inspector .property-panel>p:last-child{margin-bottom:0}
.studio-workspace .studio-inspector fieldset+fieldset{padding-top:18px;border-top:1px solid #494d4d}
.studio-workspace .material-options{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:11px 0 18px}
.studio-workspace .material-option{display:flex;flex-direction:column;align-items:flex-start;gap:7px;min-height:88px;padding:9px;border:1px solid #4b5050;border-radius:7px;background:#343738;color:#e1e5e1;font-size:10px;text-align:left}
.studio-workspace .material-option:hover{border-color:#8fb79a}
.studio-workspace .material-option.active{border-color:var(--editor-mint);background:#38453d;box-shadow:inset 0 0 0 1px var(--editor-mint)}
.studio-workspace .material-option small{display:block;margin-top:4px;color:#aab3aa;font-size:9px;font-weight:400}
.studio-workspace .material-preview{width:25px;height:22px;border-radius:4px}
.studio-workspace .swatches{display:flex;flex-wrap:wrap;gap:10px;margin:13px 0}
.studio-workspace .swatch{width:34px;height:34px;border:3px solid #292b2d;outline:1px solid #59605c;background:var(--swatch)}
.studio-workspace .swatch.active{outline:2px solid var(--editor-mint)}
.studio-workspace .swatch.active:after{color:#17271b;font-size:14px}
.studio-workspace .accessory-row{display:grid;grid-template-columns:73px minmax(0,1fr);align-items:center;gap:9px;margin-bottom:13px;color:#d5dad5;font-size:11px}
.studio-workspace .accessory-row input[type=color]{height:38px;min-height:38px;border-color:#555b58;border-radius:6px;background:#303735}
.studio-workspace .adjust{color:#bcc4bd;font-size:10px}
.studio-workspace .fine-tune p{color:#aab1ab}
.studio-workspace input[type=range]{accent-color:var(--editor-mint)}
.studio-workspace .range-labels{color:#aeb6af;font-size:10px}
.studio-workspace .background-picker{margin:0;padding:0;border:0;background:transparent;color:#e8ede9}
.studio-workspace .background-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.studio-workspace .background-swatch{width:100%;min-height:64px;padding:7px 2px;border:1px solid #4c5250;border-radius:7px;background:#343738;color:#c8d1c9;font-size:9px}
.studio-workspace .background-swatch:hover{border-color:#92b59b}
.studio-workspace .background-swatch[aria-pressed="true"]{border-color:var(--editor-mint);background:#38473c;color:#fff;box-shadow:inset 0 0 0 1px var(--editor-mint)}
.studio-workspace .background-dot{width:25px;height:25px}
.studio-workspace .background-swatch[aria-pressed="true"] .background-dot:after{color:#1a2a1d}
.studio-workspace .context-color-options{display:flex;flex-wrap:wrap;gap:11px;padding:6px 0 19px;border-bottom:1px solid #4e5351}
.studio-workspace .context-color-options button{width:36px;height:36px;border:1px solid #5b625e;border-radius:50%;background:var(--swatch,#8d688f)}
.studio-workspace .context-color-options button[aria-pressed="true"]{outline:2px solid var(--editor-mint);outline-offset:2px}
.studio-workspace .context-setting{padding:17px 0;border-bottom:1px solid #4e5351}
.studio-workspace .context-setting:last-child{border-bottom:0}
.studio-workspace .context-setting>label{display:flex;justify-content:space-between;gap:10px;color:#eceeec;font-size:12px}
.studio-workspace .context-setting output{color:#d9e2da;font-size:12px}
.studio-workspace .context-remove{display:flex;align-items:center;gap:10px;min-height:42px;margin-top:8px;background:transparent;color:#c5cbc5;font-size:11px}
.studio-workspace .context-remove:hover{color:#fff}
.mobile-editor-tabs{display:none}
.studio-page.preview-mode .studio-workspace{grid-template-columns:minmax(0,1fr)}
.studio-page.preview-mode .studio-library,
.studio-page.preview-mode .studio-inspector,
.studio-page.preview-mode .mobile-editor-tabs{display:none!important}
.studio-page.preview-mode .avatar-column{min-width:0}

@media(max-width:1140px) and (min-width:861px){
  .studio-workspace{grid-template-columns:272px minmax(0,1fr)}
  .object-tree{padding-left:20px}
  .studio-workspace .studio-inspector{right:18px;width:300px}
  .studio-workspace .scene-label{left:20px}
  .stage-view-controls{left:20px}
}

/* Mobile keeps the live stage and current controls usable; the library follows below. */
@media(max-width:860px){
  :root{--mobile-stage-height:clamp(285px,45svh,420px);scroll-padding-top:calc(56px + var(--mobile-stage-height) + 12px)}
  .studio-topbar{position:sticky;top:0;height:56px;padding:0 18px;gap:18px}
  .studio-topbar .brand{font-size:15px;gap:8px}
  .studio-topbar .brand-mark{font-size:23px}
  .studio-document-title{padding-left:17px}
  .studio-document-title h1{font-size:13px}
  .studio-topbar-state{display:none}
  .studio-topbar-character{display:none}
  .studio-topbar-actions{gap:8px}
  .studio-topbar-actions #preview-mode{min-width:86px;min-height:34px;padding:0 8px;font-size:10px;gap:6px}
  .studio-home-link{margin-left:auto;min-height:34px;padding:0 11px;font-size:10px}
  .studio-workspace{display:flex;flex-direction:column;height:auto;min-height:0;overflow:visible}
  .studio-workspace .avatar-column{order:0;display:flex;flex-direction:column;overflow:visible;padding-top:var(--mobile-stage-height);background:#222426}
  .studio-workspace .avatar-column .playground{position:fixed;top:56px;right:0;left:0;z-index:12;flex:none;width:100%;height:var(--mobile-stage-height);min-height:0;max-height:none;border-bottom:1px solid #3d4140;box-shadow:0 8px 18px #0004}
  .studio-page.preview-mode .studio-workspace{height:calc(100svh - 56px);min-height:0}
  .studio-page.preview-mode .avatar-column{flex:1;min-height:0;padding-top:0}
  .studio-page.preview-mode .avatar-column .playground{position:relative;top:auto;height:100%;min-height:0;max-height:none;box-shadow:none}
  .stage-view-controls{position:fixed;top:68px;left:14px;z-index:13;gap:7px}
  .stage-view-controls :is(button,select){min-height:34px;padding:0 9px;font-size:10px}
  .studio-workspace .scene-label{bottom:16px;left:15px}
  .studio-workspace .scene-footer{display:none}
  .viewport-toolbar{bottom:13px;left:auto;right:12px;min-height:43px;transform:none;padding:2px 4px}
  .viewport-toolbar button{min-width:40px;min-height:38px}
  .viewport-toolbar output{min-width:39px;font-size:10px}
  .viewport-tool-divider{margin:0 2px}
  .studio-workspace .studio-inspector{position:relative;top:auto;right:auto;z-index:1;order:1;width:auto;max-height:none;min-height:0;margin:0;border:0;border-bottom:1px solid #434746;border-radius:0;background:#282b2c;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none;overflow:visible}
  .studio-inspector .accessory-color-custom{top:99px;right:18px}
  .studio-workspace .studio-inspector,
  .studio-workspace .studio-inspector [data-context-panel]{scroll-margin-top:0}
  .inspector-header{min-height:50px;margin:0 18px}
  .inspector-body{padding:0 18px 13px}
  .studio-inspector [data-context-panel]{padding:17px 18px}
  .studio-inspector .inspector-body [data-context-panel]{padding:0}
  .studio-workspace .studio-inspector .property-panel{padding:17px 0 0}
  .studio-library{order:2;overflow:visible;border-right:0;background:#222426}
  .library-tabs{margin:0 15px}
  .library-tabs button{min-height:49px;font-size:13px}
  .object-tree{padding:13px 16px 15px}
  .object-row{min-height:44px}
  .accessory-library,.library-section{margin:0 16px;padding:16px 0 0}
  .accessory-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
  .material-quick-toggle{margin:20px 16px 0}
  .all-shapes-link{width:calc(100% - 32px);margin:8px 16px 17px}
  .studio-library .property-panel{padding:16px}
  .studio-workspace .presets{grid-template-columns:repeat(3,minmax(0,1fr))}
  .mobile-editor-tabs{display:flex;gap:4px;order:3;padding:10px 15px;border-top:1px solid #444846;background:#222426;overflow-x:auto}
  .mobile-editor-tabs button{flex:1;min-width:58px;min-height:42px;padding:0 8px;border-radius:6px;background:#303435;color:#bbc2bc;font-size:10px}
  .mobile-editor-tabs button[aria-pressed="true"]{background:#38493d;color:var(--editor-mint)}
}
@media(max-width:520px){
  :root{--mobile-stage-height:clamp(275px,42svh,345px)}
  .studio-topbar{gap:11px;padding:0 12px}
  .studio-topbar .brand{font-size:13px}
  .studio-topbar .brand-mark{font-size:20px}
  .studio-document-title{height:23px;padding-left:12px}
  .studio-document-title h1{font-size:11px}
  .studio-home-link{min-height:32px;padding:0 8px;font-size:9px}
  .studio-workspace .avatar-column .playground{height:var(--mobile-stage-height);min-height:0}
  .stage-view-controls :is(button,select){min-height:32px;padding:0 7px;font-size:9px}
  .studio-workspace .scene-label{bottom:9px;left:10px}
  .studio-workspace .scene-label #animal-name,.studio-workspace .stage-kicker{font-size:9px}
  .viewport-toolbar{right:7px;bottom:7px;gap:0;padding:2px}
  .viewport-toolbar button{min-width:36px;min-height:36px;padding:0 4px;font-size:16px}
  .viewport-toolbar #reset{min-width:36px}
  .viewport-toolbar output{min-width:36px;font-size:9px}
  .viewport-tool-divider{height:19px;margin:0 1px}
  .accessory-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .studio-workspace .presets{grid-template-columns:repeat(2,minmax(0,1fr))}
  .studio-workspace .animals{grid-template-columns:repeat(5,minmax(0,1fr))}
  .studio-workspace .background-options{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:350px){
  .studio-document-title h1{font-size:10px}
  .studio-topbar .brand{font-size:11px}
  .studio-home-link{padding:0 6px;font-size:8px}
  .stage-view-controls{left:7px}
  .studio-workspace .scene-label{display:none}
}
@media(prefers-reduced-motion:reduce){.studio-page :is(button,a){transition:none}}


/* MIT-licensed Tabler assets keep workbench controls consistent. */
.ui-icon{display:block;flex:none;width:22px;height:22px;object-fit:contain;filter:brightness(0) invert(.9)}
.studio-topbar .brand-mark .ui-icon{width:28px;height:28px}
.studio-topbar-character{background:transparent;padding:7px 0;cursor:pointer}
.studio-topbar-character .ui-icon{width:15px;height:15px}
.studio-topbar-actions #preview-mode .ui-icon{width:16px;height:16px;filter:none}
.accessory-type-tabs .ui-icon{width:24px;height:24px}
.bow-object-icon{display:block;width:24px;height:18px;object-fit:contain}
.object-row .object-status{width:20px;height:20px;border:0;border-radius:0;background:#cfd4d0;opacity:1;mask:url('./icons/eye.svg') center/contain no-repeat}
.object-row[aria-selected="true"] .object-status{background:var(--editor-mint);border:0}
.object-row[data-present="false"] .object-status{background:#89918a;opacity:.55;mask-image:url('./icons/eye-off.svg')}
.inspector-header button .ui-icon{width:19px;height:19px}
.stage-view-controls button .ui-icon,.viewport-toolbar .ui-icon{width:18px;height:18px}
.studio-workspace .swatch.active::after,.studio-workspace .background-swatch[aria-pressed="true"] .background-dot::after{content:'';width:13px;height:13px;background:#233829;mask:url('./icons/check.svg') center/contain no-repeat}

.studio-workspace .avatar-column:not([data-background="workbench"]) .scene-footer{color:#48534b}

@media(max-width:520px){.studio-topbar .brand-mark .ui-icon{width:20px;height:20px}}
@media(max-width:350px){.studio-topbar{gap:8px}}
