#activity[data-kind="avatar"] { width: min(710px, 95vw); }
.avatar-form { display: grid; grid-template-columns: minmax(170px,.91fr) minmax(220px,1.18fr); gap: clamp(14px,2.5vw,28px); align-items: stretch; }
.avatar-studio {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 242px; border: 1px solid #bdc5b6; border-radius: 90px 90px 16px 16px;
  background: radial-gradient(ellipse at 42% 27%,#f8f2d9 1%,#e7e8ce 47%,#d0dbbd 100%);
}
.avatar-studio::before {
  position: absolute; content: ""; z-index: -1; inset: 11px 11px 19px;
  border: 1px solid #fff9dfbf; border-radius: 80px 80px 12px 12px; pointer-events: none;
}
.avatar-model { position: absolute; inset: 2% 0 8%; width: 100%; height: 89%; touch-action: pan-y; cursor: grab; }
.avatar-model:active { cursor: grabbing; }
.avatar-turns { display: flex; position: absolute; z-index: 1; bottom: 6px; left: 50%; transform: translateX(-50%); gap: 6px; }
.avatar-turn { display: grid; place-items: center; padding: 0; width: 39px; height: 35px; border: 1px solid #acb59e; border-radius: 18px; color: #335646; background: #fff9e6ef; }
.avatar-turn .ico { width: 17px; height: 17px; }
.avatar-load { position: absolute; top: 49%; left: 4%; width: 92%; text-align: center; color: #456154; font-size: 13px; }
.avatar-settings { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.avatar-options { min-width: 0; margin: 0; padding: 0; border: 0; }
.avatar-options legend { padding: 0; margin-bottom: 6px; color: #384c3d; font-size: 14px; font-weight: 750; }
.avatar-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.avatar-option { display: block; position: relative; }
.avatar-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-choice { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 38px; padding: 4px; border: 1px solid #c6cebc; border-radius: 8px; font-size: 13px; font-weight: 650; color: #314b3e; background: #fffcf3; cursor: pointer; }
.avatar-option input:checked + .avatar-choice { border-color: #3e6550; box-shadow: inset 0 0 0 1px #3e6550; background: #e1eadb; }
.avatar-option input:focus-visible + .avatar-choice { outline: 3px solid #b57536; outline-offset: 2px; }
.avatar-choice:hover,.avatar-turn:hover { background-color: #eef1de; }
.avatar-save { border: 0; border-radius: 10px; padding: 10px 15px; min-height: 43px; width: 100%; background: var(--forest,#234a3d); color: #fff9df; font-weight: 750; line-height: 1.3; }
@media(max-width:560px){
  #activity[data-kind="avatar"] { max-height: 94dvh; }
  .avatar-form { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .avatar-studio { width: 100%; min-height: 0; height: clamp(175px,27dvh,240px); border-radius: 14px; }
  .avatar-studio::before { border-radius: 9px; inset: 7px; }
  .avatar-model { inset: 0; width: 100%; height: 100%; }
  .avatar-turns { bottom: 8px; left: auto; right: 9px; transform: none; }
  .avatar-settings { gap: 10px; }
  .avatar-choice { min-height: 38px; }
}
@media (max-height:470px) and (min-width:500px){
  .avatar-form { grid-template-columns: minmax(140px,.8fr) minmax(210px,1.2fr); }
  .avatar-studio { min-height: 212px; height: auto; }
  .avatar-settings { gap: 6px; }
  .avatar-choice,.avatar-save { min-height: 33px; }
}
#activity[data-kind="avatar"] { width: min(780px, 95vw); }
.avatar-settings { gap: 12px; }
.avatar-preview-name { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); max-width: 86%; padding: 3px 12px; overflow: hidden; text-overflow: ellipsis; border-radius: 16px; color: #2d5142; background: #fff9e8e8; font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap; }
.avatar-name-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.avatar-name-heading label { color: #384c3d; font-size: 14px; font-weight: 750; }
.avatar-name-count { color: #677768; font-size: 12px; font-variant-numeric: tabular-nums; }
.avatar-name-input { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #b9c4b2; border-radius: 8px; color: #253e33; background: #fffdf5; font: inherit; font-size: 15px; }
.avatar-name-input:focus-visible { outline: 2px solid #a26b37; outline-offset: 2px; }
.avatar-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 10px; border-bottom: 1px solid #cbd2c3; }
.avatar-tab { padding: 7px 3px; border: none; border-bottom: 2px solid transparent; color: #627166; background: transparent; font-size: 13px; font-weight: 700; line-height: 1.4; }
.avatar-tab[aria-selected="true"] { color: #264e3d; border-bottom-color: #3c6850; }
.avatar-style-pane { display: grid; gap: 10px; }
.avatar-style-pane .avatar-choice-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.avatar-style-pane .avatar-choice { min-height: 38px; line-height: 1.3; text-align: center; }
.avatar-palette { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.avatar-swatch { position: relative; display: grid; place-items: center; width: 31px; height: 32px; cursor: pointer; }
.avatar-swatch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-color-chip { width: 23px; height: 23px; border: 1px solid #3334; border-radius: 50%; }
.avatar-color-chip.avatar-original { background: repeating-linear-gradient(128deg,#f5eacb 0 4px,#a29d7b 4px 6px); }
.avatar-swatch input:checked + .avatar-color-chip { outline: 2px solid #294d3a; outline-offset: 2px; }
.avatar-swatch input:focus-visible + .avatar-color-chip { box-shadow: 0 0 0 5px #d9a55e; }
.avatar-custom-color { display: flex; align-items: center; gap: 5px; min-height: 33px; padding: 2px 6px; border: 1px solid #c4cbb9; border-radius: 7px; background: #fffaf1; color: #405d4b; cursor: pointer; font-size: 12px; font-weight: 700; }
.avatar-custom-color.selected { outline: 1px solid #345943; }
.avatar-custom-color input { width: 24px; height: 25px; padding: 0; background: transparent; border: none; cursor: pointer; }
p.avatar-feedback { margin: 0; color: #745732; font-size: 13px; line-height: 1.5; }
.avatar-save:disabled { opacity: .65; }
@media(min-width:561px) {
  .avatar-form { grid-template-columns: minmax(165px,.80fr) minmax(270px,1.22fr); }
  .avatar-studio { position: sticky; top: 0; min-height: 295px; max-height: 420px; }
}
@media(max-width:560px){
  .avatar-settings { gap: 9px; }
  .avatar-studio { height: clamp(150px,24dvh,220px); }
  .avatar-preview-name { top: 7px; left: 10px; transform: none; max-width: 40%; }
}
@media(max-width:365px){ .avatar-style-pane .avatar-choice-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
