/* Account: the account dialog, profile name and logout */

.account-inline-error > span::before,
.logout-warning > span::before {
  content: none;
}

.account-control {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 190px;
  padding: 5px 11px 5px 5px;
  overflow: hidden;
  border: 1px solid var(--control-line);
  border-radius: 999px;
  color: var(--violet-dark);
  background: var(--surface);
  font-weight: 900;
  line-height: 1;
}

.account-control:hover {
  border-color: var(--violet);
  background: var(--violet-pale);
}

.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--violet-fill);
  font-size: 0.88rem;
}

.account-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-compact-label {
  display: none;
}

/* In the readers' bars: the avatar alone, on the paper. */
.account-control-reader {
  width: 44px;
  padding: 4px;
  border-color: transparent;
  color: var(--book-ink);
  background: transparent;
}

.account-control-reader:hover {
  border-color: transparent;
  background: var(--book-tint);
}

.account-dialog {
  width: min(calc(100% - 32px), 620px);
}

.account-dialog-shell {
  position: relative;
  padding: 36px;
}

.account-dialog-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--close);
  font-size: 1.45rem;
  line-height: 1;
}

.account-dialog-close:hover:not(:disabled) {
  color: var(--ink);
  background: var(--close-hover);
}

.account-dialog-heading {
  padding-right: 48px;
}

.account-dialog-heading h2 {
  font-size: clamp(2rem, 6vw, 2.8rem);
}

.account-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.account-identity span:first-child {
  color: var(--violet-dark);
}

#account-profile-form {
  display: grid;
  gap: 14px;
}

#account-profile-form > .button {
  justify-self: start;
}

.account-save-success {
  margin: 0;
  color: var(--green);
  font-size: 0.83rem;
  font-weight: 900;
}

.account-operation-status {
  margin: 15px 0 0;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
}

.account-operation-status:focus {
  outline: none;
}

.account-inline-error {
  margin: 0;
}

.account-inline-error p,
.logout-warning p {
  margin: 1px 0 0;
}

.account-inline-error .button {
  margin-top: 10px;
}

.account-storage-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 15px;
  margin-top: 24px;
  border: 1px solid var(--note-line);
  border-radius: 15px;
  color: var(--note-ink);
  background: var(--note);
  font-size: 0.82rem;
  font-weight: 700;
}

.account-storage-note > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: var(--violet-dark);
  background: var(--note-icon);
}

.account-storage-note p {
  margin: 0;
}

.account-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.button-logout {
  color: var(--error-ink);
  border-color: var(--danger-line);
  background: var(--danger-surface);
}

.button-logout:hover:not(:disabled) {
  border-color: var(--danger-line-strong);
  background: var(--coral-pale);
}

.logout-warning {
  margin-top: 20px;
}

.logout-warning strong {
  display: block;
  margin-bottom: 4px;
}

.logout-warning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

@media (max-width: 780px) {
  .account-dialog-shell {
    padding: 31px 22px 25px;
  }

  .account-dialog {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }
}

@media (max-width: 500px) {
  .account-name {
    display: none;
  }

  .account-compact-label {
    display: inline;
  }

  .account-control {
    max-width: none;
    padding-right: 9px;
  }
}

@media (max-width: 360px) {
  .account-control {
    gap: 5px;
    padding-right: 7px;
    font-size: 0.76rem;
  }

  .account-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .account-dialog-actions,
  .logout-warning-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-dialog-actions .button,
  .logout-warning-actions .button {
    width: 100%;
  }
}
