/* Panel body scroll */
#edit_character_profile-form {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 14px;
  box-sizing: border-box;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  z-index: 2;
}

/* Consistent font styling for inputs and labels */
#edit_character_profile-form label,
#edit_character_profile-form input,
#edit_character_profile-form textarea {
  font-family: Arial, sans-serif;
  font-size: 14px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

/* Inputs and textarea styling */
#edit_character_profile-form input,
#edit_character_profile-form textarea {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Multiline fields expand to fit their text, then scroll after the cap. */
#edit_character_profile-form textarea {
  min-height: 96px;
  max-height: 220px;
  line-height: 1.35;
  overflow: hidden;
  resize: none;
}

/* Match dropdowns with other form inputs */
#edit_character_profile-form select:not(.panel-form-select) {
  font-family: Arial, sans-serif;
  font-size: 14px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background-color: #fff;
  color: #333;
  cursor: pointer;
}

/* Optional: small hover and focus polish */
#edit_character_profile-form select:not(.panel-form-select):hover,
#edit_character_profile-form select:not(.panel-form-select):focus {
  border-color: #66afe9;
  outline: none;
}

#edit_character_profile-panel #edit_character_profile-language-row,
#edit_character_profile-panel #edit_character_profile-thinking-row,
#edit_character_profile-panel #edit_character_profile-reasoning-effort-row,
#edit_character_profile-panel #edit_character_profile-relationship-row,
#edit_character_profile-panel #edit_character_profile-unsafe-row,
#edit_character_profile-panel #edit_character_profile-inner-reflection-row {
  width: 100%;
  max-width: 300px;
  margin-bottom: 8px;
}

#edit_character_profile-avatar {
  width: 100%;
  max-width: 300px;
}

.edit-character-profile-style-btn {
  width: 100%;
  max-width: 300px;
  margin: 0 0 12px;
}

#edit_character_profile-form input[type="file"] {
  padding: 6px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.character-reference-preview {
  width: 100%;
  max-width: 300px;
  max-height: 240px;
  object-fit: contain;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #111827;
}

#edit_character_profile-panel .panel-wrapper {
  display: flex;
  flex-direction: column;
}

#edit_character_profile-panel .panel-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 12px;
  box-sizing: border-box;
}

#app #edit_character_profile-panel .panel-footer button.panel-media-button {
  --pmb-max-width: none;
  --pmb-padding-x: 10px;
  --pmb-gap: 8px;
  --pmb-thumb-width: 30px;
  --pmb-thumb-height: 30px;
  --pmb-thumb-round-width: 30px;
  --pmb-font-size: 14px;
  width: 100%;
  max-width: none;
  min-width: 0;
}

#edit_character_profile-panel .panel-footer .panel-media-button__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
