/* Account-local profile toolbar and right-side account actions. */
/* Account-local buff profile controls. The same live DOM node is moved into the
   selected account header so profile state and event handlers remain stable. */
.profile-toolbar-slot:empty { display: none; }
.account-profile-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
  margin-top: 1px;
}
.account-profile-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}
.account-profile-toolbar select {
  width: min(240px, 100%);
  min-width: 150px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 28px 4px 8px;
  color: var(--text);
  background: var(--surface-sunken);
  font: inherit;
  font-size: 9px;
  line-height: 1.1;
}
.account-profile-toolbar select:hover:not(:disabled) { border-color: #35445e; }
.account-profile-toolbar select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(105, 213, 255, .10);
}
.account-profile-toolbar .profile-management-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.account-profile-toolbar .profile-management-actions button {
  width: auto;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
}
.account-profile-toolbar .form-feedback {
  flex: 1 0 100%;
  min-height: 0;
  max-width: 720px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-profile-toolbar .form-feedback:empty { display: none; }

@media (max-width: 640px) {
  .account-profile-toolbar { align-items: stretch; }
  .account-profile-toolbar select { flex: 1 1 180px; width: auto; }
  .account-profile-toolbar .profile-management-actions { flex: 0 0 auto; }
}

@media (max-width: 430px) {
  .account-profile-label { width: 100%; }
  .account-profile-toolbar select { flex-basis: 100%; }
  .account-profile-toolbar .profile-management-actions {
    width: 100%;
  }
  .account-profile-toolbar .profile-management-actions button {
    flex: 1 1 0;
  }
}


/* Account header: profile controls live below the reward button on the right. */
.account-control-card .account-actions {
  display: grid;
  grid-template-columns: 196px;
  grid-template-areas:
    "reward"
    "profile";
  align-items: start;
  justify-content: end;
  gap: 5px;
}
.account-control-card .account-actions .reward-menu-toggle {
  grid-area: reward;
  width: 196px;
}
.account-control-card .account-actions > .profile-toolbar-slot {
  grid-area: profile;
  width: 196px;
  min-width: 0;
}
.account-control-card .account-actions > .profile-toolbar-slot:empty { display: none; }

.account-control-card .account-actions .account-profile-toolbar {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  margin: 0;
}
.account-control-card .account-actions .account-profile-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.account-control-card .account-actions .account-profile-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding-right: 24px;
}
.account-control-card .account-actions .profile-management-actions {
  display: inline-grid;
  grid-template-columns: repeat(2, 30px);
  gap: 4px;
}
.account-control-card .account-actions .profile-management-actions button {
  width: 30px;
  min-width: 30px;
  min-height: 28px;
  padding: 3px;
  overflow: hidden;
  font-size: 0;
  white-space: nowrap;
}
.account-control-card .account-actions .profile-edit-open-button::before {
  content: 'Sửa';
  font-size: 8px;
}
.account-control-card .account-actions .profile-create-open-button::before {
  content: '+';
  font-size: 15px;
  line-height: 1;
}
.account-control-card .account-actions .account-profile-toolbar .form-feedback {
  grid-column: 1 / -1;
  max-width: 196px;
}

/* Sidebar account rows keep only account name and worker state. */
.account-row .account-row-meta { gap: 0; }
.account-row .account-row-meta > span + span::before { content: none; }
.account-row .account-balance { display: none; }

@media (max-width: 1120px) {
  .account-control-card .account-actions {
    width: auto;
    justify-self: start;
    justify-content: start;
  }
}

@media (max-width: 640px) {
  .account-control-card .account-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(172px, 196px);
  }
}

@media (max-width: 430px) {
  .account-control-card .account-actions {
    grid-template-columns: 1fr;
    grid-template-areas:
      "reward"
      "profile";
  }
  .account-control-card .account-actions .reward-menu-toggle,
  .account-control-card .account-actions > .profile-toolbar-slot {
    width: 100%;
  }
  .account-control-card .account-actions .account-profile-toolbar .form-feedback {
    max-width: none;
  }
}
