/* Compact appearance controls; appearance never changes the stored role data. */
.appearance-studio{position:relative;isolation:isolate;grid-column:1/-1;min-width:0;margin-top:12px;border:0;border-radius:12px;background:transparent;color:#eee9d3;overflow:hidden;text-align:left}
.appearance-surface,.appearance-outline{position:absolute;inset:0;display:block;width:100%;height:100%;box-sizing:border-box;pointer-events:none}.appearance-surface{z-index:-1;-webkit-clip-path:inset(3px round 12px);clip-path:inset(3px round 12px);background:rgba(12,41,31,.20);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}.appearance-outline{z-index:4;border-style:solid;border-color:transparent;border-width:50px 45px;border-image-source:url('classic-assets/frame-v4-inner.039bd34907c9-lossless.webp');border-image-slice:145.13;border-image-repeat:stretch;filter:grayscale(1) sepia(1) saturate(2) hue-rotate(-18deg) brightness(.88)}
.appearance-heading{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;gap:10px;padding:14px 38px 11px;margin:0 14px;border-bottom:1px solid #c5a77645;color:#f2e2b5;line-height:1.5}.appearance-heading h3{font-size:15px;line-height:1.5;margin:0;font-weight:600;letter-spacing:1px}.appearance-heading>span{font-size:12px;line-height:1;color:#d8ae77}.appearance-controls{position:relative;z-index:1}
.appearance-controls{display:grid;gap:12px;padding:14px}.appearance-row{min-width:0}.appearance-row>h3{margin:0 0 7px;color:#ded9b9;font-size:12px;font-weight:600;line-height:1.5}.appearance-choice-list{display:flex;flex-wrap:wrap;gap:6px}.appearance-choice{position:relative;display:flex;align-items:center;justify-content:center;gap:5px;min-width:34px;min-height:34px;padding:5px 7px;border:1px solid #a1bea65c;border-radius:7px;background:#99b57b0d;color:#e5ebd4;box-shadow:none;font-size:12px;line-height:1.5;transition:background .15s,border-color .15s,color .15s}.appearance-choice:hover{background:#c7cf9d1c;border-color:#d5d2a375;color:#fff0c8}.appearance-choice[aria-pressed=true]{border-color:#e2c77f;background:#ceb76c26;color:#fff0c8}.appearance-choice:focus-visible{outline:2px solid #ebd593;outline-offset:2px}.appearance-choice img{display:block;width:27px;height:27px;object-fit:contain;filter:none;image-rendering:auto}.appearance-choice>svg{width:23px;height:23px;flex:0 0 23px}.appearance-choice-list.is-palette .appearance-choice{padding:4px;min-width:34px}.appearance-choice-list.is-palette .appearance-choice img{width:29px;height:29px}
.appearance-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #afc59d33;padding-top:10px}.appearance-reset{padding:5px 10px;border:1px solid #acc19c5e;border-radius:99px;background:transparent;color:#dfdfbc;font-size:12px}.appearance-reset:hover{background:#c6cc8d1c;color:#fff0c8}.appearance-status{font-size:11px;line-height:1.6;color:#c5d5bc}
.model-circle.appearance-plain{background:transparent;background-image:none;isolation:isolate}.appearance-render{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden;border-radius:50%}.appearance-render canvas{position:absolute;display:block;max-width:none;max-height:none;filter:none;image-rendering:pixelated;transform:none!important}.model-circle.has-appearance-sprite #profile-model{visibility:hidden}.model-circle #profile-model{image-rendering:auto}
.appearance-inventory{margin-top:8px;max-height:215px;overflow:auto;padding:8px;border:1px solid #9bbc9552;border-radius:8px;background:#0b302367;display:grid;grid-template-columns:repeat(auto-fill,minmax(40px,1fr));gap:6px}.appearance-inventory[hidden]{display:none}.appearance-inventory .appearance-choice{padding:4px}.appearance-inventory .appearance-choice img{width:32px;height:32px}
@media(max-width:600px){.appearance-controls{padding:11px;gap:11px}.appearance-choice-list{gap:5px}.appearance-choice{min-width:32px;min-height:33px;padding:4px 6px}.appearance-choice img{width:26px;height:26px}.appearance-row>h3{font-size:12px}.appearance-toolbar{flex-wrap:wrap;justify-content:center}.appearance-status{text-align:center}}
@media(prefers-reduced-motion:reduce){.appearance-choice{transition:none}}

.profile.has-appearance-studio .model-gender{display:none}.appearance-choice:disabled{opacity:.32;cursor:default;filter:grayscale(.65)}.appearance-choice:disabled:hover{background:#99b57b0d;border-color:#a1bea65c;color:#e5ebd4}

.appearance-basics{display:grid;grid-template-columns:88px minmax(0,1fr);gap:12px}.appearance-basics .appearance-choice{padding:4px;min-width:34px}.appearance-status{font-size:12px}
@media(max-width:600px){.appearance-basics{grid-template-columns:76px minmax(0,1fr);gap:10px}.appearance-basics .appearance-choice-list{gap:4px}.appearance-basics .appearance-choice{min-width:32px;padding:3px}}

/* Full local color choices remain inside a compact, scrollable palette. */
.appearance-color-panel{min-width:0}.appearance-color-panel>h3{margin:0 0 7px;color:#ded9b9;font-size:13px;line-height:1.5;font-weight:600}.appearance-color-palette{display:grid;grid-template-columns:repeat(auto-fill,minmax(27px,1fr));gap:6px;max-height:160px;overflow-y:auto;overscroll-behavior:contain;padding:8px;border:1px solid #adc39f59;border-radius:8px;background:#0d37274d}.appearance-color-swatch{position:relative;display:block;width:100%;height:29px;min-width:27px;padding:4px;border:1px solid #adc39f5c;border-radius:6px;background:#d5dfbc0d;box-shadow:none}.appearance-color-swatch>span{display:block;width:100%;height:100%;border-radius:3px;background:var(--swatch);box-shadow:inset 0 0 0 1px #ffffff29}.appearance-color-swatch[aria-pressed=true]{border:2px solid #f0d995;padding:3px;background:#e3d8a826}.appearance-color-swatch:hover{border-color:#f0d995;background:#e3d8a81c}.appearance-color-swatch:focus-visible{outline:2px solid #f0d995;outline-offset:1px}.appearance-colorwheel{display:block;width:22px;height:22px;flex:0 0 22px;border-radius:50%;background:conic-gradient(#eb655e,#f5d269,#9fc75b,#57baab,#6c97db,#ae77d0,#eb655e);box-shadow:inset 0 0 0 1px #eee3b777}.appearance-choice[data-appearance-palette]{font-size:13px;gap:6px;min-height:37px;padding:5px 9px}.appearance-row>h3{font-size:13px}

/* Wide controls sit below the role list and profile, keeping both compact. */
.character-layout>.appearance-studio{grid-column:1/-1;width:100%;margin-top:0;align-self:start}.appearance-controls{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:18px;row-gap:13px}.appearance-controls>.appearance-basics,.appearance-controls>.appearance-toolbar,.appearance-controls>.appearance-inventory,.appearance-controls>.appearance-color-panel{grid-column:1/-1}.appearance-basics{grid-template-columns:88px minmax(0,1fr)}
@media(max-width:600px){.appearance-controls{grid-template-columns:minmax(0,1fr);gap:12px}.appearance-basics{grid-template-columns:76px minmax(0,1fr)}}

/* Keep the full model circle above the statistics on narrow screens. */
@media(max-width:600px){
 .profile.has-appearance-studio{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;row-gap:16px}
 .profile.has-appearance-studio>.profile-heading{grid-column:1;grid-row:1}
 .profile.has-appearance-studio>.profile-model-stage{grid-column:1;grid-row:2;width:100%;height:auto;justify-self:center;align-self:start}
 .profile.has-appearance-studio>.stats{grid-column:1;grid-row:3;width:100%;min-width:0;box-sizing:border-box;justify-self:stretch}
}

/* The controls style the single upper preview without changing real role data. */
.appearance-controls>.appearance-wide{grid-column:1/-1}
.appearance-studio .appearance-choice{min-width:42px;min-height:42px;padding:4px}
.appearance-studio .appearance-choice img{display:block;width:32px;height:32px;flex:0 0 32px;object-fit:contain;image-rendering:pixelated;transform:none;filter:none}
.appearance-studio .appearance-choice[data-appearance-palette]{padding:4px 8px}
.appearance-studio .appearance-basics{grid-template-columns:104px minmax(0,1fr)}
.appearance-studio [data-appearance-gender],.appearance-studio [data-appearance-class]{width:48px;height:48px;min-width:48px;min-height:48px;padding:3px}
.appearance-studio [data-appearance-gender] img{width:40px;height:40px;flex-basis:40px}
.appearance-studio [data-appearance-class] img{width:34px;height:34px;flex-basis:34px}
@media(max-width:700px){.appearance-studio .appearance-basics{gap:10px}}

/* Keep toolbar labels clear of the restored full leaf corners. */
.appearance-controls>.appearance-toolbar{padding:10px 24px 12px}

/* Touch WebKit composites backdrop blur on the panel rather than a negative layer. */
@supports (-webkit-touch-callout:none){
 .appearance-studio{background:rgba(12,41,31,.20);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
 .appearance-studio>.appearance-surface{background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none}
}
