/* Wiki do Habblit: guarda-roupa interativo (local/wiki/guarda-roupa.mjs + wiki-guarda-roupa.js) */
.gr-app { display: grid; grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: 1rem; }
.gr-app > .ds-module { margin: 0; min-width: 0; }
.gr-stage { position: sticky; top: calc(var(--eco-top, 0px) + .75rem); }   /* abaixo do topo fixo da wiki */
.gr-preview { min-height: 17rem; position: relative; overflow: hidden; }
.gr-preview img { image-rendering: pixelated; max-width: 100%; height: auto; transition: opacity .15s; }
.gr-preview img.gr-size-s { width: 90px; }
.gr-preview img.gr-size-n { width: 180px; }
.gr-preview img.gr-size-l { width: 270px; }
.gr-preview.is-loading img { opacity: .55; }
.gr-preview.is-error img { opacity: .35; }
.gr-app + .wk-faq { margin-top: 1.2rem; }
.gr-loading { color: var(--ds-text-muted); }

.gr-tools { display: flex; flex-direction: column; gap: .7rem; margin-top: .8rem; }
.gr-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .6rem; }
.gr-field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.gr-field .ds-select { width: 100%; min-width: 0; }
.gr-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ds-text-muted); }
.gr-check { flex-direction: row; align-items: center; gap: .4rem; align-self: end; min-height: 2rem; font-weight: 600; }
.gr-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--ds-brand); }
.gr-seg { display: flex; flex-wrap: wrap; gap: .25rem; }
.gr-seg .ds-btn { flex: 1 1 auto; justify-content: center; }
.gr-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.gr-row > * { flex: 1 1 auto; justify-content: center; }
.gr-row .ds-btn[disabled] { opacity: .5; cursor: not-allowed; }
.gr-hidden { position: fixed; left: -9999px; top: 0; opacity: 0; }

.gr-top { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; align-items: end; margin-bottom: .8rem; }
.gr-gender .ds-btn { min-width: 7.5rem; }
.gr-nick { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 16rem; min-width: 0; }
.gr-nick-row { display: flex; gap: .35rem; }
.gr-nick-row .ds-input { flex: 1; min-width: 0; }
.gr-cats, .gr-types { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.gr-types { padding: .45rem; border-radius: 2px; background: var(--ds-surface-alt); box-shadow: var(--ds-sunken); }
.gr-panel > .ds-input { width: 100%; margin-bottom: .6rem; }
.gr-count { margin: 0 0 .5rem; font-size: .85rem; color: var(--ds-text-muted); }

.gr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr)); gap: .35rem; margin: 0 0 .7rem; padding: 0; list-style: none; }
.gr-piece { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
    border: 0; border-radius: 2px; background: var(--ds-surface); box-shadow: var(--ds-raised), 0 0 0 1px var(--ds-border-soft); }
.gr-piece img { width: 64px; height: 64px; object-fit: none; object-position: 50% 40%; image-rendering: pixelated; pointer-events: none; }
.gr-piece.gr-t-ch img, .gr-piece.gr-t-cc img, .gr-piece.gr-t-cp img, .gr-piece.gr-t-ca img { object-position: 50% 64%; }
.gr-piece.gr-t-lg img, .gr-piece.gr-t-wa img { object-position: 50% 88%; }
.gr-piece.gr-t-sh img { object-position: 50% 100%; }
.gr-piece:hover { background: var(--ds-brand-soft); }
.gr-piece:focus-visible, .gr-fx:focus-visible, .gr-sw:focus-visible { outline: 2px solid var(--ds-brand); outline-offset: 1px; }
.gr-piece.is-on, .gr-fx.is-on { background: var(--ds-brand-soft); box-shadow: inset 0 0 0 2px var(--ds-brand), 0 0 0 1px var(--ds-brand); }
.gr-piece.is-none, .gr-fx.is-none { display: flex; flex-direction: column; gap: .2rem; justify-content: center; align-items: center; font-size: .75rem; color: var(--ds-text-muted); }
.gr-hc { position: absolute; right: 2px; top: 2px; padding: 0 .2rem; font: 700 .6rem/1.3 var(--ds-font); font-style: normal; color: #5a3d00; background: var(--ds-caution); border-radius: 2px; }
.gr-more { width: 100%; justify-content: center; }

.gr-fxgrid { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
.gr-fx { display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 100%; min-height: 7.5rem; padding: .3rem; cursor: pointer; overflow: hidden;
    border: 0; border-radius: 2px; background: var(--ds-surface); box-shadow: var(--ds-raised), 0 0 0 1px var(--ds-border-soft); font-size: .75rem; color: var(--ds-text); }
.gr-fx img { width: 64px; height: 92px; object-fit: contain; image-rendering: pixelated; }
.gr-fx span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-hand { max-height: 22rem; overflow-y: auto; padding: .2rem; }

.gr-colors { margin-bottom: .7rem; }
.gr-colors[hidden] { display: none; }
.gr-colorrow { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .45rem; }
.gr-swatches { display: flex; flex-wrap: wrap; gap: 3px; max-height: 6.4rem; overflow-y: auto; padding: 3px; border-radius: 2px; background: var(--ds-surface-alt); box-shadow: var(--ds-sunken); }
.gr-sw { width: 1.35rem; height: 1.35rem; padding: 0; border: 1px solid rgba(0, 0, 0, .35); border-radius: 2px; background: var(--c); cursor: pointer; }
.gr-sw.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ds-brand); position: relative; z-index: 1; }

.gr-toast { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 2rem); box-shadow: var(--ds-shadow, 3px 3px 0 rgba(0, 0, 0, .25)); }
.gr-toast.is-bad { border-color: var(--ds-danger); }

@media (max-width: 860px) {
    .gr-app { grid-template-columns: minmax(0, 1fr); }
    .gr-stage { position: static; }
    .gr-preview { min-height: 13rem; }
}
@media (max-width: 420px) {
    .gr-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .45rem; }
    .gr-gender .ds-btn { min-width: 0; }
    .gr-grid { grid-template-columns: repeat(auto-fill, minmax(3.9rem, 1fr)); }
    .gr-piece img { width: 56px; height: 56px; }
}
