/* El meu perfil (#perfil, sections/profile.js) and the way in: the name and the e-mail at the bottom of the menu */
.sidebar-bottom .account-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
  margin: -4px -6px 0;
  padding: 4px 6px;
}
.sidebar-bottom .account-link:hover {
  background: #29353e;
  color: #fff;
}
.sidebar-bottom .account-link:hover small {
  color: #c7cfd5;
}
.sidebar-bottom a.avatar {
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-bottom.is-current .account-link {
  background: #2a3741;
  box-shadow: inset 0 0 0 1px #4a565e;
  color: #fff;
}
/* at El meu perfil, the circle as everywhere, in their colour, with no ring of the project's colour (Daniel,
   2026-11-21: «molesta una mica»); the name and the e-mail beside it say where you are */
.sidebar-bottom #sign-out {
  display: block;
}

.profile-page {
  display: grid;
  gap: 20px;
  max-width: 900px; /* (the seven tabs in a row, 2026-11-23) */
}
.profile-panel .panel-head .subtitle {
  margin-top: 4px;
  font-size: 14px;
}
.profile-panel .panel-body > :last-child,
.profile-panel form > :last-child {
  margin-bottom: 0;
}
.profile-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.profile-row .profile-grow {
  flex: 1;
  min-width: 0;
}
.profile-row .profile-grow input {
  margin-bottom: 6px;
}
/* «Imatge de perfil» (N15) */
.profile-field.profile-photo {
  margin-bottom: 18px;
}
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.profile-photo-preview {
  width: 56px;
  height: 56px;
  font-size: 18px;
}
.profile-note {
  margin: 0;
}
.profile-row > .button {
  margin-top: 29px;
  white-space: nowrap;
}
.profile-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 16px;
}
.password-field + .profile-note {
  margin-top: -14px;
}
.profile-panel .form-label {
  display: block;
  font-size: 14px;
  font-weight: 550;
  margin: 0 0 8px;
}
.profile-value {
  font-size: 15px;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.profile-password {
  max-width: 420px;
}
.profile-choices {
  border: 0;
  margin: 0 0 6px;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-choices legend {
  padding: 0;
  margin-bottom: 8px;
}
.profile-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  background: #fff;
}
.profile-choice input[type="radio"] {
  width: auto;
  margin: 0;
  padding: 0;
  accent-color: #398151;
}
.profile-choice:has(input:checked) {
  border-color: #398151;
  background: #eef6f0;
  font-weight: 600;
}
.profile-choices + .profile-note {
  margin-top: 8px;
}
.profile-group {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
}
.profile-group legend {
  font-size: 12px;
  letter-spacing: 1.2px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0;
  margin-bottom: 10px;
}
.profile-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.profile-check input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: #398151;
}
.profile-check small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.profile-group .profile-note {
  margin: 4px 0 0 28px;
}
@media (max-width: 760px) {
  .profile-row {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-row > .button {
    margin-top: 0;
  }
}
html.dark .profile-choice {
  background: #1e293b;
}
html.dark .profile-choice:has(input:checked) {
  border-color: #4f9a66;
  background: #1f3328;
}
html.dark .profile-choice input[type="radio"],
html.dark .profile-check input {
  accent-color: #7bc48f;
}
/* «Eliminar el compte» (server/account_delete.py) */
.profile-danger {
  border-color: #e8cfc9;
}
.profile-danger .panel-head h2 {
  color: #8f2f22;
}
.profile-delete .row-buttons,
.profile-danger .panel-body > .row-buttons {
  margin-top: 16px;
}
.profile-danger .notice p {
  margin: 0 0 8px;
}
.profile-danger .notice p:last-child {
  margin-bottom: 0;
}
html.dark .profile-danger {
  border-color: #5a342f;
}
html.dark .profile-danger .panel-head h2 {
  color: #ff9f98;
}
/* the e-mail and «Sessions obertes» (RM34: server/account_email.py, server/account_sessions.py) */
.profile-field[data-profile-email] {
  margin-bottom: 18px;
}
.profile-field [data-profile-email-form],
.profile-field [data-profile-email-pending] {
  margin: 12px 0 0;
}
[data-profile="confirm-email"] .panel-body > p {
  margin: 0 0 14px;
}
.profile-field [data-profile-email-pending] p {
  margin: 0 0 10px;
}
.profile-field .row-buttons {
  margin-top: 4px;
}
.profile-sessions {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.profile-sessions li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.profile-sessions li:first-child {
  padding-top: 0;
}
.profile-sessions .profile-grow {
  flex: 1;
  min-width: 0;
}
.profile-sessions .pill {
  margin-left: 6px;
}
.profile-sessions small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}
.profile-gate-email > p:first-child {
  margin-bottom: 16px;
}
.profile-gate-email #profile-gate-message {
  color: #9b3030;
}
.profile-gate-email #profile-gate-message:empty {
  display: none;
}
.profile-gate-email .button {
  margin-bottom: 16px;
}
html.dark .profile-gate-email #profile-gate-message {
  color: #ff9f98;
}

/* a person's colour where there is no picture (Daniel, 2026-11-21): the one they chose at El meu perfil, or the one of
   their id (personHueNiu, alpha.js), the same as the chat's circles */
.avatar.is-person {
  background: hsl(var(--person-hue) 45% 88%);
  color: hsl(var(--person-hue) 35% 26%);
}
html.dark .avatar.is-person {
  background: hsl(var(--person-hue) 25% 30%);
  color: hsl(var(--person-hue) 55% 86%);
}
fieldset[data-profile-color] {
  border: 0;
  padding: 0;
  margin: 18px 0 20px;
  min-width: 0;
}
.profile-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.profile-color {
  position: relative;
  cursor: pointer;
}
.profile-color input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.profile-color .avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.profile-color input:checked + .avatar {
  outline-color: var(--ink, #1c292b);
}
.profile-color input:focus-visible + .avatar {
  outline-color: #2b9652;
}
.profile-color.auto .avatar {
  border: 1px dashed currentColor;
}
/* «El teu color» as a drop-down (Daniel, 2026-11-21) */
.profile-color-menu {
  position: relative;
  display: inline-block;
}
.profile-color-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}
.profile-color-menu > summary::-webkit-details-marker {
  display: none;
}
.profile-color-menu > summary .avatar {
  width: 22px;
  height: 22px;
  font-size: 9px;
}
.profile-color-menu .profile-colors {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 248px;
  margin: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line, #dde2dd);
  border-radius: 10px;
  box-shadow: 0 12px 30px #1c292b2e;
}
html.dark .profile-color-menu .profile-colors {
  background: #1e293b;
  border-color: #334155;
}
/* (the notes under them are tips now: Daniel, 2026-11-21) some air between one choice and the next */
.profile-choices + .profile-choices {
  margin-top: 16px;
}
/* El meu perfil in tabs (Daniel, 2026-11-23) */
.profile-tabs {
  flex-wrap: wrap;
  overflow-x: visible;
  gap: 0 2px;
  margin: 0 0 18px;
}
.profile-tabs .tab-button {
  padding: 10px;
}
[data-profile-part] > .panel + .panel {
  margin-top: 20px;
}
