/* Profile view */
.profile-view { display: grid; gap: 20px; align-content: start; }
.profile-card {
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 14px;
  padding: 22px 24px;
  display: grid;
  gap: 14px;
}
.profile-card h2 { margin: 0; font-size: 15px; font-weight: 650; color: var(--text); }
.profile-card-header { display: flex; align-items: center; justify-content: space-between; }
.profile-count { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.profile-account-row { display: grid; gap: 6px; }
.profile-account-row label { font-size: 12px; color: var(--text-secondary); }
.profile-account-row input,
.profile-edit-name,
.profile-edit-details,
.profile-notes {
  background: rgb(0 0 0 / 25%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.profile-account-row input:focus,
.profile-edit-name:focus,
.profile-edit-details:focus,
.profile-notes:focus { border-color: rgb(255 255 255 / 25%); }

/* Character cards */
.profile-characters-wrap { position: relative; display: grid; gap: 10px; }
.profile-characters-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.profile-empty { margin: 0; padding: 18px 4px; color: var(--text-secondary); font-size: 13px; text-align: center; }

.profile-character {
  position: relative;
  background: rgb(0 0 0 / 22%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}
.profile-character.is-default { border-color: rgb(255 255 255 / 18%); }

.profile-character-header { display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
.profile-current-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgb(255 255 255 / 90%);
  color: #1a1a1a;
  letter-spacing: .2px;
}
.profile-menu-button {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
}
.profile-menu-button:hover { background: rgb(255 255 255 / 8%); color: var(--text); }

.profile-character-name-display { font-size: 17px; font-weight: 600; color: var(--text); }
.profile-character-details-preview {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-character-menu {
  position: absolute;
  top: 44px;
  right: 12px;
  z-index: 10;
  min-width: 120px;
  background: #2a2830;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 10px;
  padding: 6px;
  display: grid;
  gap: 2px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 40%);
}
.profile-character-menu[hidden] { display: none; }
.profile-character-menu button {
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
}
.profile-character-menu button:hover { background: rgb(255 255 255 / 8%); }
.profile-character-menu button.danger:hover { background: rgb(220 80 80 / 22%); }

/* Edit mode */
.profile-edit-name { width: 100%; font-size: 15px; }
.profile-edit-details { width: 100%; resize: vertical; min-height: 60px; font-size: 13px; }
.profile-details-count { justify-self: start; margin-top: -3px; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.profile-details-count.is-over-limit { color: #f1a5ac; }
.profile-edit-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* FAB */
.profile-fab {
  justify-self: end;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(255 255 255 / 92%);
  color: #1a1a1a;
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgb(0 0 0 / 35%);
}
.profile-fab:hover:not(:disabled) { background: #fff; }
.profile-fab:disabled { opacity: .4; cursor: not-allowed; }

.profile-notes { width: 100%; resize: vertical; }
.profile-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-footer-spacer { flex: 1; }

.profile-mini-button {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 10%);
  color: var(--text);
  cursor: pointer;
}
.profile-mini-button:hover { background: rgb(255 255 255 / 12%); }
.profile-mini-button.is-active { background: rgb(255 255 255 / 16%); border-color: rgb(255 255 255 / 28%); }

/* Profile button in sidebar footer */
.profile-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.profile-chevron {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  background: rgb(255 255 255 / 5%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
}
.profile-button:hover .profile-chevron { color: var(--text); background: rgb(255 255 255 / 12%); }
.profile-button.is-current .nickname { color: var(--text); }
.profile-button.is-current .profile-chevron { color: var(--text); background: rgb(255 255 255 / 16%); }
