/* Custom Paintings. #cpn-scoped — tool-theme.css loads after this. */

#cpn { display: block; }

#cpn .cpn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  align-items: start;
}
#cpn .cpn-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

#cpn .cpn-field { display: block; min-width: 0; }
#cpn .cpn-label {
  display: block; font-size: 11px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; opacity: .72; margin-bottom: 6px;
}
#cpn .cpn-sub { font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .75; }
#cpn .cpn-hint { display: block; margin-top: 7px; font-size: 12.5px; line-height: 1.55; opacity: .68; }
#cpn input[type="text"] { width: 100%; padding: 9px 11px; border-radius: 8px; font-size: 15px; }

#cpn .cpn-segs { display: flex; flex-wrap: wrap; gap: 6px; }
#cpn .cpn-seg { padding: 7px 13px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }

#cpn .cpn-drop {
  border: 2px dashed rgba(127, 127, 127, .45);
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  transition: border-color .15s, background-color .15s;
}
#cpn .cpn-drop.cpn-over { border-color: currentColor; background: rgba(127, 127, 127, .08); }
#cpn .cpn-droptitle { margin: 0 0 5px; font-size: 16px; font-weight: 700; }
#cpn .cpn-dropsub { margin: 0 0 14px; font-size: 13px; opacity: .7; }
#cpn .cpn-file { display: inline-block; cursor: pointer; }

/* Slots ------------------------------------------------------------------- */
#cpn .cpn-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}
#cpn .cpn-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(127, 127, 127, .10);
  text-align: center;
}
#cpn .cpn-slot.cpn-filled { outline: 2px solid currentColor; outline-offset: -2px; }
#cpn .cpn-thumb {
  display: block;
  width: 100%;
  max-width: 88px;
  height: auto;
  border-radius: 4px;
  /* A painting is 16px per block. Anything but nearest-neighbour here shows a smoothed
   * preview of a texture the game will render sharp, which is a lie in the useful direction. */
  image-rendering: pixelated;
  background: rgba(0, 0, 0, .18);
}
#cpn .cpn-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 88px;
  aspect-ratio: 1;
  border-radius: 4px;
  border: 1px dashed rgba(127, 127, 127, .45);
  font-size: 11px;
  opacity: .55;
}
#cpn .cpn-slotname { font-size: 11.5px; font-weight: 700; line-height: 1.25; }
#cpn .cpn-slotmeta { font-size: 10px; opacity: .6; line-height: 1.3; }
#cpn .cpn-remove {
  margin-top: 2px; padding: 3px 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; cursor: pointer;
}

#cpn .cpn-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#cpn .cpn-btn { padding: 9px 15px; border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer; }
#cpn .cpn-note { margin: 0; min-height: 1.2em; font-size: 13px; line-height: 1.55; opacity: .85; }

#cpn .cpn-help { margin-top: 26px; font-size: 14.5px; line-height: 1.65; max-width: 72ch; }
#cpn .cpn-help p { margin: 0; }

#cpn [hidden] { display: none !important; }
