:root{color-scheme:dark;--background:#141019;--foreground:#f4ebfa;--gold:#edc986;--muted:#c1accd;--border:#6a516f;--primary:#edc986;--primary-foreground:#241b2b;--card:#302537;--popover:#302537;--accent:#624773;--accent-foreground:#fff3dd;--ring:#f5d79f;font-family:'Segoe UI',Arial,sans-serif;font-size:16px}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{background:radial-gradient(ellipse at 40% 0,#463149,#161019 75%);color:var(--foreground);font:1rem/1.4 'Segoe UI',Arial,sans-serif}button,input,select{font:inherit}button,.button{cursor:pointer;touch-action:manipulation}button,.button,select{font-size:.875rem;color:var(--foreground);background:linear-gradient(#5d4766,#3c2c46);border:1px solid #8b708e;border-bottom-color:#211729;border-radius:8px;min-height:40px;padding:8px 12px;box-shadow:inset 0 1px #e3c7df22,0 2px 0 #1b1421}button:hover,.button:hover{border-color:var(--gold);background:#61456f}button:disabled{opacity:.4;cursor:default}button[aria-pressed=true],button[aria-selected=true]{background:linear-gradient(#f1d79f,#c6a467);border-color:#ffe3a9;color:#271a2c;box-shadow:inset 0 1px #fff4cf,0 2px #19131e}.primary,button.primary{background:var(--gold);color:#261b2c;border-color:var(--gold);font-weight:650}a{color:var(--gold)}.button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,.button:focus-within{outline:3px solid #ffe6ac;outline-offset:3px}button svg{width:18px;height:18px;flex-shrink:0}h1,h2,p{margin:0}h1{font-size:1.25rem;font-weight:700;line-height:1.15}h2{font-size:1.25rem;font-weight:650;line-height:1.25}small{font-size:.75rem;letter-spacing:.1em;color:var(--muted)}[hidden]{display:none!important}
.editor-shell{display:flex;flex-direction:column;gap:12px;width:min(1440px,calc(100% - 32px));height:calc(100dvh - 32px);margin:16px auto;padding:18px;border:6px solid #483c50;border-top-color:#a189a0;border-left-color:#79667f;border-radius:30px;background:linear-gradient(130deg,#766176,#46374f 40%,#32263b);box-shadow:inset 0 0 0 2px #201925,inset 0 3px #dccbd34d,0 7px 0 #19121e,0 14px 45px #0008;position:relative}
.editor-shell:before,.editor-shell:after{content:'';position:absolute;top:5px;width:9px;height:9px;border-radius:50%;background:linear-gradient(135deg,#c8c1b0 42%,#393242 44%,#393242 55%,#a89fa6 57%);box-shadow:1px 2px 3px #0009;pointer-events:none}.editor-shell:before{left:10px}.editor-shell:after{right:10px}
.editor-header{display:flex;align-items:center;gap:16px;min-height:54px;flex:none;padding:0 4px 8px}.editor-brand{font-size:1.3rem;line-height:.9;font-weight:900;letter-spacing:-.08em;text-decoration:none;color:#f3d79b}.editor-brand span{display:block;font-size:.65rem;letter-spacing:.4em;margin-top:5px}.editor-title small{display:block;font-size:.75rem;margin-bottom:5px;color:#e1cddf}.header-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.header-actions button{padding:8px 10px;min-width:40px}.return-link{white-space:nowrap}
.editor-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,430px);gap:14px;flex:1;min-height:0}.preview-bay{display:flex;flex-direction:column;min-width:0;min-height:0;border:3px solid #23192b;border-bottom-color:#a38ba6;border-radius:20px;overflow:hidden;background:radial-gradient(ellipse at 50% 42%,#56365e,#26182f 58%,#130e1c);box-shadow:inset 0 2px 14px #0009,0 1px #d6c4d533;position:relative}.preview-readout{display:flex;justify-content:center;gap:12px;align-items:center;padding:14px 16px 0;color:#d6c3e1;font-size:.75rem;flex:none;z-index:1}.preview-stage{flex:1;min-height:0;position:relative;touch-action:none}.hand-viewer-wrap,.hand-canvas{height:100%;width:100%;position:relative}.hand-canvas canvas,#creatureStage canvas{display:block;width:100%;height:100%;touch-action:none}.model-status{position:absolute;top:42%;left:8%;right:8%;text-align:center;color:#ecd9f2}.holo-view:after{content:'';position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,transparent 0 3px,#55eaff12 3px 4px)}
.preview-toolbar{display:flex;flex-direction:column;gap:9px;align-items:center;padding:10px 12px 14px;flex:none;border-top:1px solid #6e507444;background:#2117299c}.view-buttons{display:flex;justify-content:center;gap:6px;flex-wrap:wrap}.view-buttons button{min-height:36px;padding:6px 10px;font-size:.875rem}
.zoom-row{display:flex;align-items:center;gap:8px;width:100%;max-width:300px}.zoom-row input{flex:1;min-width:0;accent-color:var(--gold);height:24px}.zoom-row button{min-height:32px;min-width:36px;padding:2px 8px;font-size:1rem;line-height:1}
.design-console{min-height:0;min-width:0;display:flex;flex-direction:column;border:2px solid #241b2b;border-top-color:#a78caa;border-bottom-color:#1c1524;border-radius:17px;background:linear-gradient(155deg,#48354f,#302337 50%);box-shadow:inset 0 1px #e4c8df33,0 4px 0 #221829;overflow:hidden}.console-tabs{flex:1;min-height:0;display:flex;flex-direction:column;gap:0}.menu-tabs{display:flex;flex:none;gap:3px;align-items:stretch;justify-content:stretch;width:100%;height:auto!important;padding:8px;background:#261c2e;border-radius:0;border-bottom:1px solid #785b7e;overflow-x:auto}.menu-tabs>button{flex:1;min-height:42px;height:auto;padding:7px 9px;white-space:nowrap;border-radius:7px;font-size:.875rem;background:#41304a;color:#decee8}.menu-tabs>button[aria-selected=true]{background:linear-gradient(#efd39e,#c7a26b);color:#281c2f;border-color:#f3dba4}.console-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#a58aad #2c2034;padding:14px}.console-scroll>[role=tabpanel]{font-size:1rem;outline:none}
.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:16px 0 12px}.panel-heading:first-child{margin-top:0}.panel-heading small{display:block;margin-bottom:4px;font-size:.75rem;letter-spacing:.07em}.panel-heading h2{color:#f5e4c6}.lock-part{width:40px;padding:9px}.material-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.material-grid button{padding:4px;border:1px solid #72587b;background:#24172e;border-radius:9px;overflow:hidden;min-width:0;display:flex;flex-direction:column;gap:4px;align-items:stretch;box-shadow:0 2px 0 #150e1e}.material-grid button[aria-pressed=true]{background:#e4c389;color:#241729;border:2px solid #ffe3a8;padding:3px}.material-grid img{width:100%;height:68px;object-fit:cover;border-radius:5px;background:#20112b;display:block}.material-grid button>span{display:flex;align-items:center;justify-content:center;min-height:34px;padding:0 2px 2px;font-size:.875rem;line-height:1.15;overflow-wrap:anywhere}#colorSwatches{display:grid;gap:10px}#colorSwatches .material-grid,#shipColourRow .material-grid{display:flex;flex-wrap:wrap;gap:7px;overflow:visible;padding:0}#colorSwatches .material-grid button,#shipColourRow .material-grid button{flex:0 0 44px;width:44px;height:44px;padding:0}#colorSwatches strong{display:block;margin:4px 0 -4px;font-size:.78rem;letter-spacing:.07em;text-transform:uppercase;color:#f5e4c6}.part-toggle{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.part-toggle button{display:flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;min-height:44px;font-size:.875rem;background:#41304a;color:#decee8}.part-toggle button[aria-checked=true]{background:linear-gradient(#efd39e,#c7a26b);color:#281c2f;border-color:#f3dba4}.part-toggle i{width:12px;height:12px;flex-shrink:0;border:1px solid #00000066;border-radius:50%}.texture-preview-row{display:flex;align-items:center;gap:8px;margin-top:8px}.panel-actions{display:flex;gap:7px;margin-top:14px;flex-wrap:wrap}.panel-actions>button:first-child{flex:1}.help{font-size:.875rem;line-height:1.5;color:#c7b3cf;margin:12px 0 2px}.console-status{flex:none;padding:10px 14px;border-top:1px solid #755b7b;background:#281e30;color:#e9d3a9;font-size:.75rem;line-height:1.4;min-height:38px;overflow-wrap:anywhere}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.field-grid>label:first-child{grid-column:1/-1}.coach-sprite-grid{grid-column:1/-1;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));max-height:290px;overflow:auto;padding:4px}.coach-sprite-grid button{align-items:center}.coach-sprite-grid canvas{width:auto;height:96px;max-width:100%;image-rendering:pixelated}.coach-sprite-grid button>span{font-size:.76rem}label{font-size:.875rem;color:#e2d0eb}select{display:block;width:100%;margin-top:7px;min-height:44px;padding:9px 10px;box-shadow:inset 0 2px 4px #160c2077;background:#281c33;border-color:#907397}select option{background:#281c33;color:#f4e8f8}.range-stack{display:grid;gap:18px;margin:20px 0}.range-field{display:block;padding:12px;border:1px solid #705478;border-radius:9px;background:#291d33;box-shadow:inset 0 1px 5px #10091788}.range-field output{float:right;color:#efd097;font-variant-numeric:tabular-nums}.range-field input{display:block;width:100%;margin-top:9px;height:28px;accent-color:var(--gold);cursor:pointer}.range-field input::-webkit-slider-runnable-track{height:8px;background:#17101f;border:1px solid #7f638b;border-radius:5px}.range-field input::-webkit-slider-thumb{margin-top:-5px}.check{display:flex;align-items:center;gap:8px;min-height:44px}.check input{width:18px;height:18px;accent-color:var(--gold)}.gesture-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.gesture-grid button{text-align:left}.file-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}.file-actions>*{
  width:48px;
  height:48px;
  min-height:48px;
  padding:0;
  justify-content:center;
  align-items:center;
  display:inline-flex;
}
.file-actions svg{
  width:24px;
  height:24px;
}.file-input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.file-actions .button{position:relative;overflow:hidden}.coach-panel{display:grid;gap:9px}.coach-panel .panel-kicker,.coach-note{display:none}.coach-panel label{font-size:.875rem;margin-top:6px}.coach-panel select{margin:0}.coach-tone{font-size:.875rem;color:#ccb5d5}.coach-panel blockquote{padding:16px;margin:8px 0;background:#251831;border:1px solid #8e6f94;border-left:3px solid var(--gold);border-radius:8px;color:#f6e3cf;font-size:1rem;line-height:1.55}.coach-panel blockquote small{display:block;margin-bottom:9px;color:var(--gold)}
@media(min-width:1100px) and (min-height:880px){.material-grid img{height:88px}.material-grid{gap:8px}}
@media(max-width:900px){.editor-shell{width:calc(100% - 16px);height:calc(100dvh - 16px);margin:8px auto;padding:12px;gap:8px;border-width:4px;border-radius:23px}.editor-workspace{grid-template-columns:minmax(0,1fr) minmax(320px,380px);gap:9px}.editor-header{gap:12px;min-height:50px;padding-bottom:2px}.header-actions{gap:4px}.editor-title small{font-size:.75rem}.preview-toolbar{padding:8px}.preview-hint{display:none}}
@media(max-width:700px){.editor-shell{padding:9px;gap:7px}.editor-brand{display:none}.editor-header{gap:8px;min-height:48px}.editor-title h1{font-size:1.05rem}.editor-title small{letter-spacing:.05em;font-size:.75rem}.header-actions button{min-width:34px;min-height:38px;padding:7px}.return-link{font-size:.8125rem;padding:6px 8px;min-height:38px}.editor-workspace{grid-template-columns:1fr;grid-template-rows:minmax(160px,41%) minmax(0,1fr);gap:8px}.preview-bay{border-radius:14px}.preview-readout{padding:7px 10px 0;font-size:.75rem}.preview-toolbar{padding:5px 7px}.view-buttons{gap:4px}.view-buttons button{font-size:.8125rem;min-height:32px;padding:4px 9px}.design-console{border-radius:12px}.menu-tabs{padding:5px;gap:3px}.menu-tabs>button{min-height:40px;font-size:.875rem;padding:6px 8px}.console-scroll{padding:10px}.panel-heading{margin:12px 0 9px}.panel-heading h2{font-size:1.125rem}.material-grid{grid-auto-flow:column;grid-template-columns:none;grid-template-rows:repeat(2,102px);grid-auto-columns:78px;gap:6px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;padding:3px 2px 9px;scrollbar-color:#b59ac0 #261c2e}.material-grid img{height:53px}.material-grid button>span{font-size:.8125rem;min-height:34px}.console-status{padding:7px 10px;min-height:32px}.range-stack{gap:12px;margin-top:14px}.range-field{padding:10px}.panel-actions{margin-top:10px}}
@media(max-height:560px) and (min-width:701px){.editor-shell{margin:4px auto;height:calc(100dvh - 8px);padding:8px}.editor-header{min-height:40px}.editor-title small{display:none}.preview-readout{padding-top:7px}.preview-toolbar{padding:5px}.menu-tabs>button{min-height:36px}.console-status{padding:6px 10px;min-height:28px}}
.material-grid.texture-grid{grid-column:1/-1;display:grid;grid-auto-flow:row;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));grid-template-rows:none;grid-auto-columns:auto;max-height:274px;overflow-x:hidden;overflow-y:auto;padding:4px}
.texture-grid button{position:relative;min-height:94px;align-items:center;text-align:center}
.texture-grid img{height:44px;width:44px;object-fit:cover;image-rendering:pixelated}
.texture-grid button>span{min-height:25px;font-size:.74rem}
.texture-grid .texture-tile-lock{position:absolute;top:4px;right:5px;font-size:12px;font-style:normal}
#shipColourRow{margin:12px 0}
/* R25: eye extras layer over any eye style. */
.eye-toggles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:12px 0}.check-field{display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 10px;border:1px solid #705478;border-radius:9px;background:#291d33;font-size:.875rem}.check-field input{width:20px;height:20px;accent-color:var(--gold);flex:none}
/* R25: the ship viewer sits above its controls and stays pinned while the colours scroll under it. */
#shipPreview{position:sticky;top:-10px;z-index:2;height:150px;margin:0 0 8px;border-radius:8px;background:#0b0714;box-shadow:0 6px 10px -6px #000c}
@media(max-height:860px){#shipPreview{height:120px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}


/* One continuous species list; identity stays above the preview. */
.coach-sprite-grid{max-height:none;overflow:visible;grid-auto-flow:row;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));grid-template-rows:none;grid-auto-columns:auto}
.coach-choice{position:relative;min-width:0;border:2px solid #b9a5c9;border-radius:10px;padding:2px;background:#171123}
.coach-choice>button[data-body]{width:100%;min-height:120px;display:flex;flex-direction:column;align-items:center;padding:6px 4px;gap:5px}
.coach-choice canvas{width:82px;height:82px;object-fit:contain;image-rendering:pixelated}
.coach-choice>button>span{font-size:.72rem;line-height:1.2;text-align:center;overflow-wrap:anywhere}
.coach-choice[data-locked=true] canvas{filter:grayscale(.8);opacity:.55}
.coach-choice-state{display:block;padding:3px 26px 4px 4px;font-size:.68rem;color:#b9a5c9}
.coach-choice-lock{position:absolute;bottom:2px;right:2px;padding:3px;min-height:32px;min-width:32px;font-size:.85rem}
.preview-readout{gap:6px;padding:6px 8px;min-height:44px;font-size:.85rem;text-align:center}
#coachPathSymbol{flex:none;border:2px solid currentColor;border-radius:7px;padding:3px 6px}
#coachDisplayName{overflow-wrap:anywhere;line-height:1.15}
#coachUnlock{padding:4px;min-width:40px;min-height:40px;flex:none}
.coach-requirement-dialog{max-width:min(92vw,480px);padding:24px;border:2px solid #d8b573;border-radius:16px;background:#25192f;color:#fff1d1}
.coach-requirement-dialog p{margin:14px 0;line-height:1.5}.coach-requirement-dialog::backdrop{background:#08050dc9}
#panel-body:has(.coach-choice) .field-grid>label:has(#body){display:none}

.preview-bay .preview-strip{top:50px}
@media(max-width:600px){.menu-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow-x:visible}.menu-tabs>button{min-width:0}}

#colourGrid button,#paletteGrid button,#shipColourGrid button{position:relative}
.swatch-lock{position:absolute;right:3px;bottom:3px;display:grid;place-items:center;width:24px;height:24px;border-radius:6px;background:#130b20e6;color:#fff;font-size:15px;line-height:1;pointer-events:none;text-shadow:none}

/* Keep adaptation selection with the menu; only the texture tiles scroll. */
.texture-menu-header{display:none;flex:none;align-items:center;gap:12px;padding:10px 14px;border-bottom:1px solid #785b7e;background:#302337}
.console-tabs:has(#tab-textures[aria-selected=true]) .texture-menu-header{display:flex}
.texture-menu-header h2{font-size:1.125rem;color:#f5e4c6}
.texture-menu-header label{display:flex;align-items:center;gap:9px;flex:1;min-width:0;font-size:.8125rem}
.texture-menu-header select{flex:1;min-width:0;margin:0}
.console-scroll:has(#panel-textures:not([hidden])){padding:6px}
#panel-textures .texture-grid{max-height:none;overflow:visible;margin:0;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:6px}
#panel-textures .texture-preview-row{display:none}
@media(max-width:700px){
 .texture-menu-header{padding:7px 10px}
 .texture-menu-header h2{display:none}
 .texture-menu-header select{min-height:42px;padding:8px}
 #panel-textures .texture-grid button{min-height:90px}
}
/* Short phones keep a full adaptation row even when installed Skins adds a menu row. */
@media(max-width:700px) and (max-height:720px){
 .editor-workspace{grid-template-rows:minmax(140px,34%) minmax(0,1fr)}
 .menu-tabs{padding:4px}
 .menu-tabs>button{min-height:32px;padding:4px 6px}
 .texture-menu-header{padding:5px 10px}
 .texture-menu-header select{min-height:36px;padding:5px 8px}
 .console-status{max-height:48px;overflow-y:auto}
}
@media(min-width:701px) and (max-height:560px){
 .editor-shell{padding:6px;gap:4px}
 .editor-header{min-height:34px;padding-bottom:0}
 .header-actions button,.return-link{min-height:32px;padding:4px 8px}
 .menu-tabs{padding:4px}
 .menu-tabs>button{min-height:32px;padding:4px 6px;font-size:.8125rem}
 .texture-menu-header{padding:4px 8px;gap:8px}
 .texture-menu-header h2{display:none}
 .texture-menu-header select{min-height:32px;padding:4px 8px}
 .console-status{min-height:24px;max-height:42px;padding:3px 8px;overflow-y:auto}
 #panel-textures .texture-grid button{min-height:74px}
 #panel-textures .texture-grid img{width:32px;height:32px}
}
