.asset-palette { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 6px 12px 8px; align-items: flex-start; }
.asset-palette .group { display: flex; flex-direction: column; gap: 4px; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.asset-palette .cap { color: var(--subtle-text); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; height: 16px; white-space: nowrap; }
.asset-palette .tiles { display: flex; flex-wrap: wrap; gap: 4px; }

.asset-tile {
  position: relative;
  width: 96px;
  height: 52px;
  flex: none;
  padding: 1px 4px 2px;
  display: grid;
  grid-template-rows: 33px 16px;
  justify-items: center;
  align-items: center;
  background: var(--card);
  color: var(--text);
  touch-action: pan-y;
}
.asset-tile .glyph,
.asset-chip .glyph {
  width: 32px;
  height: 32px;
  background: var(--icon);
  image-rendering: pixelated;
  -webkit-mask: var(--glyph) center / 32px 32px no-repeat;
  mask: var(--glyph) center / 32px 32px no-repeat;
  pointer-events: none;
}
.asset-tile .name { max-width: 100%; font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.asset-tile .count { position: absolute; top: 3px; right: 5px; font-size: 10px; line-height: 12px; color: var(--icon); pointer-events: none; }
.asset-tile:hover .glyph { background: var(--text); }
.asset-tile:hover .count { color: var(--text); }
.asset-tile:active { background: var(--accent); }
.asset-tile .picture { width: 32px; height: 32px; display: block; image-rendering: pixelated; pointer-events: none; }
.asset-tile.block { --card: var(--tile); --icon: var(--text); }
.asset-tile.full .glyph { background: var(--disabled-text); }
.asset-tile.full .name { color: var(--disabled-text); }

.asset-chip { display: grid; place-items: center; background: var(--card); }
.asset-chip .glyph { width: 16px; height: 16px; -webkit-mask-size: 16px 16px; mask-size: 16px 16px; }

@media (max-width: 560px) {
  .asset-palette { padding: 6px 8px 8px; }
  .asset-palette .group { width: 100%; }
  .asset-palette .asset-tile { width: calc((100% - 12px) / 4); }
  .asset-palette .asset-tile .name { font-size: 11px; }
}

.asset-settings .row.stack > .label { color: var(--text); }
.asset-settings .row.stack .choices .btn { flex: 1 1 auto; }
.asset-settings .choices.many .btn { flex: 1 1 30%; }
.asset-settings .note { padding: 0 4px 6px; line-height: 1.35; }

.asset-settings .slider .readout { place-items: center end; padding: 0 9px; }
.asset-settings .slider .track.upper .readout { place-items: center start; }
.asset-settings .slider.two-way .fill { display: none; }

.asset-list { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; }
.asset-list .value { flex: 1 1 0; min-width: 0; height: 30px; line-height: 30px; padding: 0 6px; text-align: center; background: var(--tile); color: var(--value); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-list .btn { height: 30px; min-width: 30px; padding: 0; }
.asset-menu { flex: 1 1 auto; min-width: 0; height: 30px; padding: 0 6px; background: var(--tile); color: var(--value); border: 0; font: inherit; }

.asset-color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; }
.asset-swatches { display: flex; gap: 4px; }
.asset-swatches .swatch { width: 26px; height: 30px; }
.asset-swatches .swatch.on { width: 34px; }
.asset-colors { display: grid; gap: 6px; padding: 0 4px 8px; }
.asset-colors .cells { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; }
.asset-colors .cells button { aspect-ratio: 1; min-width: 0; padding: 0; }
.asset-colors .cells button.on { outline: 2px solid var(--text); outline-offset: 0; position: relative; z-index: 1; }
.asset-colors .hex { width: 112px; flex: none; }

.asset-text {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  display: block;
  border: 0;
  outline: 0;
  padding: 6px;
  background: var(--tile);
  color: var(--text);
  line-height: 1.3;
  user-select: text;
  -webkit-user-select: text;
}
.asset-text:focus { background: var(--button); }
