.avatar-art { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.avatar-profile { display: flex; align-items: center; gap: 16px; }
.avatar-profile .avatar { width: 64px; height: 64px; font-size: 1.25rem; }
.avatar-profile strong { display: block; margin-bottom: 7px; overflow-wrap: anywhere; }
#sheet:has(.avatar-editor) { width: min(750px, calc(100% - 24px)); }
.avatar-editor { display: grid; gap: 16px; }
.avatar-studio { max-width: 800px; }
.avatar-studio h1 { margin-bottom: 20px; }
.avatar-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr); gap: 20px; align-items: start; }
.avatar-stage {
  display: grid; justify-items: center; align-content: center; gap: 16px; min-height: 284px; padding: 22px 12px;
  border: 1px solid #bdc9af; border-radius: 13px; background-color: #dce5ce;
  background-image: repeating-linear-gradient(0deg, transparent 0 17px, #54744e12 17px 18px),
    repeating-linear-gradient(90deg, transparent 0 17px, #54744e12 17px 18px);
}
.portrait-medallion { width: min(85%, 184px); aspect-ratio: 1; border: 5px solid var(--paper);
  border-radius: 50%; box-shadow: 0 0 0 1px #95846b, 0 4px 0 #536c4624; }
.avatar-stage strong { max-width: 100%; font: italic 1.4rem/1.2 var(--serif); text-align: center; overflow-wrap: anywhere; }
.wardrobe-nav { display: flex; gap: 3px; padding: 4px; border-radius: 10px; background: #efe4d4; }
.wardrobe-nav button { flex: 1; padding: 7px 3px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 650; font-size: .9rem; }
.wardrobe-nav [aria-pressed=true] { background: var(--paper); color: var(--espresso); box-shadow: 0 1px 3px #49260c2b; }
.wardrobe-options fieldset { padding: 0; margin: 14px 0 0; border: 0; }
.wardrobe-options legend { padding: 0; margin-bottom: 7px; font-size: .92rem; }
.wardrobe-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.wardrobe-choices label { position: relative; cursor: pointer; }
.wardrobe-choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wardrobe-choices span {
  display: flex; align-items: center; gap: 6px; height: 100%; padding: 6px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper); font-size: .84rem; font-weight: 600;
}
.wardrobe-choices input:checked + span { border-color: var(--clay); box-shadow: inset 0 0 0 1px var(--clay); background: #fae9d5; }
.wardrobe-choices input:focus-visible + span { outline: 2px solid var(--espresso); outline-offset: 2px; }
.wardrobe-choices i { width: 17px; height: 17px; border-radius: 50%; border: 1px solid #402b2440; }
.wardrobe-choices .eye-sample { width: 38px; height: 22px; flex: none; }
.hat-rack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hat-rack span { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 3px; text-align: center; line-height: 1.2; }
.hat-rack svg { display: block; width: min(100%, 72px); height: 46px; }
.avatar-sharing { font-size: .9rem; }
.avatar-editor > .actions { padding-top: 12px; border-top: 1px solid var(--line); }
.roundup-hats { margin-block: 20px; }
.souvenir { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.souvenir svg { width: 64px; height: 44px; }
.souvenir strong { overflow-wrap: anywhere; flex: 1 1 100px; }
.souvenir-title { flex: 1 1 120px; min-width: 0; }
.souvenir-title small { display: block; }
.avatar-editor .avatar-stage { position: sticky; top: 0; z-index: 1; }
@media (max-height: 540px) { .avatar-editor .avatar-stage { position: static; } }
.hat-rack label { min-width: 0; overflow-wrap: anywhere; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 16rem; overflow-y: auto; padding: 3px; scrollbar-gutter: stable; }
.catalog-grid label { min-width: 0; }
.catalog-grid span { flex-direction: column; justify-content: center; text-align: center; gap: 2px; line-height: 1.2; padding: 6px 3px; }
.catalog-grid .part-sample { display: block; width: 47px; height: 25px; }
.catalog-grid .hair-sample { width: 54px; height: 43px; }
.catalog-grid .top-sample { width: 62px; height: 29px; }
@media (max-width: 590px) {
  #sheet:has(.avatar-editor) .sheet-inner { padding: 16px; }
  .avatar-layout { grid-template-columns: 1fr; gap: 12px; }
  .avatar-stage { min-height: 0; grid-template-columns: auto minmax(0, auto); justify-content: center; align-items: center; padding: 10px 14px; }
  .portrait-medallion { width: 92px; }
  .avatar-stage strong { font-size: 1.2rem; }
}
